TRANSACTION VERIFICATION IN A CONSENSUS NETWORK
A transaction request sent by a terminal is received by a first block chain node and stored in a memory corresponding to the first block chain node. The transaction request is broadcast to second block chain nodes. The second block chain nodes store the transaction request in respective memories. At least one transaction request is obtained from the memory. The obtained at least one transaction request is packaged into a pre-processed block. The pre-processed block is broadcast to the second block chain nodes. Each second block node acquires, from another block chain node, a given transaction request identified in the pre-processed block when a determination is made that a respective memory of the second block node does not include the given transaction request. Each second block node performs consensus verification on the pre-processed block using the acquired given transaction request and transaction requests stored in its respective memory.
1 . A computer-implemented method comprising:
receiving, by a first block chain node, a transaction request sent by a terminal;
storing the transaction request in a memory corresponding to the first block chain node;
broadcasting the transaction request to second block chain nodes, such that the second block chain nodes store the transaction request in respective memories;
obtaining at least one transaction request from the memory and packaging the obtained at least one transaction request into a pre-processed block; and
broadcasting the pre-processed block to the second block chain nodes, wherein each second block node acquires, from another block chain node, a given transaction request identified in the pre-processed block when a determination is made that a respective memory of the second block node does not include the given transaction request, and wherein each second block node performs consensus verification on the pre-processed block using the acquired given transaction request and transaction requests stored in its respective memory.
2 . The computer-implemented method of claim 1 , wherein the memory is a database that stores transaction requests.
3 . The computer-implemented method of claim 2 , wherein storing the transaction request in the memory corresponding to the first block chain node comprises storing the transaction request in the memory by using preset distributed middleware.
4 . The computer-implemented method of any of claim 1 , wherein obtaining at least one transaction request from the memory comprises obtaining, from the memory, a set number of transaction requests with a transaction type higher than a set priority.
5 . The computer-implemented method of claim 4 , wherein storing the transaction request in a memory corresponding to the first block chain node comprises storing the transaction request in the memory according to the transaction type of the transaction request and a preset priority sequence of transaction types.
6 . The computer-implemented method of claim 1 , wherein the first block chain node is a leader node in a consortium chain consensus algorithm, and wherein the second block chain node is a non-leader node in the consortium chain consensus algorithm.
7 . The computer-implemented method of claim 1 , wherein acquiring the given transaction request from another block chain node comprises:
sending a query message for acquiring the given transaction request to another second block chain node or the first block chain node;
receiving a reply message returned by the other second block chain node or the first block chain node, the reply message indicating that the given transaction request is available in the memory of the other second block chain node or the first block chain node; and
acquiring the given transaction request from the other second block chain node or the first block chain node.
8 . A non-transitory, computer-readable medium storing one or more instructions executable by a computer system to perform operations comprising:
receiving, by a first block chain node, a transaction request sent by a terminal;
storing the transaction request in a memory corresponding to the first block chain node;
broadcasting the transaction request to second block chain nodes, such that the second block chain nodes store the transaction request in respective memories;
obtaining at least one transaction request from the memory and packaging the obtained at least one transaction request into a pre-processed block; and
broadcasting the pre-processed block to the second block chain nodes, wherein each second block node acquires, from another block chain node, a given transaction request identified in the pre-processed block when a determination is made that a respective memory of the second block node does not include the given transaction request, and wherein each second block node performs consensus verification on the pre-processed block using the acquired given transaction request and transaction requests stored in its respective memory.
9 . The non-transitory, computer-readable medium of claim 8 , wherein the memory is a database that stores transaction requests.
10 . The non-transitory, computer-readable medium of claim 9 , wherein storing the transaction request in the memory corresponding to the first block chain node comprises storing the transaction request in the memory by using preset distributed middleware.
11 . The non-transitory, computer-readable medium of claim 8 , wherein obtaining at least one transaction request from the memory comprises obtaining, from the memory, a set number of transaction requests with a transaction type higher than a set priority.
12 . The non-transitory, computer-readable medium of claim 11 , wherein storing the transaction request in a memory corresponding to the first block chain node comprises storing the transaction request in the memory according to the transaction type of the transaction request and a preset priority sequence of transaction types.
13 . The non-transitory, computer-readable medium of claim 8 , wherein the first block chain node is a leader node in a consortium chain consensus algorithm, and wherein the second block chain node is a non-leader node in the consortium chain consensus algorithm.
14 . The non-transitory, computer-readable medium of claim 8 , wherein acquiring the given transaction request from another block chain node comprises:
sending a query message for acquiring the given transaction request to another second block chain node or the first block chain node;
receiving a reply message returned by the other second block chain node or the first block chain node, the reply message indicating that the given transaction request is available in the memory of the other second block chain node or the first block chain node; and
acquiring the given transaction request from the other second block chain node or the first block chain node.
15 . A computer-implemented system, comprising:
one or more computers; and
one or more computer memory devices interoperably coupled with the one or more computers and having tangible, non-transitory, machine-readable media storing one or more instructions that, when executed by the one or more computers, perform one or more operations comprising:
receiving, by a first block chain node, a transaction request sent by a terminal;
storing the transaction request in a memory corresponding to the first block chain node;
broadcasting the transaction request to second block chain nodes, such that the second block chain nodes store the transaction request in respective memories;
obtaining at least one transaction request from the memory and packaging the obtained at least one transaction request into a pre-processed block; and
broadcasting the pre-processed block to the second block chain nodes, wherein each second block node acquires, from another block chain node, a given transaction request identified in the pre-processed block when a determination is made that a respective memory of the second block node does not include the given transaction request, and wherein each second block node performs consensus verification on the pre-processed block using the acquired given transaction request and transaction requests stored in its respective memory.
16 . The computer-implemented system of claim 15 , wherein the memory is a database that stores transaction requests.
17 . The computer-implemented system of claim 16 , wherein storing the transaction request in the memory corresponding to the first block chain node comprises storing the transaction request in the memory by using preset distributed middleware.
18 . The computer-implemented system of claim 15 , wherein obtaining at least one transaction request from the memory comprises obtaining, from the memory, a set number of transaction requests with a transaction type higher than a set priority.
19 . The computer-implemented system of claim 18 , wherein storing the transaction request in a memory corresponding to the first block chain node comprises storing the transaction request in the memory according to the transaction type of the transaction request and a preset priority sequence of transaction types.
20 . The computer-implemented system of claim 15 , wherein the first block chain node is a leader node in a consortium chain consensus algorithm, and wherein the second block chain node is a non-leader node in the consortium chain consensus algorithm.