Blockchains
MainChain & SQLChain
CQL uses a layered architecture for database creation and operation. A typical data creation process can be roughly as follows:
- Miner will automatically register with the MainChain after startup. The registration information includes: "Minimum acceptable Gas price", "System metrics", "External IP and port", etc.
- Miner subscribes to and pays attention to information related to themselves through ChainBus;
- The client runs
cql create -db-node 2
to send a signed database creation request to any BP (Block Producer) in the MainChain; - The BP that received the request performs a match of Miner and database creation request in the process of producing the block (see: [MainChain Produce Block] (#mainchain-produce-block));
- Database creation requests and matching results are verified and confirmed at other BP nodes;
- The Miner subscription receives the database task;
- Miners discover and connect with each other through Kayak to form a SQLChain database cluster;
- All miners are ready to wait for a request;
- Users can connect to the database and execute SQL through the
cql console
command.
See the image below to view large picture:
MainChain Produce Block
The complete main chain export process is complicated. Please refer to the numbers in the figure below for understanding. For the big picture, please click here