The structure of the Quras Command is as follows:
Items |
Description |
Network Type (Magic) |
The item in Magic indicates the type of Network, and it becomes an item to distinguish Mainnet and Testnet from QURAS Blockchain. |
Command |
The value of this item divides the basic mission as command. The description for the command will proceed as follows. |
Checksum |
This item is used to distinguish whether or not the item of the Payload is correct as the Checksum. |
Body (Payload) |
This item can be viewed by the command as the basic parameter of the command. The structure of this item is described below along with the command parameter. |
Table 1. Quras Command Items
The communication of all the packets in the QURAS Blockchain is carried out in accordance with the above Quras Command structure.
All nodes in a QURAS Blockchain will proceed with the following authentication if they receive a Quras Command:
-
Comparing the Local Network Type and Quras Command Network Type, we will perform the next step if these are the same. Otherwise, we will disconnect the concatenation.
-
Calculate the Checksum of Payload and compare it to Checksum in the Quras Command, and then perform the next step. Otherwise, we will disconnect the concatenation.
-
Check the length of the parameter and disconnect the concatenation if the length is greater than 0 x 2000000. Otherwise, we will interpret the item in Payload.
The QURAS Blockchain carries out tests on the above 3 types and verifies the accuracy of the Quras Command.
Now, let's talk about what kind of command is in a QURAS Blockchain communication command, and what kind of structure the corresponding Parameter has.
SYN Command
This is a command that exchanges information on a node to establish a concatenation between nodes.
The parameter of the SYN command is as follows:
Items |
Description |
Protocol Version |
It is the node engine communication parts as the Protocol Version of the current node. |
Module Services (Services) |
This item is an item that displays the state of the current QURAS Blockchain on the node network. |
Timestamp |
Represents the time when a command was generated. |
Port |
It represents a Port to send and receive command in the current node. |
Nonce |
This item means the number assigned randomly to identify the node that sent the command. |
User Agent |
It refers to a build version of a node. |
Block Start Height (StartHeight) |
This means the size of the Local block of a node. |
Relay |
It is an item that determines whether a packet is to be transmitted. It is set to a True value in general. |
Table 2. Version Command Item
All nodes will be able to know the state of the remote node through SYN Command and to determine which nodes it will be able to be provided to receive the necessary document, such as the block, from.
ACK Command
This command does not have any parameters.
This is a command sent to the answer when the node receives an SYN command.
In other words, it is a reply command to SYN that is sent in the sense of confirming the verification for SYN command and establishing a connection with the remote node.
GetBlocks Command
This is a command that the node sends to download the block.
The parameters of this command are as follows:
Items |
Description |
Start |
It refers to the block which is to be downloaded first. |
End |
It refers to the block which is to be downloaded last. |
Table 3. GetBlock Command Items
This command is sent to the Remote node as a command that is used to synchronize its own log blockchain from the Remote node.
Addr Command
This is a command used when sending the information on the remote node connected to itself to the requested node.
Items |
Description |
Address List |
It will be sending information about the nodes that are connected to it in a List format. |
Table 4. Addr Command Items
In this case, the meaning of the Address List item is as follows:
Items |
Description |
Module Services |
This item is an item that displays a state of a node in a QURAS Blockchain that is attached to a network. |
Timestamp |
This item means the time associated with the local node. |
Protocol Version |
It means the node engine version of the node engine as the protocol version of the current node. |
End Point |
It is the current node's Network information. Specifically, the IP address and port number. |
Table 5. Address List Items in the Address List
In other words, all nodes will receive an Addr Command and establish connections based on the information of the other nodes and connect to P2P of the QURAS Blockchain.
GetHeaders Command
This is a command that the node sends to the Remote node to download the header of the block.
The parameter of this command is the same as the GetBlocks command.
Items |
Description |
Start |
This means the block to be downloaded first. |
End |
This means the block to be downloaded last. |
Table 6. GetHeaders Command Items
This command will be implemented in FullNode and LightNode.
Specifically, LightNode downloads only the header of a block.
Mempool Command
Mempool means the storage space for a node's Transaction.
This is a command to be called to synchronize the appropriate Remote Node and Transaction.
This command does not have any parameters.
In other words, the aim of this command is to send a command to call to synchronize the currently generated Transaction.
GetAddr Command
This command will be used in the following cases:
All nodes store the information of the connected node in a PeerList.
This is because a node is connected to a chain of P2P blocks again when a node is rebooted or reconnected to the Internet.
Since the QURAS Blockchain is a P2P method instead of a Server / Client method, all nodes are connected to the server by any number of nodes, thereby forming a single large P2P network in connection with any number of nodes.
-
In the case where this command is available is when the node is started for the first time, and the node’s PeerList is empty. In this case, the node connects to a node called a SeedNote of blockchains and sends this command. In other words, this command is used to obtain the connectable node information, and it is connected to the P2P network of the QURAS Blockchain.
-
In the second case, the node has a PeerList, but the number of nodes in the PeerList or the number of nodes that are currently concatenated is smaller than the number of nodes that are bound to the standard. In other words, a node needs to be concatenated with about 6 nodes, but the number of nodes currently connected to the node is assumed to be 2. In such a case, the node can send a GetAddr command to the 2 nodes to which the node is connected to secure the concatenation information. When all nodes on the P2P network receive a GetAddr command, they query the information on the node that is connected to it, collect the latest information, and send it back.
In the same manner, all nodes in the QURAS Blockchain will be connected to a P2P network to form a blockchain.
GetAddr command does not have any parameters.
The GetAddr response will result in an Addr Command.
INV Command
This is a command that sends a hash value for the Transaction, Block, and Consensus.
The items for the parameters are as follows:
Items |
Description |
Type |
This is an item that specifies the format of an INV command.
0: Transaction
1: Block
2: Consensus
|
HashList |
This means the List of Hash corresponding to the Item of Type. |
Table 7. Inv Command Items
The description of the above items is as follows.
-
In the case of Type: 0, the Hash List of the Transaction is sent in the form of a Hash list in response to the response of the Mempool Command.
-
When Type: 1, when a Get Blocks Command is received, the block Hash value from the Start of the block to the end of the block is generated by the hash list.
-
Type: 2 will be used in the communications between the Consensus Nodes
This command will also work in response to GetData Command.
Tx Command
This is a command that sends the information of a Transaction as a response to a GetData command.
This command will also be used to send the Transaction information for Hash, which is requested in response to the Inv Command.
The Tx Command is the same as the Structure of the Transaction as the parameter.
The structure of the Transaction will be specifically mentioned later.
Block Command
This is also a command transmitted by the request of GetData or Inv Command like the Tx Command.
In the same manner as the Tx Command, the block value corresponding to the Hash of GetData or Inv Command is transmitted in the parameter.
The structure of the block will also be mentioned later.
Merkle Block Command
This command will form the parameter in the block header value of the block, the number of transactions that the block has, and the Merkle Tree Hash value that is created by the Transaction.
Items |
Description |
Block Header |
This part will be described later. (Link) |
Tx Count |
It refers to the number of transactions contained in a block. |
Hash List |
It forms the Merkle tree and is an array value for the Merkle Tree. |
Table 8. MerkleBlock Command Items
Consensus Command
This command includes agreement and related content as a command exchanged between agreed nodes.
For this command, refer to the link.
Headers Command
This command requests the header value of the block, that is, this command extracts and transmits the header information as a response to the request by the Get Headers Command.
The parameter of this command is the same as the block header and so refer to the link.
All nodes of the QURAS Blockchain will communicate the requested data through the above command structure.