WO2023207077A1 - 区块链节点的迁移方法及装置 - Google Patents
区块链节点的迁移方法及装置 Download PDFInfo
- Publication number
- WO2023207077A1 WO2023207077A1 PCT/CN2022/135225 CN2022135225W WO2023207077A1 WO 2023207077 A1 WO2023207077 A1 WO 2023207077A1 CN 2022135225 W CN2022135225 W CN 2022135225W WO 2023207077 A1 WO2023207077 A1 WO 2023207077A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- node
- subnet
- blockchain
- network
- genesis block
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 110
- 230000005012 migration Effects 0.000 title claims abstract description 106
- 238000013508 migration Methods 0.000 title claims abstract description 106
- 238000003860 storage Methods 0.000 claims description 29
- 238000004891 communication Methods 0.000 claims description 28
- 230000001360 synchronised effect Effects 0.000 claims description 8
- 230000004044 response Effects 0.000 claims description 5
- 230000008569 process Effects 0.000 description 42
- 230000006855 networking Effects 0.000 description 17
- 238000007726 management method Methods 0.000 description 12
- 230000007246 mechanism Effects 0.000 description 10
- 230000006870 function Effects 0.000 description 8
- 239000003999 initiator Substances 0.000 description 8
- 238000005516 engineering process Methods 0.000 description 7
- 238000012544 monitoring process Methods 0.000 description 7
- 238000010586 diagram Methods 0.000 description 6
- 238000012545 processing Methods 0.000 description 6
- 230000005540 biological transmission Effects 0.000 description 4
- 230000008859 change Effects 0.000 description 4
- 230000003993 interaction Effects 0.000 description 4
- 230000008901 benefit Effects 0.000 description 3
- 238000010276 construction Methods 0.000 description 2
- 238000012217 deletion Methods 0.000 description 2
- 230000037430 deletion Effects 0.000 description 2
- 230000000977 initiatory effect Effects 0.000 description 2
- 238000002955 isolation Methods 0.000 description 2
- 238000003672 processing method Methods 0.000 description 2
- 238000012795 verification Methods 0.000 description 2
- OKTJSMMVPCPJKN-UHFFFAOYSA-N Carbon Chemical compound [C] OKTJSMMVPCPJKN-UHFFFAOYSA-N 0.000 description 1
- 230000009471 action Effects 0.000 description 1
- 230000015572 biosynthetic process Effects 0.000 description 1
- 239000006227 byproduct Substances 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000008034 disappearance Effects 0.000 description 1
- 229910021389 graphene Inorganic materials 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000014759 maintenance of location Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002085 persistent effect Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/104—Peer-to-peer [P2P] networks
- H04L67/1044—Group management mechanisms
- H04L67/1046—Joining mechanisms
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/104—Peer-to-peer [P2P] networks
- H04L67/1044—Group management mechanisms
- H04L67/1048—Departure or maintenance mechanisms
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/104—Peer-to-peer [P2P] networks
- H04L67/1059—Inter-group management mechanisms, e.g. splitting, merging or interconnection of groups
Definitions
- the embodiments of this specification belong to the field of blockchain technology, and particularly relate to a method and device for migrating blockchain nodes.
- Blockchain technology is built on a transmission network (such as a point-to-point network) and is a new application model of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanisms, and encryption algorithms.
- the nodes in the blockchain network combine the data blocks into a chain data structure in a chronological manner, and cryptographically guarantee a distributed ledger that cannot be tampered with or forged.
- Some blockchain nodes in the blockchain network can participate in building a blockchain subnet to meet the small-scale interaction needs among these blockchain nodes.
- some subnet nodes may have migration needs, that is, the blockchain nodes need to change the node equipment where they are located. In this regard, how to achieve controllable migration of subnet nodes is an issue that needs to be solved urgently.
- one or more embodiments of this specification provide a method and device for migrating blockchain nodes.
- a method for migrating blockchain nodes including: a mainnet node deployed in a first node device transmits data to the first node device by executing a node migration transaction
- the genesis block information of the blockchain subnet is sent by the first node device to the second node device.
- the blockchain mainnet to which the mainnet node belongs is used to manage the blockchain subnet.
- the second node device generates a genesis block according to the genesis block information, and starts the second subnet node by loading the genesis block; the second subnet node joins the blockchain subnet, and loads the Historical data of the first subnet node in the blockchain subnet; when the second subnet node completes loading of the historical data, the first subnet node exits the blockchain subnet.
- a blockchain node migration device including: an information disclosure unit for the main network node deployed in the first node device to execute a node migration transaction Revealing the genesis block information of the blockchain subnet to the first node device, so that the first node device sends the genesis block information to the second node device, and the blockchain main network to which the main network node belongs uses For managing the blockchain subnet; a node startup unit for the second node device to generate a genesis block according to the genesis block information, and to start the second subnet node by loading the genesis block; a node joining unit, The second subnet node is used to join the blockchain subnet and load the historical data of the first subnet node in the blockchain subnet; the node exit unit is used to load the historical data on the second subnet node. Upon completion, the first subnet node exits the blockchain subnet.
- an electronic device including: a processor; and a memory for storing instructions executable by the processor.
- the processor implements the method as described in any one of the first aspects by running the executable instructions.
- a computer-readable storage medium on which computer instructions are stored.
- the instructions are executed by a processor, the method as described in any one of the first aspects is implemented. A step of.
- the mainnet node reveals the genesis block information of the blockchain subnet to the first node device where it is located by executing a node migration transaction. And the first node device sends the information to the second node device. The second node device generates and loads the genesis block based on this information to start the second subnet node, and the subnet node loads the historical data of the first subnet node after joining the blockchain subnet. The first subnet node exits the blockchain subnet when the second subnet node is loaded.
- the newly activated second subnet node in the blockchain subnet loads the historical data of the first subnet node, and the first subnet node exits the blockchain subnet after the above loading is completed.
- the first subnet node and the second subnet node are the subnet nodes before migration and after migration respectively; moreover, the historical data of the first subnet node is loaded after the second subnet node is started, which is helpful for the migration of the third subnet node after migration.
- the second subnet node participates in the blockchain subnet normally.
- the blockchain main network triggers the migration of subnet nodes by executing blockchain transactions, realizing the effective control of the node migration process of the blockchain subnet by the blockchain main network. It can be seen that this solution achieves effective and controllable migration of subnet nodes in the scenario where the blockchain mainnet manages the blockchain subnet.
- Figure 1 is a schematic diagram of a blockchain network provided by an exemplary embodiment.
- Figure 2 is a flow chart of a blockchain node migration method provided by an exemplary embodiment.
- Figure 3 is a schematic diagram of a blockchain node migration process provided by an exemplary embodiment.
- Figure 4 is a schematic structural diagram of a device provided by an exemplary embodiment.
- Figure 5 is a block diagram of a blockchain node migration device provided in an exemplary embodiment.
- Persons or institutions can participate in the blockchain network as node members. For example, they can participate in the establishment of a blockchain network or join an already established blockchain network. Among them, any person or institution can participate in only one blockchain network, or can participate in multiple blockchain networks.
- all blockchain nodes in the blockchain network usually maintain the same block data, making it difficult to meet the special needs of some nodes.
- all alliance members i.e., node members within the alliance
- All alliance members have corresponding blockchain nodes in the blockchain network and can pass through the corresponding zones.
- Blockchain nodes obtain all transactions and related data that occur on the blockchain network.
- These alliance members hope that these transactions can be stored on the blockchain or take advantage of other advantages of blockchain technology, and can avoid other Alliance members view these transactions and related data.
- these alliance members can additionally form a new blockchain network, which is similar to the above-mentioned blockchain network containing all alliance members, building a new blockchain network from scratch requires a large amount of resources, and regardless of The establishment process of the blockchain network or the configuration process after it is built are very time-consuming.
- the demands among alliance members are often temporary or time-sensitive, so that the newly built blockchain network will soon lose the meaning of existence due to the disappearance of demand, thus further increasing the chain construction cost of the above-mentioned blockchain network. .
- the needs among alliance members often change, and the alliance members corresponding to each demand are often different. Therefore, whenever alliance members change, a new blockchain network may need to be formed, resulting in a loss of resources and time. A lot of waste.
- the established blockchain network can be used as the blockchain main network, and a blockchain subnet can be established based on the blockchain main network. Then, in a consortium chain scenario such as the above, consortium members can establish the required blockchain subnet based on their own needs based on their own needs after already participating in the blockchain mainnet. Since the blockchain subnet is established on the basis of the blockchain main network, the construction process of the blockchain subnet consumes more resources and takes more time than establishing a completely independent blockchain network. are greatly reduced and the flexibility is higher.
- the process of quickly establishing a blockchain subnet based on the blockchain main network is as follows: Each blockchain node in the blockchain main network obtains the transaction to establish the blockchain subnet respectively, and the transaction includes the configuration information of the blockchain subnet. , the configuration information includes the identity information of the node members participating in the establishment of the blockchain subnet, and each blockchain node in the blockchain main network executes the transaction respectively to reveal the configuration information.
- the configuration information contains the identity information of the node member corresponding to the first blockchain node
- the node device deploying the first blockchain node starts the third node belonging to the blockchain subnet based on the genesis block containing the configuration information.
- Two blockchain nodes Two blockchain nodes.
- the main blockchain network is mainnet0
- the blockchain nodes included in this network are nodeA, nodeB, nodeC, nodeD, nodeE, etc.
- nodeA, nodeB, nodeC and nodeD want to form a blockchain subnet: If nodeA is the administrator and only allows the administrator to initiate transactions to form a blockchain subnet, then nodeA can initiate the above transaction to form a blockchain subnet to mainnet0; If nodeE is the administrator and only allows the administrator to initiate transactions to establish a blockchain subnet, then nodeA ⁇ nodeD need to request nodeE, so that nodeE initiates the above-mentioned transaction to establish a blockchain subnet to mainnet0; if nodeE is an administrator but allows If an ordinary user initiates a transaction to establish a blockchain subnet, then nodeA ⁇ nodeE can initiate the above-mentioned transaction to establish a blockchain subnet to mainnet0.
- the blockchain node that initiates the transaction to establish the blockchain subnet does not necessarily participate in the formed blockchain subnet.
- nodeA, nodeB, nodeC and nodeD eventually form the blockchain subnet network, but nodeE can initiate the above-mentioned transaction to form a blockchain subnet to mainnet0, and it is not necessarily nodeA ⁇ nodeD that initiates the transaction to form a blockchain subnet.
- the blockchain main network in this specification can be the underlying blockchain network, that is, the blockchain main network is not a blockchain subnet established on the basis of other blockchain networks, such as the one in Figure 1 mainnet0 can be considered as the blockchain mainnet belonging to the underlying blockchain network type.
- the blockchain mainnet in this specification can also be a subnet of other blockchain networks.
- subnet1 is the blockchain mainnet corresponding to subnet1.1, but this does not affect that subnet1 also belongs to the blockchain subnet created on mainnet0. It can be seen that the blockchain main network and the blockchain subnet are actually relative concepts. The same blockchain network can be the blockchain main network in some cases and the blockchain subnet in other cases.
- the configuration information can be used to configure the formed blockchain subnet so that the formed blockchain subnet meets the networking requirements. For example, by including the identity information of node members in the configuration information, you can specify which blockchain nodes are included in the formed blockchain subnet.
- the identity information of node members may include the public key of the node, or other information that can characterize the identity of the node, such as node ID. This specification does not limit this.
- each blockchain node has one or more corresponding sets of public and private key pairs.
- the blockchain node holds the private key and the public key is made public and uniquely corresponds to the private key. Therefore, it can be
- the public key represents the identity of the corresponding blockchain node. Therefore, for blockchain nodes that wish to serve as node members of the blockchain subnet, the public keys of these blockchain nodes can be added to the above-mentioned transaction for forming the blockchain subnet as the identity information of the above-mentioned node members.
- nodeA1 in subnet1 uses its own private key to sign a message, and then broadcasts the signed message in subnet1, while nodeB1, nodeC1, and nodeD1 can use the public key of nodeA1.
- Perform signature verification on the received message to confirm that the message received does come from nodeA1 and has not been tampered with.
- the configuration information can be used to indicate the node members corresponding to any main network node in the blockchain main network.
- the mainnet node does not directly participate in forming the blockchain subnet and become its node member. Instead, the node device used to deploy the mainnet node needs to generate a subnet node, and the subnet node needs to be generated by the node device. Network nodes become node members in the blockchain subnet.
- the main network node and the sub-network node correspond to the same blockchain member, for example, in the alliance chain scenario, they correspond to the same alliance chain member, but the main network node belongs to the blockchain main network, the The subnet node belongs to the blockchain subnet, allowing members of the blockchain to participate in transactions on the blockchain mainnet and blockchain subnet respectively.
- the blockchain main network and the blockchain sub-network belong to two independent blockchain networks, the blocks generated by the main network node and the blocks generated by the sub-network node are stored in the node respectively.
- Different storage on the device (the storage used can be a database, for example) realizes the mutual isolation between the storage used by the main network node and the subnet node.
- the data generated by the blockchain subnet will only be stored in the blockchain subnet. Synchronization between node members of the network prevents blockchain members who only participate in the blockchain main network from obtaining the data generated on the blockchain subnet, realizing data isolation between the blockchain main network and the blockchain subnet. It meets the needs of small-scale transactions between some blockchain members (that is, blockchain members participating in the blockchain subnet).
- main network node and the sub-network node are logically divided blockchain nodes. From the perspective of physical equipment, it is equivalent to the node equipment where the two nodes are located participating in the main network of the blockchain at the same time. network and blockchain subnet. Since the blockchain main network and the blockchain sub-network are independent of each other, the identity systems of the two blockchain networks are also independent of each other. Therefore, even if the main network node and the sub-network node can use the exact same public key, they still The two should be considered as different blockchain nodes.
- nodeA in mainnet0 is equivalent to the above-mentioned main network node, and the node device where nodeA is deployed (i.e., node device 1) generates nodeA1 belonging to subnet1, which is equivalent to the above-mentioned subnet node. It can be seen that since the identity systems are independent of each other, whether the public key used by the subnet node is different from that of the main network node does not affect the implementation of the solution in this specification.
- the node members of the blockchain subnet are not necessarily only some of the node members of the blockchain mainnet.
- the node members of the blockchain subnet can be completely consistent with the node members of the blockchain main network.
- all blockchain members can obtain the data on the blockchain main network and the blockchain subnet, but The data generated by the blockchain main network and the blockchain subnet can still be isolated from each other.
- one type of business can be implemented on the blockchain main network and another type of business can be implemented on the blockchain subnet, so that the business data generated by the two types of businesses can be isolated from each other.
- the configuration information may also include at least one of the following: the network identifier of the blockchain subnet, the identity information of the administrator of the blockchain subnet, the identity information for the blockchain platform This manual does not limit the attribute configuration of the code.
- the network identifier is used to uniquely characterize the blockchain subnet, so the network identifier of the blockchain subnet should be distinguished from the blockchain main network and other blockchain subnets formed on the blockchain main network.
- the identity information of the administrator of the blockchain subnet for example, can be the public key of the node member who is the administrator; among them, the administrators of the blockchain main network and the blockchain subnet can be the same or different.
- the blockchain platform code used by the mainnet node can be Reuse on subnet nodes eliminates the need for repeated deployment of blockchain platform code and greatly improves the efficiency of building blockchain subnets. Then, if the configuration information does not contain attribute configuration for the blockchain platform code, the above subnet nodes can reuse the attribute configuration used on the main network node; if the configuration information contains attribute configuration for the blockchain platform code , the subnet node can use this attribute configuration, so that the attribute configuration used by the subnet node is not limited to the attribute configuration of the main network node and has nothing to do with the main network node.
- the attribute configuration for the blockchain platform code can include at least one of the following: code version number, whether consensus is required, consensus algorithm type, block size, etc. This manual does not limit this.
- Transactions that build a blockchain subnet include transactions that call contracts.
- the transaction can specify the address of the called smart contract, the method called and the parameters passed in.
- the contract called can be the aforementioned creation contract or system contract
- the method called can be a method of establishing a blockchain subnet
- the parameters passed in can include the above configuration information.
- the transaction may include the following information:
- the from field is the information of the initiator of the transaction.
- Administrator indicates that the initiator is the administrator; the to field is the address of the called smart contract.
- the smart contract can be a Subnet contract, then the to field is specifically the Subnet The address of the contract; the method field is the method called.
- the method used to build a blockchain subnet in the Subnet contract can be AddSubnet(string), and string is the parameter in the AddSubnet() method.
- genesis is used to represent the The value of the parameter, the genesis is specifically the aforementioned configuration information.
- nodeA ⁇ nodeE Take the nodes nodeA ⁇ nodeE on mainnet0 as an example to execute a transaction that calls the AddSubnet() method in the Subnet contract. After the transaction passes the consensus, nodeA ⁇ nodeE execute the AddSubnet() method respectively and pass in the configuration information to obtain the corresponding execution results.
- Contract execution results can be represented as events in receipts.
- the message mechanism can realize message delivery through events in receipts to trigger blockchain nodes to perform corresponding processing.
- the structure of the event can be, for example:
- the number of events may be one or more; each event includes fields such as topic and data.
- the blockchain node can listen to the topic of the event, and then perform preset processing when listening to the predefined topic, or read the relevant content from the data field of the corresponding event, and can execute the preset based on the read content. deal with.
- the client runs the SDK (Software Development Kit, software development tool) used to implement the monitoring function. package), etc., the client monitors the events generated by the blockchain node, and the blockchain node only needs to generate receipts normally.
- transaction information can also be revealed through other methods.
- the listening code can be embedded in the blockchain platform code running on the blockchain node, so that the listening code can monitor the transaction content of the blockchain transaction, the contract status of the smart contract, the receipt generated by the contract, etc. or multiple types of data, and sends the monitored data to the predefined listening party.
- this implementation method based on listening code is relatively more proactive compared to the event mechanism.
- the above-mentioned monitoring code can be added to the blockchain platform code by the developers of the blockchain platform during the development process, or can be embedded by the monitoring party based on its own needs. This manual does not limit this.
- the execution result of the above Subnet contract may include the configuration information, and the execution result may be in the receipt mentioned above.
- the receipt may include events related to the execution of the AddSubnet() method, that is, networking events.
- the topic of the networking event can contain a predefined networking event identifier to distinguish it from other events.
- the content of the topic is the keyword subnet, and this keyword is different from the topic in the event generated by other methods.
- nodeA ⁇ nodeE can determine that they have listened to the event related to the execution of the AddSubnet() method, that is, the networking event, when they listen to the topic containing the keyword subnet.
- the events in the receipt are as follows:
- the content of the data field may include:
- nodeA's public key nodeA's IP, nodeA's port number...
- nodeB s public key, nodeB’s IP, nodeB’s port number...;
- nodeD s public key, nodeD’s IP, nodeD’s port number...;
- subnet1 is the network identifier of the blockchain subnet you want to create.
- Each blockchain node in the blockchain main network can record the network identifiers of all blockchain subnets that have been created on the blockchain main network, or other information related to these blockchain subnets. This information can, for example, be maintained in In the above-mentioned Subnet contract, it may specifically correspond to the value of one or more contract states contained in the Subnet contract.
- nodeA ⁇ nodeE can determine whether the above subnet1 already exists based on the recorded network identifiers of all created blockchain subnets; if it does not exist, it means that subnet1 is the new blockchain subnet that needs to be created currently. If it exists, it means that subnet1 already exists.
- the above data field also contains the identity information of each node member and other contents.
- the node device that deploys the main network node can monitor the generated receipt, and when the networking event is monitored and the content of the networking event indicates that the main network node belongs to the node member, the main network node is deployed by the node device.
- the node device obtains the configuration information or genesis block contained in the networking event.
- the main network node can monitor the generated receipt, and trigger the deployment of the main network node when the networking event is monitored and the content of the networking event indicates that the main network node itself belongs to the node member.
- the node device obtains the configuration information or the genesis block contained in the networking event.
- node devices can listen directly for receipts. Assume that nodeA ⁇ nodeE are deployed on node devices 1 ⁇ 5 respectively, and node devices 1 ⁇ 5 can monitor the receipts generated by nodeA ⁇ nodeE respectively. Then when it is detected that subnet1 is a newly established blockchain subnet, node device 1 ⁇ 5 can further identify the identity information of the node members contained in the data field to determine its own processing method. Taking nodeA and node device 1 as an example: If node device 1 finds that the data field contains nodeA's public key, IP address, port number and other identity information, then node device 1 obtains the configuration information from the data field based on the above message mechanism.
- node device 2 can generate nodeB1
- node device 3 can generate nodeC1
- node device 4 can generate nodeD1.
- node device 5 will find that the identity information contained in the data field does not match itself, so node device 5 will not generate a genesis block based on the configuration information in the data field, nor will it generate a blockchain node in subnet1.
- blockchain nodes in the blockchain main network can monitor receipts and trigger node devices to perform relevant processing based on the monitoring results. For example, when nodeA ⁇ nodeE determines that subnet1 is a newly established blockchain subnet, they will further identify the identity information of the node members contained in the data field to determine their own processing method. For example, nodeA ⁇ nodeD will find that the data field contains their own public key, IP address, port number and other identity information. Assume that nodeA ⁇ nodeD are deployed on node devices 1 ⁇ 4 respectively.
- nodeA will Trigger node device 1 so that node device 1 obtains configuration information from the data field based on the above message mechanism and generates a genesis block containing the configuration information, and node device 1 will deploy nodeA1 locally, and nodeA1 loads the generated genesis block. Thus becoming a subnet node in subnet1.
- nodeB will trigger node device 2 to generate nodeB1
- nodeC will trigger node device 3 to generate nodeC1
- nodeD will trigger node device 4 to generate nodeD1.
- nodeE will find that the identity information contained in the data field does not match itself. Assuming that nodeE is deployed on node device 5, then node device 5 will not generate a genesis block based on the configuration information in the data field, nor will it generate subnet1. nodes in .
- the data field may contain identity information generated in advance for nodeA1 to nodeD1, and is different from the identity information of nodeA to nodeD.
- node device 1 finds the identity information of nodeA1 in the data field, it can generate a genesis block, deploy nodeA1, and load the genesis block by nodeA1; or, if nodeA finds the identity information of nodeA1 in the data field, If the identity information of nodeA1 is found, then nodeA will trigger node device 1 to generate a genesis block, deploy nodeA1, and nodeA1 will load the genesis block.
- Other blockchain nodes or node devices are handled in a similar manner and will not be described here.
- the execution results of the contract can also include the genesis block.
- the corresponding node devices 1 to 4 can directly obtain the genesis block from the data field through the message mechanism without having to generate it themselves, which can improve the deployment efficiency of nodeA1 to nodeD1.
- the node device implements the deployment of a blockchain node on the node device by creating an instance running the blockchain platform code in a process.
- the node device creates a first instance in the above process, and the first instance runs the blockchain platform code.
- a second instance that is different from the first instance is created by the node device in the above process, and is formed by running the blockchain platform code on the second instance.
- the node device can first create the first instance in the process to form the main network node in the blockchain main network; and when the node member corresponding to the node device wants to participate in forming the blockchain subnet, the node device can create a first instance in the process.
- first instance and the second instance are located in the same process, since no cross-process interaction is involved, the difficulty of deploying the subnet node can be reduced and the deployment efficiency can be improved; of course, the second instance may also be located on a node device separately from the first instance.
- the node device can create the first instance in the first process to form the main network node in the blockchain main network; and when the node corresponding to the node device
- members wish to participate in the formation of a blockchain subnet, they can start a second process that is different from the first process, and create a second instance in the second process.
- the second instance is different from the above-mentioned first instance, and then the second instance is created in the second process.
- Two instances form subnet nodes in the blockchain subnet.
- each blockchain node deployed on any node device involved in the embodiment of this specification is a different blockchain instance running on the node device.
- the blocks generated by each blockchain node deployed on the node device can They are stored in different storages (such as databases) on the node device, and the storage used by each blockchain node deployed on any node device is isolated from each other.
- a blockchain subnet managed by the blockchain mainnet can be created on the blockchain mainnet.
- subnet1 can be created on the basis of mainnet0.
- This subnet1 contains nodeA1 ⁇ nodeD1, and any subnet node in subnet1 and its corresponding mainnet node in mainnet0 Deployed on the same node device, for example, nodeA and nodeA1 are deployed on node device 1, nodeB and nodeB1 are deployed on node device 2, nodeC and nodeC1 are deployed on node device 3, nodeD and nodeD1 are deployed on node device 4.
- subnet2 or even more blockchain subnets can be created on mainnet0, where subnet2 includes nodeA2, nodeB2 and nodeE2, and nodeA and nodeA1, nodeA2, nodeB and nodeB1, nodeB2, nodeC and nodeC1, nodeD and nodeD1, nodeE and nodeE2 are deployed on the same node device.
- subnet1, subnet2, etc. as the main blockchain network, and further create next-level blockchain subnets on this basis. For example, create the blockchain subnet subnet1.1 based on subnet1. The process It is similar to the creation of subnet1 or subnet2, except that the blockchain mainnet is replaced by the blockchain subnet subnet1, which will not be described here.
- node device 1 is deployed with the main network node nodeA and subnet nodes nodeA1 and nodeA2;
- node device 2 is deployed with the main network node nodeB and subnet nodes nodeB1 and nodeB2;
- node device 3 is deployed with the main network node Main network node nodeD and subnet node nodeD1 are deployed in nodeC, subnet node nodeC1, and node device 4; main network node nodeE and subnet node nodeE2 are deployed in node device 5.
- blockchain subnets can also be created through other means and made subject to the management of the blockchain main network.
- a blockchain subnet can be established on the blockchain main network through registration (hereinafter referred to as the registration networking method), and the existing blockchain network can be directly registered to the blockchain main network, so that the newly registered blockchain network can Under the management of the blockchain main network, the newly registered blockchain network becomes a blockchain subnet of the blockchain main network.
- the subnet information of the blockchain subnet to be established is directly registered to the blockchain main network, so that the blockchain main network obtains the relevant information of the blockchain subnet to be established (by receiving and executing the area to be established) Transactions issued by the blockchain network to associate and store identity information with the subnet identifier assigned to the blockchain network to be established), such as the subnet identifier and operating status of the blockchain subnet to be established, where The public key and plug-in configuration information of each node member, the IP address and port information of each node device, etc. This information will be written into the contract status of the system contract corresponding to the blockchain main network.
- the blockchain main network will Obtaining the management rights of the blockchain subnet to be formed and completing the registration means that the blockchain subnet is completed. Since the registration networking method does not require the designation of node members on the blockchain main network through transactions to form a blockchain subnet, the subnet nodes in the blockchain subnet established through the registration networking method can be compared with those deployed on the blockchain main network. The node equipment of each node in the network is completely different or partially different. For example, in Figure 1, mainnet0 creates a subnet3 in the registration networking mode (not shown in Figure 1).
- the subnet corresponding to subnet3 The node can be deployed on any node device except node devices 1 to 5, or one or more subnet nodes in subnet3 are deployed on any node device within node devices 1 to 5 (but it is still necessary to ensure that one node Only one subnet node in subnet4 is deployed on the device), and other subnet nodes in subnet3 are deployed on any other node device except node devices 1 to 5. Of course, all subnet nodes in subnet4 can also be deployed. Among the node devices 1 to 5, no further details will be given.
- Cross-chain interaction can be achieved between any two blockchain networks in the blockchain main network and blockchain subnet created through the above method.
- nodeC belonging to mainnet0 and nodeC1 belonging to subnet1 are deployed in node device 3.
- nodeC and nodeC1 are specifically formed by node device 3 running the blockchain platform code in a locally deployed virtual machine.
- a blockchain node instance (hereinafter referred to as a blockchain node), and the relevant data of nodeC as a blockchain node during operation is stored in the main network database corresponding to nodeC, and nodeC1 as another blockchain node during operation
- the relevant data in is stored in the subnet database corresponding to nodeC1.
- the above main network database and subnet database both belong to the storage space of node device 3.
- the blockchain consensus code can be deployed in the node device 3.
- the node device 3 can form a consensus component instance locally; and the node device can also be deployed with P2P component code managed in the form of a plug-in.
- the node device can locally form a P2P component instance, that is, a P2P plug-in.
- the P2P plug-in deployed in any node device can be shared and used by different blockchain nodes on the node device. For example, nodeC and nodeC1 in node device 3 can call the same P2P plug-in running on node device 3 to share its functions. and data.
- the node device 3 can also be deployed with a blockchain business code.
- the node device 3 can form a business instance locally, where at least one business instance can be implemented in the node device 3, such as for implementing
- the storage instances for the data read/write function, the computing instances used to implement computing functions such as privacy computing, and the encryption instances used to implement the data encryption function will not be described in detail.
- the main network node and the subnet node on the same node device share the blockchain communication plug-in running on the node device, such as the aforementioned P2P plug-in.
- the above-mentioned network connection link implemented when forming mainnet0 can be specifically established by nodeC and nodeE using P2P plug-ins on node device 3 and node device 5 respectively.
- nodeC1 in subnet1 can call the P2P plug-in running locally on node device 3, with the help of node device 3 and the node implemented when forming mainnet0
- the network connection between devices 5 is based on the P2P plug-in, and a network connection is established with the P2P plug-in running on the node device 5 to which nodeE2 belongs, thereby sending cross-chain messages to the node device 5, thereby further realizing the network connection with nodeE2 communication.
- This method eliminates the need to establish a new network connection link between the source blockchain network and the destination blockchain network. Instead, the source blockchain network can be realized through the pre-established network connection link of the underlying blockchain main network. Network communication between the source node and the destination node in the destination blockchain network.
- the blockchain subnet created through the above method can be managed by the blockchain mainnet.
- this specification proposes a blockchain node migration method, which is executed by the mainnet node. Transactions control the migration of subnet nodes. This solution will be described in detail below with reference to the accompanying drawings.
- FIG 2 is a flow chart of a blockchain node migration method proposed in the embodiment of this specification. As can be seen from Figure 2, the method includes steps 202-208.
- Step 202 The main network node deployed in the first node device discloses the genesis block information of the blockchain subnet to the first node device by executing a node migration transaction, so that the first node device sends the genesis block information to The second node device, the blockchain main network to which the main network node belongs is used to manage the blockchain subnet.
- this solution is used to migrate the first subnet node in the blockchain subnet to the second subnet node.
- the second subnet node is started in the second node device, and is completed by starting The subnet node loads the historical data of the first subnet node.
- any main network node and the blockchain sub-network in the blockchain main network are not deployed in the second node device used to deploy the second sub-network node.
- Any subnet node in the network For example, no blockchain node may be deployed in the second subnet node, or a blockchain node that has no association with the blockchain main network and blockchain subnet described in this solution may be deployed. There is no restriction on this.
- the first node device is deployed with any main network node in the blockchain main network, and the first subnet node to be migrated can be deployed on the first node device, or can also be deployed on any node other than the first node device and in other node devices other than the second node device.
- the first node device can be node device 1.
- the node device is deployed with the main network node nodeA and the first subnet node. network node nodeA2; or, the first node device can also be node device 3.
- the main network node nodeC is deployed in this node device, but the subnet node in subnst2 is not deployed.
- the above-mentioned node migration transaction can be initiated by various blockchain participants.
- the transaction may be initiated by the administrator of the blockchain main network or blockchain subnet.
- the administrator of the blockchain subnet usually knows the various subnet nodes included in the blockchain subnet; and since the blockchain subnet is managed by the blockchain main network, the administrator of the blockchain main network It is also possible to know the various subnet nodes included in the blockchain subnet. Therefore, based on the above information, the administrators of the blockchain main network and the blockchain subnet can initiate the node migration transaction through any main network node in the blockchain main network to realize the migration of the first subnet node. manage.
- the corresponding node member of any subnet node in the blockchain subnet in the blockchain main network can initiate the node migration transaction through the corresponding main network node.
- node members corresponding to any mainnet node in the blockchain mainnet can initiate the node migration transaction through the corresponding mainnet node.
- the node members corresponding to nodeA2 can initiate a node migration transaction for nodeA2 to mainnet0 through nodeA, and the node members corresponding to nodeB2 and nodeE2 can also initiate a node migration transaction separately.
- the transaction is initiated through nodeB and nodeE; alternatively, the node member corresponding to nodeA can initiate a node migration transaction for nodeA2 to mainnet0 through nodeA, and the node members corresponding to nodeB ⁇ E can also initiate the transaction through nodeB ⁇ E respectively, which will not be described again. In this way, administrators or relevant node members with transaction initiation authority can initiate the node migration transaction, thereby meeting various forms of migration control requirements.
- each mainnet node in the blockchain mainnet can obtain and execute the transaction respectively.
- the transaction may include the execution time of the transaction, such as triggering execution after the first moment, completing execution within the time period between the second moment and the third moment, triggering execution or ending before the fourth moment. Execution (otherwise execution is terminated), etc.
- the main network node deployed in the first node device can execute the node migration transaction at the corresponding time node in order to achieve precise control of the node migration process. It can be understood that when there are multiple subnet nodes in the blockchain subnet that need to be migrated, the above execution time can be the transaction execution time for each subnet node, thereby achieving control over the migration time of each subnet node. It helps to realize the gradual migration of each subnet node to try to ensure the availability of the blockchain subnet during the migration process.
- the genesis block information of the blockchain subnet can be recorded in the system contract of the blockchain mainnet. Based on this, the main network node can call the system contract to obtain the genesis block information during the execution of the node migration transaction, and transmit the obtained genesis block information to the first node device.
- the main network node can contact the first node device to reveal the genesis block information of the blockchain subnet through an event mechanism.
- the main network node can execute a node migration transaction to generate a node migration event containing the genesis block information, and the event is allowed to be monitored by the first node device. Therefore, the first node device can monitor the node migration event and extract the genesis block information from the monitored event.
- the asynchronous transmission of genesis block information can be achieved between the main network node and the first node device, which helps to improve the overall processing efficiency of the first node device for blockchain transactions.
- the node migration event may be recorded in a receipt generated by executing the node migration transaction, and the receipt may also record the network address of the second node device.
- the first node device can obtain the network address of the second node device from the receipt, and send the genesis block information extracted from the node migration event to the second node device according to the network address.
- the network address can be obtained by the initiator of the node migration transaction in an off-chain manner and recorded in the transaction, so that the first node device can establish a connection with the second node device through the network address. network connection, and then send the genesis block information to it based on the network connection.
- the initiator of the node migration transaction can also execute the network address of the second node device to the first node device in other ways, and the embodiments of this specification are not limited to this.
- the genesis block information of the blockchain subnet may include the network identifier of the subnet, the identity information of the administrator of the subnet, and the various creators of the subnet (such as those who participated in the creation of the subnet).
- the attribute configuration of the above-mentioned platform code may include information such as code version number, whether consensus is required, consensus algorithm type and/or block size, etc., which will not be described again.
- Step 202 The second node device generates a genesis block according to the genesis block information, and starts the second subnet node by loading the genesis block.
- the second node device may generate a genesis block based on the information. It can be understood that because the genesis block information is the genesis block information of the blockchain subnet, the generated genesis block is the genesis block of the blockchain subnet, and then the blockchain started by the genesis block is loaded.
- the node also belongs to the blockchain subnet, that is, the second subnet node is a blockchain node belonging to the blockchain subnet.
- the genesis block generated by the first node device i.e., the genesis block used to start the second subnet node
- the genesis blocks maintained by other subnet nodes in the blockchain subnet i.e., the genesis block used to start the second subnet node
- the genesis block of each subnet node that joins the blockchain subnet is the same.
- the specific process of the second node device generating the genesis block according to the genesis block information can be found in the records in related technologies, and will not be described again here.
- the second node device can load the second subnet node by creating an instance.
- the second node device can locally pull up a process and create an instance in the process, so that the instance starts the second subnet node by loading the genesis block.
- the second node device can specify a corresponding subnet database for the instance, so as to load the creation block into the subnet database from the actual record.
- the second node device can specify the subnet database by setting a path or directory.
- the storage space corresponding to the subnet database can be local to the second node device. Of course, it can also be located in other locations that the second node device is allowed to access. equipment, no further details will be given.
- the node device 6 may be a new device that is different from the node devices 1 to 5, or may also be the node device 3 or the node device 4. Take node device 6 and node device 3 as the same node device as an example. At this time, the main network node nodeC in mainnet0 is deployed in the node device. However, because the subnet node corresponding to nodeC does not exist in subnet2, you can still follow this procedure. The solution described in the manual deploys the subnet node nodeF2 belonging to subnet2 in the node device.
- Step 206 The second subnet node joins the blockchain subnet and loads the historical data of the first subnet node in the blockchain subnet.
- the second subnet node is still an isolated blockchain node. It needs to join the blockchain subnet to become a member of the blockchain subnet and to achieve communication with other subnet nodes. interactions between.
- the genesis block information may include identity information and network addresses of other subnet nodes in the blockchain subnet.
- the identity information and network addresses may be sent offline by the initiator of the node migration transaction. The method is collected and recorded in the transaction. Of course, it can also be maintained in the system contract of the blockchain main network.
- the embodiments of this specification are not limited to this.
- the second subnet node can establish network connections with other subnet nodes based on the identity information and network address. Wherein, the second subnet node and any other node device can realize network connection through P2P components.
- the second node device and any other node device can be respectively deployed with corresponding P2P components, and the second subnet node The node can call the P2P component in the second node device to establish a network connection with the P2P component in any other node device.
- network communication can be achieved between the second subnet node and other subnet nodes.
- the second subnet node participates in the blockchain subnet. , becoming a subnet node in this subnet.
- the second subnet node can obtain node information of each subnet node in the blockchain subnet from other subnet nodes, so as to locally create and maintain a node list for each subnet node in the blockchain subnet.
- the genesis block information corresponds to the initial node members participating in the creation of the blockchain subnet, so the above identity information and network address may only be the identity information and network address of the initial node members, so the second subnet The network node can only establish network connections with the initial node members based on this information.
- the node list includes later joining node members in addition to the initial node members, the second subnet node may also establish a network connection with the aforementioned later joining node members. It can be understood that compared to the initial node members in the blockchain subnet, the second subnet node is also a later-joined node member, which will not be described again.
- nodeF2 started by node device 6 will be the same as the original node after joining the blockchain subnet.
- Some nodes nodeA2, nodeB2 and nodeD2 constitute subnet2.
- the second subnet node After startup, the second subnet node also needs to load the historical data of the first subnet node in order to participate in the operation of the blockchain subnet based on this part of historical data after migration.
- the historical data is the blockchain data generated by the first subnet node in the process of participating in the operation of the blockchain subnet (such as transaction consensus, transaction execution, smart contract deployment and execution, etc.), and may include historical blocks, for example. , historical transactions, transaction receipts, status data, etc., the embodiments of this specification do not limit this.
- the second node device can designate a corresponding subnet database for the second subnet node. Based on this, the second subnet node can load historical data of the first subnet node into the subnet database. It can be understood that the above subnet database corresponds to the second subnet node, so the second node device has access rights to the database, such as reading data from the database or writing data to the data. Moreover, the subnet database can be isolated from other databases in the second node device to prevent the blockchain data of the second subnet node from being obtained by other relevant parties, so as to achieve permission management for this part of the blockchain data. .
- the database of the blockchain node can be isolated from the subnet database of the second subnet node to prevent the blockchain node from interacting with the second subnet node.
- Network nodes access each other's blockchain data respectively, which helps ensure the privacy of each node's blockchain data.
- the way in which the second subnet node loads the data is correspondingly different.
- the second subnet node can synchronize the historical data from the first subnet node in the blockchain subnet.
- the second subnet node can also synchronize the history from other subnet nodes in the blockchain subnet. data.
- the second subnet node can also synchronize the data from multiple subnet nodes at the same time.
- the second subnet node can obtain the first historical data from the first historical data.
- the first historical data is synchronized at a subnet node
- the second historical data is synchronized from at least one other subnet node at the same time, so as to obtain all historical data as soon as possible and reduce the time-consuming process of historical data migration.
- the second node device can also obtain the historical data through off-chain methods for After startup the second subnet node is loaded.
- the manager of the second node device can load the storage device storing the historical data to the second node device, and then the second subnet node can load the historical data from the storage device.
- the historical data can be loaded into the second node device.
- the storage directory in the storage device is added to the accessible directory of the aforementioned subnet database, that is, the storage space where the historical data is located is regarded as part of the storage space of the subnet database.
- the second subnet node can pass the Storage directory to access the historical data. It can be understood that the process of the second subnet node accessing the historical data through the storage directory is the process of accessing the subnet database. Alternatively, the second subnet node can also copy the historical data recorded in the above storage device to the storage space corresponding to the subnet database, and then the copied historical data can be accessed in the storage space.
- the above-mentioned storage device may include hardware devices such as disks, solid-state drives, and USB disks unloaded from the first node device.
- the hardware device may also be Uninstalling from other node devices (such as node devices closer to the second node device) on which subnet nodes of the blockchain subnet are deployed is not limited in the embodiments of this specification.
- the manager of the second node device can quickly migrate the historical data to be migrated to the second node device through hardware unloading and loading for loading by the second subnet node.
- This method can effectively improve the migration efficiency of historical data in scenarios such as the bandwidth of the second node device is limited, the amount of historical data is too large, and the distance between the first node device and the second node device is close.
- the subnet nodes in the blockchain subnet that are in a normal operating state may generate data that is different from the historical data.
- the latest data of the data so in order to ensure that the second subnet node can successfully participate in the operation of the blockchain subnet, the second subnet node can also obtain the latest data from the blockchain subnet after joining the blockchain subnet.
- the latest data that is different from the historical data is synchronized at other subnet nodes, and the synchronized latest data is loaded.
- the latest data can be synchronized and loaded after the loading of the historical data is completed to ensure that the second subnet node locally loads the blockchain. The dependencies between data remain unchanged, thereby ensuring that the blockchain subnet operates normally.
- Step 208 When the second subnet node completes loading the historical data, the first subnet node exits the blockchain subnet.
- the second subnet node After the second subnet node completes loading the historical data, it can normally participate in the operation of the blockchain subnet by accessing the historical data, such as participating in transaction consensus, transaction execution, smart contract deployment and execution, etc. At this time, in order to realize the migration of the first subnet node, the first subnet node also needs to exit the blockchain subnet. After the first subnet node exits the blockchain subnet, the second subnet node is It can functionally replace the first subnet node to participate in the operation of the blockchain subnet.
- the mainnet node reveals the genesis block information of the blockchain subnet to the first node device where it is located by executing a node migration transaction. And the first node device sends the information to the second node device. The second node device generates and loads the genesis block based on this information to start the second subnet node, and the subnet node loads the historical data of the first subnet node after joining the blockchain subnet. The first subnet node exits the blockchain subnet when the loading of the second subnet node is completed.
- the newly activated second subnet node in the blockchain subnet loads the historical data of the first subnet node, and the first subnet node exits the blockchain subnet after the above loading is completed.
- the first subnet node and the second subnet node are the subnet nodes before migration and after migration respectively; moreover, the historical data of the first subnet node is loaded after the second subnet node is started, which is helpful for the migration of the third subnet node after migration.
- the second subnet node participates in the blockchain subnet normally.
- the blockchain main network triggers the migration of subnet nodes by executing blockchain transactions, realizing the effective control of the node migration process of the blockchain subnet by the blockchain main network. It can be seen that this solution achieves effective and controllable migration of subnet nodes in the scenario where the blockchain mainnet manages the blockchain subnet.
- the first subnet node can exit the blockchain subnet in various ways.
- the node migration event generated by the main network node executing the node migration transaction can also be used to indicate the subnet node to be exited, that is, to indicate the node in the blockchain subnet.
- Which subnet node is the first subnet node to be migrated For example, the identity information of the first subnet node can be recorded in this event, so that when the first subnet node listens to the node migration event and determines that its own identity information is recorded, it can wait for the newly started second subnet node.
- the network node completes loading of the historical data and exits the blockchain subnet when it is determined that the loading is completed.
- the second subnet node may send a notification message to the first subnet node after it completes loading of historical data to notify itself of the completion of loading of historical data.
- the second subnet node can broadcast the notification message in the blockchain subnet, so that each subnet node can judge whether it should respond to the notification message; or, to reduce notifications
- the message occupies the online communication resources of the blockchain subnet, and the second subnet node can also send the notification message to the second subnet node in a targeted manner.
- the embodiments of this specification do not limit this. Through this method, you only need to initiate a node migration transaction in the main blockchain network to start the second subnet node and exit the first subnet node in sequence, thereby simplifying the node migration process and improving migration efficiency.
- the initiator of the node migration transaction when the initiator of the node migration transaction determines that the second subnet node has completed loading the historical data, it can initiate a node exit transaction for the first subnet node in the blockchain subnet; or, it can also be done by The second subnet node initiates the transaction when it determines that it has completed loading the historical data. Furthermore, each subnet node in the blockchain subnet can obtain and execute the node exit transaction respectively, so that the first subnet node exits the blockchain subnet. Through this method, the initiator of the transaction can control when to initiate the node to exit the transaction, so as to control the first subnet node to exit the blockchain subnet at the appropriate time node to avoid affecting the normal operation of the subnet.
- the first subnet node can disconnect the communication connection with other subnet nodes in the blockchain subnet. After the communication connection is disconnected, the first subnet node can communicate with other subnet nodes in the blockchain subnet. Each subnet node will no longer be able to communicate on the chain, and the node will no longer participate in the operation of the subnet.
- the first subnet node can also delete the communication addresses of other subnet nodes from the communication list of the blockchain network maintained by itself.
- other subnet nodes can delete the communication addresses between themselves and the first subnet node.
- the communication address of the first subnet node is deleted from the communication list of the blockchain network maintained by itself. It can be understood that the function of the communication list of the blockchain subnet is to enable the subnet nodes to communicate with other nodes based on the communication addresses of other nodes that belong to the same subnet recorded in the communication list to achieve transaction forwarding, Consensus etc.
- each subnet node in the blockchain subnet deletes the communication address of the first subnet node from the communication list, the first subnet node will no longer be able to communicate with other nodes in the same subnet, and the first subnet node will also be deleted.
- the subnet nodes are functionally excluded from the subnet.
- each mainnet node in the blockchain mainnet has established a management relationship with each subnet node in the blockchain subnet. Therefore, the Each main network node in the blockchain main network may release the management relationship with the first subnetwork node in response to the completion of the first subnetwork node exiting the blockchain subnetwork.
- establishing a management relationship for a certain node can be understood as registering the permission of the node to participate in the corresponding subnet; and canceling the management relationship for the node can be understood as registering the permission of the node to participate in the corresponding subnet. Permissions are revoked.
- each main network node in the blockchain main network can access the management relationship for the first sub-network node by executing transactions.
- the initiator of the transaction may be the first subnet node itself, or it may be the member client corresponding to the blockchain system (i.e., the client used by the member corresponding to the first subnet node).
- the embodiments of this specification do not Make restrictions.
- the above-mentioned blockchain node migration solution in the embodiment of the present disclosure is only described for one subnet node (ie, the first subnet node) in the blockchain subnet. In fact, there may be multiple subnet nodes to be migrated in the blockchain subnet. For any of the subnet nodes, the aforementioned solution can be used to migrate the subnet node to a new subnet in the blockchain subnet. network node. Moreover, the above-mentioned node migration transaction can also indicate the startup time information of each second subnet node and the rollout time information of the first subnet node. For example, the time when each second subnet node joins the blockchain subnet can be specified in chronological order.
- each first subnet node can be realized sequentially in the form of a workflow, and multiple first subnet nodes can be migrated Automated management and control of the migration process.
- first subnet node does not exit the blockchain subnet until the second subnet node completes loading the historical data (that is, the second subnet node can participate in the operation of the blockchain subnet), so even if The existence of multiple subnet nodes exiting at the same time or within a short period of time can also ensure that there are a sufficient number of subnet nodes participating in the operation of the blockchain subnet, thus helping to realize the progressive migration of each subnet node.
- subnet2 contains three subnet nodes, namely nodeA2, nodeB2 and nodeD2. This is the initial state of the blockchain subnet before nodeA2 migrates.
- subnet2 contains 4 subnet nodes, namely nodeA2, nodeB2, nodeD2 and nodeF2. At this time, each subnet node can participate in the operation of the blockchain subnet.
- subnet2 contains 3 subnet nodes, namely nodeB2, nodeD2 and nodeF2. This is the completion status of nodeA2 after migration. It can be seen that through the above-mentioned blockchain node migration process, nodeA2 in the blockchain subnet is replaced by nodeF2, that is, the migration of nodeA2 is realized, and the migrated nodeF2 can participate in the block based on the historical data of nodeA2 loaded by itself. Operation of the chain subnet.
- Figure 4 is a schematic structural diagram of a device provided by an exemplary embodiment.
- the device includes a processor 402, an internal bus 404, a network interface 406, a memory 408 and a non-volatile memory 410.
- the processor 402 reads the corresponding computer program from the non-volatile memory 410 into the memory 408 and then runs it.
- the execution subject of the following processing flow is not limited to each A logic unit can also be a hardware or logic device.
- FIG. 5 is a block diagram of a blockchain node migration device provided in this specification according to an exemplary embodiment.
- the device includes: an information disclosure unit 501, used for the main network node deployed in the first node device to disclose the genesis block information of the blockchain subnet to the first node device by executing a node migration transaction, so that the first node device can Send the genesis block information to the second node device, and the blockchain main network to which the main network node belongs is used to manage the blockchain subnet;
- the node startup unit 502 is used by the second node device according to the The creation block information generates a creation block, and starts the second subnet node by loading the creation block;
- the node joining unit 503 is used for the second subnet node to join the blockchain subnet and load the block Historical data of the first subnet node in the chain subnet; node exit unit 504, configured to exit the first subnet node from the blockchain subnet when
- the information disclosure unit 501 is also configured to: the main network node executes a node migration transaction to generate a node migration event containing the genesis block information of the blockchain subnet, and the node migration event is allowed to be used by the first node device Monitored.
- the node migration event is recorded in the receipt of the node migration transaction
- the information disclosure unit 501 is also configured to: the first node device obtains the network address of the second node device from the receipt, And send the genesis block information to the second node device according to the network address.
- the genesis block information is recorded in the system contract of the blockchain main network, and the information disclosure unit 501 is also used to call the main network node during the process of executing node migration transactions.
- the system contract obtains the genesis block information and transmits the obtained genesis block information to the first node device.
- the genesis block information includes the identity information and network addresses of other subnet nodes in the blockchain subnet
- the node joining unit 503 is also configured to: the second subnet node adds the identity information and network address to the second subnet node according to the identity information and network address.
- the network address establishes a network connection with the other subnet node.
- a database designation unit 505 is also included, for the second node device to designate a subnet database for the second subnet node; the above-mentioned node joining unit 503 is also used for: the second subnet node loads the historical data into the in the subnet database.
- it also includes: an off-chain acquisition unit 506, used by the second node device to acquire the historical data in an off-chain manner; and/or an on-chain acquisition unit 507, used by the second subnet node after joining the After the blockchain subnet is completed, the historical data is synchronized from other subnet nodes in the blockchain subnet.
- an off-chain acquisition unit 506 used by the second node device to acquire the historical data in an off-chain manner
- an on-chain acquisition unit 507 used by the second subnet node after joining the After the blockchain subnet is completed, the historical data is synchronized from other subnet nodes in the blockchain subnet.
- the latest data synchronization unit 508 which is used for the second subnet node to synchronize the data from other subnet nodes in the blockchain subnet that is different from that of the second subnet node after joining the blockchain subnet.
- the latest data of historical data and load the latest data synchronized to.
- the node exit unit 504 is also configured to: the first subnet node exits the blockchain subnet in response to the identity information of the first subnet node recorded in the node migration event.
- the node migration event is determined by the node migration event.
- the main network node executes the node migration transaction to generate the transaction; or, each subnet node in the blockchain subnet executes a node exit transaction respectively, so that the first subnet node exits the blockchain subnet.
- the node exit unit 504 is also configured to: disconnect the first subnet node from the communication connection with other subnet nodes in the blockchain subnet.
- it also includes: a first deletion unit 509, configured for the first subnet node to delete the communication addresses of the other subnet nodes from the communication list of the blockchain subnet maintained by itself; and/or, The second deletion unit 510 is used to delete the first subnet node from the communication list of the blockchain subnet maintained by the other subnet node when the network connection between itself and the first subnet node has been disconnected.
- the communication address of the subnet node is used for the first subnet node to delete the communication addresses of the other subnet nodes from the communication list of the blockchain subnet maintained by itself.
- a relationship release unit 511 configured to respond to the completion of the first subnet node exiting the blockchain subnet, and release each mainnet node in the blockchain mainnet from the first subnet node. management relationship.
- the first subnet node is deployed in the first node device.
- the node migration transaction is initiated by one of the following: the administrator of the blockchain main network, the administrator of the blockchain subnet, or any main network node in the blockchain main network.
- the corresponding node member, the corresponding node member of any subnet node in the blockchain subnet in the blockchain main network is initiated by one of the following: the administrator of the blockchain main network, the administrator of the blockchain subnet, or any main network node in the blockchain main network.
- a typical implementation device is a computer, which may be in the form of a personal computer, a laptop, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver, or a game controller. desktop, tablet, wearable device, or a combination of any of these devices.
- a computer includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
- Memory may include non-permanent storage in computer-readable media, random access memory (RAM) and/or non-volatile memory in the form of read-only memory (ROM) or flash memory (flash RAM).
- RAM random access memory
- ROM read-only memory
- flash RAM flash memory
- Computer-readable media includes both persistent and non-volatile, removable and non-removable media that can be implemented by any method or technology for storage of information.
- Information may be computer-readable instructions, data structures, modules of programs, or other data.
- Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), and read-only memory. (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, Magnetic tape cartridges, magnetic disk storage, quantum memory, graphene-based storage media or other magnetic storage devices, or any other non-transmission medium, can be used to store information that can be accessed by computing devices. As defined in this article, computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
- PRAM phase change memory
- SRAM static random access memory
- DRAM dynamic random access memory
- RAM random access memory
- ROM read-only memory
- EEPROM electrically erasable programmable read-only memory
- flash memory or other memory technology
- CD-ROM compact disc read-only memory
- first, second, third, etc. may use the terms first, second, third, etc. to describe various information, the information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other.
- first information may also be called second information, and similarly, the second information may also be called first information.
- word “if” as used herein may be interpreted as "when” or “when” or “in response to determining.”
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Business, Economics & Management (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Accounting & Taxation (AREA)
- Finance (AREA)
- Development Economics (AREA)
- Economics (AREA)
- Marketing (AREA)
- Strategic Management (AREA)
- Technology Law (AREA)
- General Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Computer And Data Communications (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
一种区块链节点的迁移方法和装置。该方法包括:第一节点设备中部署的主网节点通过执行节点迁移交易向第一节点设备透出区块链子网的创世块信息,以由第一节点设备将所述创世块信息发送至第二节点设备,所述主网节点所属的区块链主网用于管理所述区块链子网;第二节点设备根据所述创世块信息生成创世块,并通过加载所述创世块启动第二子网节点;第二子网节点加入所述区块链子网,并加载所述区块链子网中第一子网节点的历史数据;在第二子网节点加载所述历史数据完成的情况下,第一子网节点退出所述区块链子网。
Description
本说明书实施例属于区块链技术领域,尤其涉及一种区块链节点的迁移方法及装置。
区块链(Blockchain)技术构建在传输网络(例如点对点网络)之上,是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链网络中的节点按照时间顺序将数据区块以顺序相连的方式组合成链式数据结构,并以密码学方式保证的不可篡改和不可伪造的分布式账本。
区块链网络中的部分区块链节点可以参与构建区块链子网,以用于满足这部分区块链节点之间的小范围交互需求。在这类区块链子网的运行过程中,某些子网节点可能存在迁移需求,即区块链节点需要更换所处的节点设备。对此,如何实现子网节点的可控迁移,是亟待解决的问题。
发明内容
有鉴于此,本说明书一个或多个实施例提供一种区块链节点的迁移方法和装置。
为实现上述目的,本说明书一个或多个实施例提供技术方案如下:
根据本说明书一个或多个实施例的第一方面,提出了一种区块链节点的迁移方法,包括:第一节点设备中部署的主网节点通过执行节点迁移交易向第一节点设备透出区块链子网的创世块信息,以由第一节点设备将所述创世块信息发送至第二节点设备,所述主网节点所属的区块链主网用于管理所述区块链子网;第二节点设备根据所述创世块信息生成创世块,并通过加载所述创世块启动第二子网节点;第二子网节点加入所述区块链子网,并加载所述区块链子网中第一子网节点的历史数据;在第二子网节点加载所述历史数据完成的情况下,第一子网节点退出所述区块链子网。
根据本说明书一个或多个实施例的第二方面,提出了一种区块链节点的迁移装置,包括:信息透出单元,用于第一节点设备中部署的主网节点通过执行节点迁移交易向第一节点设备透出区块链子网的创世块信息,以由第一节点设备将所述创世块信息发送至第二节点设备,所述主网节点所属的区块链主网用于管理所述区块链子网;节点启动单元,用于第二节点设备根据所述创世块信息生成创世块,并通过加载所述创世块启动第二子网节点;节点加入单元,用于第二子网节点加入所述区块链子网,并加载所述区块链子网中第一子网节点的历史数据;节点退出单元,用于在第二子网节点加载所述历史数据完成的情况下,第一子网节点退出所述区块链子网。
根据本说明书一个或多个实施例的第三方面,提出了一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器。其中,所述处理器通过运行所述可执行指令以实现如第一方面中任一项所述的方法。
根据本说明书一个或多个实施例的第四方面,提出了一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如第一方面中任一项所述方法的步骤。
在上述实施例中,在区块链主网管理区块链子网的场景下,主网节点通过执行节点迁移交易向自身所处的第一节点设备透出区块链子网的创世块信息,并由第一节点设备将该信息发送至第二节点设备。第二节点设备根据该信息生成并加载创世块以启动第二子网节点,由该子网节点在加入区块链子网之后加载第一子网节点的历史数据。而第一 子网节点在第二子网节点加载完成的情况下即退出区块链子网。
由区块链子网中新启动的第二子网节点加载第一子网节点的历史数据,且第一子网节点在上述加载完成后退出区块链子网,可见所述区块链子网中的第一子网节点和第二子网节点分别为迁移前和迁移后的子网节点;而且,由第二子网节点启动后加载第一子网节点的历史数据,有助于迁移后的第二子网节点正常参与该区块链子网。而且,本方案由区块链主网通过执行区块链交易的方式触发子网节点迁移,实现了区块链主网对区块链子网的节点迁移过程的有效控制。可见,本方案实现了在区块链主网管理区块链子网的场景下对子网节点的有效和可控迁移。
为了更清楚地说明本说明书实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本说明书中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是一示例性实施例提供的一种区块链网络的示意图。
图2是一示例性实施例提供的一种区块链节点的迁移方法的流程图。
图3是一示例性实施例提供的一种区块链节点的迁移过程的示意图。
图4是一示例性实施例提供的一种设备的结构示意图。
图5是一示例性实施例提供的一种区块链节点的迁移装置的框图。
为了使本技术领域的人员更好地理解本说明书中的技术方案,下面将结合本说明书实施例中的附图,对本说明书实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本说明书一部分实施例,而不是全部的实施例。基于本说明书中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都应当属于本说明书保护的范围。
人员或机构等可以作为节点成员参与到区块链网络中,如可以参与组建区块链网络或者加入已经组建完成的区块链网络。其中,任一人员或机构可以仅参与一个区块链网络,或者也可以参与到多个区块链网络。
由于区块链网络的去中心化特性,区块链网络中的所有区块链节点通常会维护相同的区块数据,难以满足部分节点的特殊需求。以联盟链为例,所有联盟成员(即联盟内的节点成员)可以组成一区块链网络,所有联盟成员在该区块链网络中分别存在对应的区块链节点,并可以通过对应的区块链节点获得该区块链网络上发生的所有交易和相关数据。但在一些情况下,可能存在部分联盟成员希望完成一些具有保密需求的交易,这些联盟成员既希望这些交易能够在区块链上存证或借助于区块链技术的其他优势,又能够避免其他联盟成员查看到这些交易和相关数据。虽然这些联盟成员可以额外组建一新的区块链网络,其建立方式与上述包含所有联盟成员的区块链网络类似,但是从头开始建立一条新的区块链网络需要消耗大量的资源,且无论是该区块链网络的建立过程或是建成后的配置过程都非常耗时。联盟成员之间的需求往往是临时的或者具有一定的时效性,使得新建的区块链网络很快就会由于需求消失而失去存在的意义,从而进一步增加了上述区块链网络的建链成本。而联盟成员之间的需求经常会变化,而每一需求所对应的联盟成员也往往不同,因而每当联盟成员发生变化时就可能需要组建一新的区块链网 络,从而造成资源和时间的大量浪费。
为此,可以将已组建的区块链网络作为区块链主网,并在该区块链主网的基础上组建区块链子网。那么,在诸如上述的联盟链场景下,联盟成员可以在已经参与区块链主网的情况下,基于自身需求而在区块链主网的基础上组建所需的区块链子网。由于区块链子网是在区块链主网的基础上所建立,使得区块链子网的组建过程相比于完全独立地组建一条区块链网络,所消耗的资源和所需的耗时等都极大地降低,灵活性较高。
基于区块链主网快捷组建区块链子网的过程如下:区块链主网中的各区块链节点分别获取组建区块链子网的交易,所述交易包含所述区块链子网的配置信息,所述配置信息包括参与组建所述区块链子网的节点成员的身份信息,所述区块链主网中的各区块链节点分别执行所述交易以透出所述配置信息,当所述配置信息包含第一区块链节点对应的节点成员的身份信息时,部署第一区块链节点的节点设备基于所述包含所述配置信息的创世块启动属于所述区块链子网的第二区块链节点。
以图1为例,区块链主网为mainnet0,该网络包含的区块链节点为nodeA、nodeB、nodeC、nodeD和nodeE等。假定nodeA、nodeB、nodeC和nodeD希望组建一区块链子网:如果nodeA为管理员且仅允许管理员发起组建区块链子网的交易,那么可由nodeA向mainnet0发起上述组建区块链子网的交易;如果nodeE为管理员且仅允许管理员发起组建区块链子网的交易,那么nodeA~nodeD需要向nodeE进行请求,使得nodeE向mainnet0发起上述组建区块链子网的交易;如果nodeE为管理员但允许普通用户发起组建区块链子网的交易,那么nodeA~nodeE均可以向mainnet0发起上述组建区块链子网的交易。当然,不论是管理员或者普通用户,发起组建区块链子网的交易的区块链节点并不一定参与所组建的区块链子网,比如虽然最终由nodeA、nodeB、nodeC和nodeD组建区块链子网,但可由nodeE向mainnet0发起上述组建区块链子网的交易,而并不一定由nodeA~nodeD来发起该组建区块链子网的交易。
容易理解的是,在区块链主网的基础上组建区块链子网时,会使得该区块链子网与区块链主网之间存在逻辑上的层次关系。比如在图1所示的mainnet0上组建区块链子网subnet1时,可以认为mainnet0处于第一层、subnet1处于第二层。一种情况下,本说明书中的区块链主网可以为底层区块链网络,即区块链主网并非在其他区块链网络的基础上组建的区块链子网,比如图1中的mainnet0可以认为属于底层区块链网络类型的区块链主网。另一种情况下,本说明书中的区块链主网也可以为其他区块链网络的子网,比如可以在图1中subnet1的基础上进一步组建另一区块链子网subnet1.1,此时可以认为subnet1为subnet1.1对应的区块链主网,而这并不影响该subnet1同时属于mainnet0上创建的区块链子网。可见,区块链主网与区块链子网实际上是相对概念,同一区块链网络在一些情况下可以为区块链主网、另一些情况下可以为区块链子网。
上述组建区块链子网的交易在被发送至区块链主网后,由区块链主网内的共识节点进行共识,并在通过共识后由各主网节点执行该交易,以完成区块链子网的组建。共识过程取决于所采用的共识机制,本说明书并不对此进行限制。
通过在上述组建区块链子网的交易中包含配置信息,该配置信息可以用于对所组建的区块链子网进行配置,使得组建的区块链子网符合组网需求。例如,通过在配置信息中包含节点成员的身份信息,可以指定组建的区块链子网包含哪些区块链节点。
节点成员的身份信息可以包括节点的公钥,或者采用节点ID等其他能够表征节点身份的信息,本说明书并不对此进行限制。以公钥为例,每个区块链节点都存在对应的一组或多组公私钥对,由区块链节点持有私钥而公钥被公开且唯一对应于该私钥,因而可以通过公钥来表征相应区块链节点的身份。因此,对于希望作为区块链子网的节点成员的区块链节点,可以将这些区块链节点的公钥添加至上述组建区块链子网的交易中, 以作为上述节点成员的身份信息。上述的公私钥对可以用于签名验证的过程。例如,在采用有签名的共识算法中,譬如subnet1中的nodeA1采用自身维护的私钥对消息进行签名后,将经过签名的消息在subnet1中广播,而nodeB1、nodeC1和nodeD1可以用nodeA1的公钥对收到的消息进行签名验证,以确认自身收到的消息确实来自nodeA1且没有经过篡改。
所述配置信息可以用于指示区块链主网中的任一主网节点所对应的节点成员。在组建区块链子网时,并非由该主网节点直接参与组建区块链子网、成为其节点成员,而是需要由用于部署该主网节点的节点设备生成子网节点,并由该子网节点成为区块链子网中的节点成员。可见,所述主网节点和所述子网节点对应于同一个区块链成员,比如在联盟链场景下对应于同一联盟链成员,但所述主网节点属于区块链主网、所述子网节点属于区块链子网,使得该区块链成员可以分别参与到区块链主网和区块链子网的交易中。并且,由于区块链主网和区块链子网属于相互独立的两个区块链网络,使得所述主网节点生成的区块与所述子网节点生成的区块分别存入所述节点设备上的不同存储(采用的存储譬如可以为数据库),实现了该主网节点与子网节点分别使用的存储之间的相互隔离,因而区块链子网所产生的数据仅会在区块链子网的节点成员之间同步,使得仅参与了区块链主网的区块链成员无法获得区块链子网上产生的数据,实现了区块链主网与区块链子网之间的数据隔离,满足了部分区块链成员(即参与区块链子网的区块链成员)之间的小范围交易需求。
另外,所述主网节点和所述子网节点是在逻辑上划分出来的区块链节点,而从物理设备的角度来说,相当于两节点所处的节点设备同时参与了区块链主网和区块链子网。由于区块链主网与区块链子网之间相互独立,使得这两个区块链网络的身份体系也相互独立,因而即便所述主网节点和子网节点可以采用完全相同的公钥,仍然应当将两者视为不同的区块链节点。譬如在图1中,mainnet0中的nodeA相当于上述主网节点,而部署该nodeA的节点设备(即节点设备1)生成了属于subnet1的nodeA1,该nodeA1即相当于上述子网节点。可见,由于身份体系相互独立,所以无论子网节点所采用的公钥是否区别于主网节点,都并不影响本说明书方案的实施。
当然,区块链子网的节点成员并不一定只是区块链主网的部分节点成员。在一些情况下,区块链子网的节点成员可以与区块链主网的节点成员完全一致,此时所有的区块链成员都可以获得区块链主网和区块链子网上的数据,但是区块链主网与区块链子网所产生的数据依然可以相互隔离。比如可以通过在区块链主网上实现一类业务、在区块链子网上实现另一类业务,从而可以使得这两类业务分别产生的业务数据之间相互隔离。
除了上述的节点成员的身份信息之外,配置信息还可以包括下述至少之一:所述区块链子网的网络标识、所述区块链子网的管理员的身份信息、针对区块链平台代码的属性配置等,本说明书并不对此进行限制。网络标识用于唯一表征该区块链子网,因而该区块链子网的网络标识应当区别于区块链主网和该区块链主网上组建的其他区块链子网。区块链子网的管理员的身份信息,譬如可以为作为管理员的节点成员的公钥;其中,区块链主网与区块链子网的管理员可以相同,也可以不同。
通过区块链主网来组建区块链子网的优势之一,就是由于生成所述子网节点的节点设备上已经部署了主网节点,因而可以将主网节点所使用的区块链平台代码复用在子网节点上,免去了区块链平台代码的重复部署,极大地提高了区块链子网的组建效率。那么,如果配置信息中未包含针对区块链平台代码的属性配置,上述子网节点即可以复用主网节点上采用的属性配置;如果配置信息中包含了针对区块链平台代码的属性配置,子网节点则可以采用该属性配置,使得子网节点所采用的属性配置不受限于主网节点的属性配置、与主网节点无关。针对区块链平台代码的属性配置可以包括下述至少之一: 代码版本号、是否需要共识、共识算法类型、区块大小等,本说明书并不对此进行限制。
组建区块链子网的交易包括调用合约的交易。该交易中可以指明被调用的智能合约的地址、调用的方法和传入的参数。例如,调用的合约可以为前述的创世合约或系统合约,调用的方法可以为组建区块链子网的方法,传入的参数可以包括上述的配置信息。在一实施例中,该交易可以包含如下信息:
from:Administrator
to:Subnet
method:AddSubnet(string)
string:genesis
其中,from字段为该交易的发起方的信息,譬如Administrator表明该发起方为管理员;to字段为被调用的智能合约的地址,譬如该智能合约可以为Subnet合约,则to字段具体为该Subnet合约的地址;method字段为调用的方法,譬如在Subnet合约中用于组建区块链子网的方法可以为AddSubnet(string),而string为AddSubnet()方法中的参数,上述示例中通过genesis表征该参数的取值,该genesis具体为前述的配置信息。
以mainnet0上的节点nodeA~nodeE执行调用Subnet合约中AddSubnet()方法的交易为例。在交易通过共识后,nodeA~nodeE分别执行AddSubnet()方法并传入配置信息,得到相应的执行结果。
区块链网络中的节点在执行调用智能合约的交易后,会生成相应的收据(receipt),以用于记录与执行该智能合约相关的信息。这样,可以通过查询交易的收据来获得合约执行结果的相关信息。合约执行结果可以表现为收据中的事件(event)。消息机制可以通过收据中的事件实现消息传递,以触发区块链节点执行相应的处理。事件的结构譬如可以为:
Event:
[topic][data]
[topic][data]
......
在上述示例中,事件的数量可以为一个或多个;其中,每个事件分别包括主题(topic)和数据(data)等字段。区块链节点可以通过监听事件的topic,从而在监听到预定义的topic的情况下,执行预设处理,或者从相应事件的data字段读取相关内容,以及可以基于读取的内容执行预设处理。
上述的事件机制中,相当于在监听方(比如存在监听需求的用户)处存在具有监听功能的客户端,譬如该客户端上运行了用于实现监听功能的SDK(Software Development Kit,软件开发工具包)等,由该客户端对区块链节点产生的事件进行监听,而区块链节点只需要正常生成收据即可。除了上述的事件机制之外,还可以通过其他方式实现交易信息的透出。例如,可以通过在区块链节点运行的区块链平台代码中嵌入监听代码,使得该监听代码可以监听区块链交易的交易内容、智能合约的合约状态、合约产生的收据等其中的一种或多种数据,并将监听到的数据发送至预定义的监听方。由于监听代码部署于区块链平台代码中,而非监听方的客户端处,因而相比于事件机制而言,这种基于监听代码的实现方式相对更加的主动。其中,上述的监听代码可以由区块链平台的开发人员在开发过程中加入区块链平台代码,也可以由监听方基于自身的需求而嵌入,本说明书并不对此进行限制。
可见,上述Subnet合约的执行结果可以包括所述配置信息,该执行结果可以处于前文所述的收据中,该收据中可以包含与执行AddSubnet()方法相关的event,即组网事件。组网事件的topic可以包含预定义的组网事件标识,以区别于其他的事件。譬如在与执行AddSubnet()方法相关的event中,topic的内容为关键词subnet,且该关键词区别于其他方法所产生event中的topic。那么,nodeA~nodeE通过监听生成的收据中各个event所含的topic,可以在监听到包含关键词subnet的topic的情况下,确定监听到与执行AddSubnet()方法相关的event,即组网事件。例如,收据中的event如下:
Event:
[topic:other][data]
[topic:subnet][data]
......
那么,nodeA~nodeE在监听到第1条event时,由于所含topic的内容为other,确定该event与AddSubnet()方法无关;以及,nodeA~nodeE在监听到第2条event时,由于所含topic的内容为subnet,确定该event与AddSubnet()方法相关,进而读取该event对应的data字段,该data字段包含上述的配置信息。以配置信息包括区块链子网的节点成员的公钥为例,data字段的内容例如可以包括:
{subnet1;
nodeA的公钥,nodeA的IP、nodeA的端口号…;
nodeB的公钥,nodeB的IP、nodeB的端口号…;
nodeC的公钥,nodeC的IP、nodeC的端口号…;
nodeD的公钥,nodeD的IP、nodeD的端口号…;
}
其中,subnet1为希望创建的区块链子网的网络标识。区块链主网中的各个区块链节点可以记录该区块链主网上已创建的所有区块链子网的网络标识,或者与这些区块链子网相关的其他信息,这些信息譬如可以维护在上述的Subnet合约中,具体可以对应于该Subnet合约所含的一个或多个合约状态的取值。那么,nodeA~nodeE可以根据记录的已创建的所有区块链子网的网络标识,确定上述的subnet1是否已经存在;如果不存在,说明subnet1是当前需要创建的新区块链子网,如果存在则说明subnet1已经存在。
除了采用希望创建的新的区块链子网的网络标识之外,还可以采用预定义的新建网络标识,该新建网络标识表明相应的组网事件用于组建新的区块链子网。例如,可以将上述的subnet1替换为newsubnet,该newsubnet为预定义的新建网络标识,nodeA~nodeE在识别到data字段包含newsubnet时,即可确定包含该newsubnet的event为组网事件,需要创建新的区块链子网。
除了网络标识subnet1之外,上述data字段中还包含各个节点成员的身份信息等内容。部署主网节点的节点设备可以监听生成的收据,并在监听到所述组网事件且所述组网事件的内容表明该主网节点属于所述节点成员的情况下,由部署该主网节点的节点设备获取所述组网事件包含的配置信息或创世块。或者,主网节点可以监听生成的收据,并在监听到所述组网事件且所述组网事件的内容表明该主网节点自身属于所述节点成员的情况下,触发部署该主网节点的节点设备获取所述组网事件包含的所述配置信息或所述创世块。
如前所述,节点设备可以直接监听收据。假定nodeA~nodeE分别部署在节点设备1~5 上,节点设备1~5可以监听nodeA~nodeE分别生成的收据,那么在监听到subnet1是需要新组建的区块链子网的情况下,节点设备1~5可以进一步识别data字段中包含的节点成员的身份信息,以确定自身的处理方式。以nodeA和节点设备1为例:如果节点设备1发现data字段包含nodeA的公钥、IP地址和端口号等身份信息,那么节点设备1在基于上述的消息机制从data字段获得配置信息的情况下,可以生成包含该配置信息的创世块,进而在本地部署nodeA1,并由nodeA1加载生成的创世块以成为subnet1的子网节点。类似地,节点设备2可以生成nodeB1、节点设备3可以生成nodeC1、节点设备4可以生成nodeD1。以及,节点设备5会发现data字段包含的身份信息与自身均不匹配,则节点设备5不会根据data字段中的配置信息生成创世块,也不会生成subnet1中的区块链节点。
如前所述,区块链主网中的区块链节点可以监听收据,并根据监听结果触发节点设备执行相关处理。例如,nodeA~nodeE在确定subnet1是需要新组建的区块链子网的情况下,会进一步识别data字段中包含的节点成员的身份信息,以确定自身的处理方式。比如,nodeA~nodeD会发现在data字段包含自身的公钥、IP地址和端口号等身份信息,假定nodeA~nodeD分别部署在节点设备1~4上,以nodeA和节点设备1为例:nodeA会触发节点设备1,使得节点设备1基于上述的消息机制从data字段获得配置信息并生成包含该配置信息的创世块,且节点设备1会在本地部署nodeA1,该nodeA1加载生成的创世块,从而成为subnet1中的1个子网节点。类似地,nodeB会触发节点设备2生成nodeB1、nodeC会触发节点设备3生成nodeC1、nodeD会触发节点设备4生成nodeD1。以及,nodeE会发现data字段包含的身份信息与自身均不匹配,假定nodeE部署在节点设备5上,那么该节点设备5不会根据data字段中的配置信息生成创世块,也不会生成subnet1中的节点。
如前所述,同一节点设备中部署的主网节点与子网节点并不一定采用相同的身份信息。因此,在上述实施例中,data字段中可以包含预先为nodeA1~nodeD1生成的身份信息,且区别于nodeA~nodeD的身份信息。仍以nodeA和节点设备1为例:节点设备1如果在data字段中发现了nodeA1的身份信息,可以生成创世块、部署nodeA1,并由nodeA1加载该创世块;或者,nodeA如果在data字段中发现了nodeA1的身份信息,那么nodeA会触发节点设备1生成创世块、部署nodeA1,并由nodeA1加载该创世块。其他区块链节点或节点设备的处理方式类似,此处不再一一赘述。
除了配置信息之外,合约的执行结果也可以包括创世块。换言之,除了可以在data字段中包含配置信息,还可以直接在执行合约调用的过程中生成包含配置信息的创世块,从而将创世块包含于data字段中,那么对于上述的nodeA~nodeD而言,相应的节点设备1~4可以通过消息机制直接从data字段获得创世块,而无需自行生成,可以提升对nodeA1~nodeD1的部署效率。
节点设备通过在一进程中创建一个运行区块链平台代码的实例,实现在该节点设备上部署一区块链节点。对于主网节点而言,由节点设备在上述进程中创建第一实例,并由该第一实例运行区块链平台代码而形成。类似地,对于子网节点而言,由节点设备在上述进程中创建区别于第一实例的第二实例,并由该第二实例运行区块链平台代码而形成。例如,节点设备可以首先在进程中创建第一实例,以形成区块链主网中的主网节点;而当该节点设备对应的节点成员希望参与组建区块链子网时,可以在上述进程中创建第二实例,该第二实例区别于上述的第一实例,并由该第二实例形成区块链子网中的子网节点。当第一实例与第二实例位于同一进程时,由于不涉及跨进程交互,可以降低对该子网节点的部署难度、提高部署效率;当然,第二实例也可能与第一实例分别处于节点设备上的不同进程中,本说明书并不对此进行限制;例如,节点设备可以在第一进程中创建第一实例,以形成区块链主网中的主网节点;而当该节点设备对应的节点成员希望 参与组建区块链子网时,可以启动区别于第一进程的第二进程,并在该第二进程中创建第二实例,该第二实例区别于上述的第一实例,进而由该第二实例形成区块链子网中的子网节点。事实上,本说明书实施例中涉及的任一节点设备上部署的各区块链节点均为运行在节点设备上的不同的区块链实例,节点设备上部署的各区块链节点生成的区块可以分别存入该节点设备上的不同存储(例如数据库),且任一节点设备部署的各区块链节点分别使用的存储之间相互隔离。
通过上述方式,可以在区块链主网上创建出由区块链主网所管理的区块链子网。以图1为例,对于包含nodeA~nodeE的mainnet0,可以在mainnet0的基础上可以创建出subnet1,该subnet1包含nodeA1~nodeD1,且subnet1中的任一子网节点与其在mainnet0中对应的主网节点被部署于同一节点设备,例如,nodeA与nodeA1被部署于节点设备1、nodeB与nodeB1被部署于节点设备2、nodeC与nodeC1被部署于节点设备3、nodeD与nodeD1被部署于节点设备4。类似地,还可以在mainnet0上创建出subnet2乃至更多的区块链子网,其中subnet2包含nodeA2、nodeB2和nodeE2,且nodeA与nodeA1、nodeA2,nodeB与nodeB1、nodeB2,nodeC与nodeC1,nodeD与nodeD1,nodeE与nodeE2分别部署在同一节点设备上。以及,还可以将subnet1、subnet2等作为区块链主网,并在此基础上进一步创建出下一级区块链子网,例如在subnet1的基础上创建出区块链子网subnet1.1,其过程与subnet1或subnet2的创建相似,仅仅是将区块链主网替换为区块链子网subnet1,此处不再赘述。如图所示,节点设备1中部署有主网节点nodeA以及子网节点nodeA1和nodeA2;节点设备2中部署有主网节点nodeB以及子网节点nodeB1和nodeB2;节点设备3中部署有主网节点nodeC以及子网节点nodeC1、和节点设备4中部署有主网节点nodeD以及子网节点nodeD1;节点设备5中部署有主网节点nodeE和子网节点nodeE2。
除了通过上述在区块链主网上发起交易选取节点成员以创建区块链子网的方式,还可以通过其他手段创建区块链子网,并使得其受到区块链主网的管理。例如,可以通过注册方式在区块链主网上组建区块链子网(后续简称注册组网方式),将现有区块链网络直接注册至区块链主网,使新注册的区块链网络受到区块链主网的管理,从而使得新注册的区块链网络成为区块链主网的区块链子网。通过注册组网方式,待组建区块链子网的子网信息被直接注册至区块链主网,使得区块链主网获取待组建区块链子网的相关信息(通过接收并执行待组建区块链网络发出的、用于将其身份信息与分配至该待组建区块链网络的子网标识进行关联存证的交易),例如待组建区块链子网的子网标识和运行状态,其中各节点成员的公钥和插件配置信息、各节点设备的IP地址和端口信息等,这些信息会被写入区块链主网对应的系统合约的合约状态中,由此区块链主网将获取该待组建区块链子网的管理权,在完成注册后,便意味着区块链子网组建完成。由于注册组网方式并不需要通过交易在区块链主网上指定节点成员构成区块链子网,因此通过注册组网方式组建的区块链子网中的子网节点可以与部署在区块链主网中各节点的节点设备完全不同或部分不同。例如图1中mainnet0以注册组网方式创建了一个subnet3(图1中未示出),假设mainnet0自身所包含的主网节点nodeA~nodeE分别部署于节点设备1~5,那么subnet3对应的子网节点可以部署于除节点设备1~5外的其他任意节点设备上,或者,subnet3中的其中一个或多个子网节点分别部署于节点设备1~5内的任意节点设备(但仍需要保证一个节点设备上仅部署subnet4中的一个子网节点),而subnet3中的其他的子网节点部署于除节点设备1~5外的其他任意节点设备上,当然,subnet4中的子网节点也可以均部署于节点设备1~5之中,不再赘述。
通过上述方式创建的区块链主网和区块链子网中的任意两个区块链网络之间可以实现跨链交互。以属于mainnet0的nodeC和属于subnet1的nodeC1为例,由图1可见,二者部署于节点设备3中,nodeC和nodeC1具体为节点设备3在本地部署的虚拟机中 运行区块链平台代码所形成的区块链节点实例(下称区块链节点),而nodeC作为区块链节点在运行过程中的相关数据保存在nodeC对应的主网数据库中,nodeC1作为另一区块链节点在运行过程中的相关数据则保存在nodeC1对应的子网数据库中,上述主网数据库和子网数据库均属于节点设备3的存储空间。另外,节点设备3中可以部署区块链共识代码,通过运行该共识代码,节点设备3可以在本地形成共识组件实例;以及,节点设备中还可以部署有以插件形式管理的P2P组件代码,通过运行该P2P组件代码,节点设备可以在本地形成P2P组件实例,也即P2P插件。任一节点设备中部署的P2P插件可以被该节点设备上的不同区块链节点所共享使用,例如节点设备3中nodeC与nodeC1可以调用节点设备3上运行的同一个P2P插件,以共享其功能和数据。节点设备3中还可以部署有区块链业务代码,通过运行该区块链业务代码,节点设备3可以在本地形成业务实例,其中,节点设备3中可以实现至少一个业务实例,如用于实现数据读/写功能的存储实例、用于实现隐私计算等计算功能的计算实例、用于实现数据加密功能的加密实例等,不再赘述。
在本说明书实施例中,同一节点设备上的主网节点和子网节点共享该节点设备上运行的区块链通讯插件,例如前述的P2P插件。上述形成mainnet0时所实现的网络连接链路,具体可以是通过nodeC和nodeE分别采用节点设备3和节点设备5上的P2P插件所建立。由于节点设备上的P2P插件可以被该节点设备上各个区块链节点所共享,因此subnet1中的nodeC1可以通过调用节点设备3本地运行的P2P插件,借助形成mainnet0时所实现的节点设备3与节点设备5之间基于P2P插件的网络连接,建立与nodeE2所属节点设备5上运行的P2P插件之间的网络连接,由此将跨链消息发送至节点设备5,从而进一步实现与nodeE2之间的网络通讯。该方式使得源区块链网络与目的区块链网络之间无需建立新的网络连接链路,而是通过底层区块链主网预先建立的网络连接链路,即可实现源区块链网络中源节点与目的区块链网络中目的节点之间的网络通讯。
通过上述方式创建的区块链子网,可以由区块链主网所管理。在区块链主网管理区块链子网的场景下,为了实现对区块链子网中子网节点的可控迁移,本说明书提出一种区块链节点的迁移方法,由主网节点通过执行交易控制子网节点的迁移。下面结合附图对本方案进行详细说明。
图2是本说明书实施例提出的一种区块链节点的迁移方法的流程图。由图2可见,该方法包括步骤202-208。
步骤202,第一节点设备中部署的主网节点通过执行节点迁移交易向第一节点设备透出区块链子网的创世块信息,以由第一节点设备将所述创世块信息发送至第二节点设备,所述主网节点所属的区块链主网用于管理所述区块链子网。
如前所述,本方案用于将区块链子网中的第一子网节点迁移为第二子网节点,具体的,是在第二节点设备中启动第二子网节点,并由启动完成的该子网节点加载第一子网节点的历史数据。需要说明的是,在本说明书所述实施例中,用于部署第二子网节点的第二节点设备中并未部署所述区块链主网中的任何主网节点和所述区块链子网中的任何子网节点。例如,第二子网节点中可以未部署任何区块链节点,或者也可以部署有与本方案所述区块链主网和区块链子网无任何关联的区块链节点,本说明书实施例并不对此进行限制。
第一节点设备中部署有区块链主网中的任一主网节点,而待迁移的第一子网节点可以被部署在第一节点设备,或者也可以被部署在除第一节点设备和第二节点设备之外的其他节点设备中。如图1所示,在第一子网节点为subnet2中的子网节点nodeA2的情况下,第一节点设备可以为节点设备1,此时该节点设备中部署有主网节点nodeA和第一子网节点nodeA2;或者,第一节点设备也可以为节点设备3,此时该节点设备中部署有 主网节点nodeC,但并未部署subnst2中的子网节点。
在一实施例中,上述节点迁移交易可由多种区块链参与方所发起。例如,该交易可由所述区块链主网或者区块链子网的管理员所发起。可以理解的是,区块链子网的管理员通常获知区块链子网中包含的各个子网节点;而由于区块链子网由区块链主网所管理,因此区块链主网的管理员也可以获知区块链子网中包含的各个子网节点。所以基于上述信息,区块链主网和区块链子网的管理员均可以通过区块链主网中的任一主网节点发起所述节点迁移交易,以实现对第一子网节点的迁移管理。再例如,区块链子网中任一子网节点在所述区块链主网中对应的节点成员可以通过相应的主网节点发起所述节点迁移交易,当然,基于区块链主网与区块链子网之间的管理关系,区块链主网中任一主网节点对应的节点成员均可以通过相应的主网节点发起所述节点迁移交易。仍以第一子网节点为图1所示subnet2中的子网节点nodeA2为例,nodeA2对应的节点成员可以通过nodeA向mainnet0发起针对nodeA2的节点迁移交易,nodeB2和nodeE2对应的节点成员也可以分别通过nodeB和nodeE发起该交易;或者,nodeA对应的节点成员可以通过nodeA向mainnet0发起针对nodeA2的节点迁移交易,nodeB~E对应的节点成员也可以分别通过nodeB~E发起该交易,不再赘述。通过该方式,具有交易发起权限的管理员或者相关节点成员可发起所述节点迁移交易,从而能够满足多种形式的迁移控制需求。
在上述节点迁移交易发起后,区块链主网中的各个主网节点可以分别获取并执行该交易。其中,所述交易中可以包含该交易的执行时间,如在第一时刻之后开始触发执行、在第二时刻至第三时刻之间的时间段内完成执行、在第四时刻之前触发执行或者结束执行(否则终止执行)等。基于上述执行时间,第一节点设备中部署的主网节点可以在相应的时间节点执行节点迁移交易,以便实现对节点迁移过程的精准控制。可以理解的是,在区块链子网中存在多个子网节点需要迁移的情况下,上述执行时间可以为针对各个子网节点的交易执行时间,从而实现对各个子网节点的迁移时间的管控,有助于实现各个子网节点的渐进式迁移,以尽量保证区块链子网在迁移过程中的可用性。
在一实施例中,鉴于区块链子网被区块链主网所管理,所以区块链子网的创世块信息可以被记录在区块链主网的系统合约中。基于此,所述主网节点在执行节点迁移交易的过程中可以调用该系统合约以获取所述创世块信息,并将获取到的所述创世块信息透出至第一节点设备。
在另一实施例中,主网节点可以通过事件机制系那个第一节点设备透出区块链子网的创世块信息。例如,主网节点可以执行节点迁移交易以生成包含所述创世块信息的节点迁移事件,而该事件允许被第一节点设备监听到。从而,第一节点设备可以监听所述节点迁移事件,并从监听到的该事件中提取所述创世块信息。实际上,通过该方式,主网节点与第一节点设备之间可以实现对创世块信息的异步传递,从而有助于提升第一节点设备对区块链事务的整体处理效率。
其中,上述节点迁移事件可以被记录在执行所述节点迁移交易产生的收据中,而且该收据中还可以记录有第二节点设备的网络地址。基于此,第一节点设备可以从该收据中获取第二节点设备的网络地址,并按照该网络地址将从所述节点迁移事件中提取的创世块信息发送至第二节点设备。可以理解的是,所述网络地址可以由所述节点迁移交易的发起方通过链下方式获取并将其记录在该交易中,以便第一节点设备通过该网络地址建立与第二节点设备之间的网络连接,进而基于该网络连接向其发送所述创世块信息。当然,节点迁移交易的发起方也可以通过其他方式向第一节点设备执行第二节点设备的网络地址,本说明书实施例并不对此进行限制。
在说明书所述实施例中,所述区块链子网的创世块信息可包括该子网的网络标识、该子网的管理员的身份信息、该子网的各个创建方(如参与创建该子网的初始节点成员) 的身份信息、针对该子网的区块链平台代码的属性配置等。其中,上述平台代码的属性配置可包括代码版本号、是否需要共识、共识算法类型和/或区块大小等信息,不再赘述。
步骤202,第二节点设备根据所述创世块信息生成创世块,并通过加载所述创世块启动第二子网节点。
在获取到第一节点设备发送的所述创世块信息的情况下,第二节点设备可以根据该信息生成创世块。可以理解的是,因为该创世块信息为区块链子网的创世块信息,所以生成的创世块即为区块链子网的创世块,进而加载该创世块启动的区块链节点也属于区块链子网,即第二子网节点是归属于区块链子网的区块链节点。另外,第一节点设备生成的所述创世块(即用于启动第二子网节点的创世块)与区块链子网中其他子网节点的所维护的创世块并无本质区别,实际上,加入区块链子网的各个子网节点的创世块都是相同的。第二节点设备根据所述创世块信息生成创世块的具体过程可以参见相关技术中的记载,此处不再赘述。
第二节点设备可以通过创建实例的方式加载第二子网节点。例如,第二节点设备可以在本地拉起一进程,并在该进程中创建一实例,以由该实例通过加载所述创世块启动第二子网节点。另外,第二节点设备可以为该实例指定相应的子网数据库,以由该实录将所述创世块加载至该子网数据库中。其中,第二节点设备可以通过设置路径或目录的方式指定所述子网数据库,该子网数据库对应的存储空间可以处于第二节点设备本地,当然,也可以处于第二节点设备允许访问的其他设备中,不再赘述。
如图1所示,在作为第二子网节点启动完成后,作为第二节点设备的节点设备6中即存在一子网节点nodeF2,但是该节点尚未加入区块链网络,因此nodeF2与nodeA2、nodeB2和nodeE2之间尚未建立连接。需要说明的是,所述节点设备6可以区别于节点设备1~5的新设备,或者也可以为所述节点设备3或节点设备4。以节点设备6与节点设备3为同一节点设备为例,此时该节点设备中部署有mainnet0中的主网节点nodeC,但是因为subnet2中并不存在nodeC对应的子网节点,所以仍然可以按照本说明书所述方案在该节点设备中部署属于subnet2的子网节点nodeF2。
步骤206,第二子网节点加入所述区块链子网,并加载所述区块链子网中第一子网节点的历史数据。
在启动完成后,第二子网节点还仅是一个孤立的区块链节点,需要加入所述区块链子网,才能成为该区块链子网的成员,也才能够实现与其他子网节点之间的交互。
在一实施例中,所述创世块信息可以包括所述区块链子网中其他子网节点的身份信息和网络地址,所述身份信息和网络地址可以由节点迁移交易的发起方通过线下方式采集并记录在该交易中,当然,也可以被维护在区块链主网的系统合约中,本说明书实施例并不对此进行限制。进而,第二子网节点可以根据所述身份信息和网络地址与其他子网节点建立网络连接。其中,第二子网节点与任一其他节点设备可以通过P2P组件实现网络连接,例如,第二节点设备和所述任一其他节点设备中可以分别部署有相应的P2P组件,而第二子网节点即可调用第二节点设备中的该P2P组件与所述任一其他节点设备中的P2P组件建立网络连接。在第二子网节点与其他子网节点之间建立网络连接完成后,第二子网节点与其他子网节点即可实现网络通信,此时第二子网节点即参与到区块链子网中,成为该子网中的子网节点。
进而,第二子网节点可以从其他子网节点处获取区块链子网中各个子网节点的节点信息,以便在本地创建并维护针对区块链子网中各个子网节点的节点列表。如前所述,所述创世块信息对应于参与创建区块链子网的初始节点成员,因此上述身份信息和网络地址可能仅是所述初始节点成员的身份信息和网络地址,因此第二子网节点根据这些信 息仅能够与所述初始节点成员之间建立网络连接。对此,若所述节点列表中除了包含所述初始节点成员之外还包含后加入节点成员,则第二子网节点还可以与上述后加入节点成员之间建立网络连接。可以理解的是,相对于区块链子网中的初始节点成员而言,第二子网节点也属于后加入节点成员,不再赘述。
参见图1和图3,以第一子网节点为subnet2中的子网节点nodeA2、第二子网节点为nodeF2为例,节点设备6启动的nodeF2在加入区块链子网完成后,即与原有的节点nodeA2、nodeB2和nodeD2构成subnet2。
启动完成后的第二子网节点还需要加载第一子网节点的历史数据,以便基于迁移后的这部分历史数据参与区块链子网的运行。其中,所述历史数据是第一子网节点在参与区块链子网的运行(如交易共识、交易执行、智能合约部署及执行等)过程中产生的区块链数据,例如可以包括历史区块、历史交易、交易收据、状态数据等,本说明书实施例并不对此进行限制。
如前所述,第二节点设备可以为第二子网节点指定相应的子网数据库,基于此,第二子网节点可以将第一子网节点的历史数据加载至该子网数据库中。可以理解的是,上述子网数据库对应于第二子网节点,所以第二节点设备具有针对该数据库的访问权限,如可以从该数据库中读取数据或者将数据写入该数据。而且,所述子网数据库可以与第二节点设备中的其他数据库相互隔离,以避免第二子网节点的区块链数据被其他相关方获取,以实现对这部分区块链数据的权限管理。例如,若第二节点设备中还部署有其他区块链节点,则该区块链节点的数据库可以与第二子网节点的子网数据库相互隔离,以避免该区块链节点和第二子网节点分别访问对方的区块链数据,有助于保证各个节点区块链数据的私密性。
其中,鉴于所述历史数据可通过多种方式获取,所以第二子网节点加载该数据的方式也相应的有所不同。例如,第二子网节点在加入所述区块链子网完成后,可从区块链子网中的第一子网节点处同步所述历史数据。当然,考虑到同一区块链网络中的各个区块链节点分别维护的区块链数据可能相同,因此第二子网节点也可以从区块链子网中的其他子网节点处同步所述历史数据。为尽快获取所述历史数据,第二子网节点还可同时从多个子网节点处同步该数据。如在所述历史数据包括仅由第一子网节点维护的第一历史数据和由区块链子网中各个子网节点分别维护的第二历史数据的情况下,第二子网节点可以从第一子网节点处同步所述第一历史数据,并同时从至少一个其他子网节点处同步所述第二历史数据,以便尽快获取到全部的历史数据,减少历史数据迁移过程的耗时。
另外,考虑到所述历史数据的数据量可能较大,即需要迁移的历史数据较多,为进一步提升数据迁移的效率,第二节点设备也可以通过链下方式获取所述历史数据,以供启动后的第二子网节点加载。例如,第二节点设备的管理人员可以将存储有所述历史数据的存储设备装载至第二节点设备,进而第二子网节点可以从该存储设备中加载历史数据,如可以将所述历史数据在该存储设备中的存储目录添加至前述子网数据库的可访问目录中,即将历史数据所处存储空间作为所述子网数据库的存储空间的一部分,此后,第二子网节点可以通过所述存储目录访问所述历史数据。可以理解的是,第二子网节点通过所述存储目录访问历史数据的过程,即为访问所述子网数据库的过程。或者,第二子网节点也可以将上述存储设备中记录的历史数据拷贝至子网数据库对应的存储空间,此后即可在该存储空间中访问拷贝后的历史数据。其中,上述存储设备可以包括从第一节点设备上卸载的磁盘、固态硬盘、U盘等硬件设备,当然,在所述历史数据同样被其他子网节点维护的情况下,所述硬件设备也可以从部署有区块链子网的子网节点的其他节点设备(如距离第二节点设备更近的节点设备)上卸载,本说明书实施例并不对此进行限制。通过该方式,第二节点设备的管理人员可以通过硬件卸载及装载的方式将待迁 移的历史数据快速迁移至第二节点设备以供第二子网节点加载。在第二节点设备的带宽有限、历史数据的数据量过大、第一节点设备与第二节点设备距离较近等场景下,该方式能够有效提升历史数据的迁移效率。
可以理解的是,由于前述第二子网节点在启动和历史数据的加载需要消耗一定的时间,在这段时间内区块链子网中处于正常运行状态的子网节点可能产生区别于所述历史数据的最新数据,所以为了保证第二子网节点可以顺利参与区块链子网的运行,第二子网节点还可以在加入所述区块链子网完成后,从所述区块链子网中的其他子网节点处同步区别于所述历史数据的最新数据,并加载同步到的所述最新数据。当然,上述最新数据与历史数据之间可能存在逻辑上的依赖关系,因此可以在加载所述历史数据完成后再同步并加载所述最新数据,以保证第二子网节点本地加载的区块链数据之间的依赖关系保持不变,进而尽量确保区块链子网运行正常。
步骤208,在第二子网节点加载所述历史数据完成的情况下,第一子网节点退出所述区块链子网。
第二子网节点加载所述历史数据完成后,即可通过访问所述历史数据正常参与区块链子网的运行,如参与交易共识、交易执行、智能合约部署与执行等。此时,为实现对第一子网节点的迁移,第一子网节点还需要退出所述区块链子网,而在第一子网节点退出区块链子网完成后,第二子网节点即可在功能上代替第一子网节点参与区块链子网的运行。
在上述实施例中,在区块链主网管理区块链子网的场景下,主网节点通过执行节点迁移交易向自身所处的第一节点设备透出区块链子网的创世块信息,并由第一节点设备将该信息发送至第二节点设备。第二节点设备根据该信息生成并加载创世块以启动第二子网节点,由该子网节点在加入区块链子网之后加载第一子网节点的历史数据。而第一子网节点在第二子网节点加载完成的情况下即退出区块链子网。
由区块链子网中新启动的第二子网节点加载第一子网节点的历史数据,且第一子网节点在上述加载完成后退出区块链子网,可见所述区块链子网中的第一子网节点和第二子网节点分别为迁移前和迁移后的子网节点;而且,由第二子网节点启动后加载第一子网节点的历史数据,有助于迁移后的第二子网节点正常参与该区块链子网。而且,本方案由区块链主网通过执行区块链交易的方式触发子网节点迁移,实现了区块链主网对区块链子网的节点迁移过程的有效控制。可见,本方案实现了在区块链主网管理区块链子网的场景下对子网节点的有效和可控迁移。
其中,第一子网节点可以通过多种方式退出区块链子网。例如,主网节点执行所述节点迁移交易产生的节点迁移事件除了用于透出所述创世块信息之外,还可以用于指示待退出的子网节点,即指示区块链子网中的哪个子网节点是待迁移的第一子网节点。如该事件中可以记录第一子网节点的身份信息,从而第一子网节点在监听到所述节点迁移事件且确定其中记录有自身的身份信息的情况下,可以等待新启动的第二子网节点加载完成所述历史数据,并在确定加载完成时退出区块链子网。其中,第二子网节点可以在自身加载历史数据完成后向第一子网节点发送一通知消息,以告知自身加载历史数据完成。为尽量确保通知消息被第一子网节点接收,第二子网节点可以在区块链子网中广播该通知消息,以由各个子网节点判断自身是否应该响应该通知消息;或者,为减少通知消息对区块链子网的线上通信资源的占用,第二子网节点也可以针对性地向第二子网节点发送该通知消息,本说明书实施例并不对此进行限制。通过该方式,仅需要在区块链主网中发起一笔节点迁移交易,即可依次实现第二子网节点启动和第一子网节点退出,从而简化节点迁移过程,提升迁移效率。
再例如,节点迁移交易的发起方在确定第二子网节点加载所述历史数据完成的情况 下,可以在区块链子网中发起针对第一子网节点的节点退出交易;或者,也可以由第二子网节点在确定自身加载所述历史数据完成的情况下发起该交易。进而,区块链子网中的各个子网节点可以分别获取并执行所述节点退出交易,以使第一子网节点退出所述区块链子网。通过该方式,交易的发起方可以自行控制何时发起该节点退出交易,以便控制第一子网节点在合适的时间节点退出区块链子网,避免影响该子网的正常运行。
具体的,第一子网节点可以断开与所述区块链子网中其他子网节点之间的通信连接,在该通信连接断开后,第一子网节点与区块链子网中的其他各个子网节点将无法再进行链上通信,该节点不会再参与到该子网的运行。
另外,第一子网节点还可以从自身维护的所述区块链网络的通信列表中删除其他子网节点的通信地址,相应地,其他子网节点在自身与第一子网节点之间的网络连接已断开的情况下,从自身维护的所述区块链网络的通信列表中删除第一子网节点的通信地址。可以理解的是,区块链子网的通信列表的作用是,使得子网节点可以根据通信列表中记录的同属于一个子网的其他节点的通信地址,与其他节点进行通信,以实现交易转发、共识等。所述区块链子网中各个子网节点将第一子网节点的通信地址从通信列表中删除,会导致第一子网节点不再能够与同一个子网中的其他节点通信,也将第一子网节点就从功能上被排除出该子网。
另外,鉴于所述区块链子网由区块链主网所管理,所以区块链主网中的各个主网节点建立有对区块链子网中各个子网节点的管理关系,因而,所述区块链主网中的各个主网节点可以响应于第一子网节点退出所述区块链子网完成,解除对第一子网节点的管理关系。其中,建立对某个节点的管理关系,可以理解为对该节点参与到对应子网中的权限进行注册;而解除对该节点的管理关系,可以理解为对该节点参与到对应子网中的权限进行取消。其中,区块链主网中的各个主网节点可以通过执行交易的方式接触针对第一子网节点的管理关系。该交易的发起方可以是第一子网节点本身,也可以是区块链系统对应的成员客户端(即第一子网节点对应的成员所使用的客户端),本说明书实施例并不对此进行限制。
本公开实施例的上述区块链节点的迁移方案,仅针对区块链子网中的一个子网节点(即第一子网节点)进行描述。实际上,区块链子网中可能存在多个待迁移的子网节点,对于其中任一子网节点,均可以采用前述方案进行处理,以将该子网节点迁移区块链子网中新的子网节点。而且,上述节点迁移交易也可以指示各个第二子网节点的启动时间信息和第一子网节点的推出时间信息,如可以按照时先后顺序指定各个第二子网节点加入区块链子网的时刻和各个第一子网节点退出区块链子网的时刻,从而在执行该交易的过程中,可以以工作流的方式依次实现各个第一子网节点的迁移,实现对多个第一子网节点的迁移过程的自动化管控。可以理解的是,因为上述第一子网节点在第二子网节点加载所述历史数据完成(即第二子网节点可以参与区块链子网的运行)之后才退出区块链子网,所以即便存在多个子网节点同时或在短时间内退出,也能够确保存在足够数量的子网节点参与区块链子网的运行,从而有助于实现各个子网节点的渐进式迁移。
参见图1,仍以第一子网节点为subnet中的子网节点nodeA2、第二子网节点为nodeF2为例,对区块链子网的节点变化情况进行说明。在nodeF2加入subnet2完成之前,subnet2包含3个子网节点,即nodeA2、nodeB2和nodeD2,此时为区块链子网在nodeA2迁移前的初始状态。在nodeF2加入subnet2完成且nodeF2尚未退出区块链子网时,subnet2包含4个子网节点,即nodeA2、nodeB2、nodeD2和nodeF2,此时,各个子网节点均可以参与区块链子网的运行,此时为nodeA2迁移过程的中间状态。进一步的,在nodeA2退出区块链子网完成后,subnet2包含3个子网节点,即nodeB2、nodeD2和nodeF2,此时为nodeA2迁移后的完成状态。可见,通过上述区块链节点的迁移过程, 区块链子网中的nodeA2被替换为nodeF2,即实现了对nodeA2的迁移,而迁移后的nodeF2可以基于自身所加载的nodeA2的历史数据参与区块链子网的运行。
图4是一示例性实施例提供的一种设备的示意结构图。请参考图4,在硬件层面,该设备包括处理器402、内部总线404、网络接口406、内存408以及非易失性存储器410,当然还可能包括其他业务所需要的硬件。本说明书一个或多个实施例可以基于软件方式来实现,比如由处理器402从非易失性存储器410中读取对应的计算机程序到内存408中然后运行。当然,除了软件实现方式之外,本说明书一个或多个实施例并不排除其他实现方式,比如逻辑器件抑或软硬件结合的方式等等,也就是说以下处理流程的执行主体并不限定于各个逻辑单元,也可以是硬件或逻辑器件。
如图5所示,图5是本说明书根据一示例性实施例提供的一种区块链节点的迁移装置的框图,该装置可以应用于如图4所示的设备中,以实现本说明书的技术方案。该装置包括:信息透出单元501,用于第一节点设备中部署的主网节点通过执行节点迁移交易向第一节点设备透出区块链子网的创世块信息,以由第一节点设备将所述创世块信息发送至第二节点设备,所述主网节点所属的区块链主网用于管理所述区块链子网;节点启动单元502,用于第二节点设备根据所述创世块信息生成创世块,并通过加载所述创世块启动第二子网节点;节点加入单元503,用于第二子网节点加入所述区块链子网,并加载所述区块链子网中第一子网节点的历史数据;节点退出单元504,用于在第二子网节点加载所述历史数据完成的情况下,第一子网节点退出所述区块链子网。
可选的,所述信息透出单元501还用于:主网节点执行节点迁移交易以生成包含区块链子网的创世块信息的节点迁移事件,所述节点迁移事件允许被第一节点设备监听到。
可选的,所述节点迁移事件被记录在所述节点迁移交易的收据中,所述信息透出单元501还用于:第一节点设备从所述收据中获取第二节点设备的网络地址,并按照所述网络地址将所述创世块信息发送至第二节点设备。
可选的,所述创世块信息被记录于所述区块链主网的系统合约中,所述信息透出单元501还用于:所述主网节点在执行节点迁移交易的过程中调用所述系统合约以获取所述创世块信息,并将获取到的所述创世块信息透出至第一节点设备。
可选的,所述创世块信息包括所述区块链子网中其他子网节点的身份信息和网络地址,所述节点加入单元503还用于:第二子网节点根据所述身份信息和网络地址与所述其他子网节点建立网络连接。
可选的,还包括数据库指定单元505,用于第二节点设备为第二子网节点指定子网数据库;上述节点加入单元503还用于:第二子网节点将所述历史数据加载至所述子网数据库中。
可选的,还包括:链下获取单元506,用于第二节点设备通过链下方式获取所述历史数据;和/或,链上获取单元507,用于第二子网节点在加入所述区块链子网完成后,从所述区块链子网中的其他子网节点处同步所述历史数据。
可选的,还包括:最新数据同步单元508,用于第二子网节点在加入所述区块链子网完成后,从所述区块链子网中的其他子网节点处同步区别于所述历史数据的最新数据,并加载同步到的所述最新数据。
可选的,所述节点退出单元504还用于:第一子网节点响应于节点迁移事件中记录有第一子网节点的身份信息退出所述区块链子网,所述节点迁移事件由所述主网节点执行所述节点迁移交易产生;或者,所述区块链子网中的各个子网节点分别执行节点退 出交易,以使第一子网节点退出所述区块链子网。
可选的,所述节点退出单元504还用于:第一子网节点断开与所述区块链子网中其他子网节点之间的通信连接。
可选的,还包括:第一删除单元509,用于第一子网节点从自身维护的所述区块链子网的通信列表中删除所述其他子网节点的通信地址;和/或,第二删除单元510,用于所述其他子网节点在自身与第一子网节点之间的网络连接已断开的情况下,从自身维护的所述区块链子网的通信列表中删除第一子网节点的通信地址。
可选的,还包括:关系解除单元511,用于响应于第一子网节点退出所述区块链子网完成,所述区块链主网中的各个主网节点解除对第一子网节点的管理关系。
可选的,第一子网节点被部署于第一节点设备中。
可选的,所述节点迁移交易由下述之一发起:所述区块链主网的管理员、所述区块链子网的管理员、所述区块链主网中任一主网节点对应的节点成员、所述区块链子网中任一子网节点在所述区块链主网中对应的节点成员。
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机,计算机的具体形式可以是个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件收发设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任意几种设备的组合。
在一个典型的配置中,计算机包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带、磁盘存储、量子存储器、基于石墨烯的存储介质或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。
上述对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。
在本说明书一个或多个实施例使用的术语是仅仅出于描述特定实施例的目的,而 非旨在限制本说明书一个或多个实施例。在本说明书一个或多个实施例和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。
应当理解,尽管在本说明书一个或多个实施例可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本说明书一个或多个实施例范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。
以上所述仅为本说明书一个或多个实施例的较佳实施例而已,并不用以限制本说明书一个或多个实施例,凡在本说明书一个或多个实施例的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本说明书一个或多个实施例保护的范围之内。
Claims (17)
- 一种区块链节点的迁移方法,包括:第一节点设备中部署的主网节点通过执行节点迁移交易向第一节点设备透出区块链子网的创世块信息,以由第一节点设备将所述创世块信息发送至第二节点设备,所述主网节点所属的区块链主网用于管理所述区块链子网;第二节点设备根据所述创世块信息生成创世块,并通过加载所述创世块启动第二子网节点;第二子网节点加入所述区块链子网,并加载所述区块链子网中第一子网节点的历史数据;在第二子网节点加载所述历史数据完成的情况下,第一子网节点退出所述区块链子网。
- 根据权利要求1所述的方法,所述主网节点通过执行节点迁移交易向第一节点设备透出区块链子网的创世块信息,包括:主网节点执行节点迁移交易以生成包含区块链子网的创世块信息的节点迁移事件,所述节点迁移事件允许被第一节点设备监听到。
- 根据权利要求2所述的方法,所述节点迁移事件被记录在所述节点迁移交易的收据中,所述第一节点设备将所述创世块信息发送至第二节点设备,包括:第一节点设备从所述收据中获取第二节点设备的网络地址,并按照所述网络地址将所述创世块信息发送至第二节点设备。
- 根据权利要求1所述的方法,所述创世块信息被记录于所述区块链主网的系统合约中,所述主网节点通过执行节点迁移交易向第一节点设备透出区块链子网的创世块信息,包括:所述主网节点在执行节点迁移交易的过程中调用所述系统合约以获取所述创世块信息,并将获取到的所述创世块信息透出至第一节点设备。
- 根据权利要求1所述的方法,所述创世块信息包括所述区块链子网中其他子网节点的身份信息和网络地址,所述第二子网节点加入所述区块链子网,包括:第二子网节点根据所述身份信息和网络地址与所述其他子网节点建立网络连接。
- 根据权利要求1所述的方法,还包括:第二节点设备为第二子网节点指定子网数据库;第二子网节点加载所述历史数据,包括:第二子网节点将所述历史数据加载至所述子网数据库中。
- 根据权利要求1所述的方法,所述子网数据库中保存的所述历史数据被通过下述方式获取:第二节点设备通过链下方式获取所述历史数据;和/或,第二子网节点在加入所述区块链子网完成后,从所述区块链子网中的其他子网节点处同步所述历史数据。
- 根据权利要求1所述的方法,还包括:第二子网节点在加入所述区块链子网完成后,从所述区块链子网中的其他子网节点处同步区别于所述历史数据的最新数据,并加载同步到的所述最新数据。
- 根据权利要求1所述的方法,所述第一子网节点退出所述区块链子网,包括:第一子网节点响应于节点迁移事件中记录有第一子网节点的身份信息退出所述区块链子网,所述节点迁移事件由所述主网节点执行所述节点迁移交易产生;或者,所述区块链子网中的各个子网节点分别执行节点退出交易,以使第一子网节点退出所述区块链子网。
- 根据权利要求1所述的方法,所述第一子网节点退出所述区块链子网,包括:第一子网节点断开与所述区块链子网中其他子网节点之间的通信连接。
- 根据权利要求10所述的方法,还包括:第一子网节点从自身维护的所述区块链子网的通信列表中删除所述其他子网节点的通信地址;和/或,所述其他子网节点在自身与第一子网节点之间的网络连接已断开的情况下,从自身维护的所述区块链子网的通信列表中删除第一子网节点的通信地址。
- 根据权利要求1所述的方法,还包括:响应于第一子网节点退出所述区块链子网完成,所述区块链主网中的各个主网节点解除对第一子网节点的管理关系。
- 根据权利要求1所述的方法,第一子网节点被部署于第一节点设备中。
- 根据权利要求1所述的方法,所述节点迁移交易由下述之一发起:所述区块链主网的管理员、所述区块链子网的管理员、所述区块链主网中任一主网节点对应的节点成员、所述区块链子网中任一子网节点在所述区块链主网中对应的节点成员。
- 一种区块链节点的迁移装置,包括:信息透出单元,用于第一节点设备中部署的主网节点通过执行节点迁移交易向第一节点设备透出区块链子网的创世块信息,以由第一节点设备将所述创世块信息发送至第二节点设备,所述主网节点所属的区块链主网用于管理所述区块链子网;节点启动单元,用于第二节点设备根据所述创世块信息生成创世块,并通过加载所述创世块启动第二子网节点;节点加入单元,用于第二子网节点加入所述区块链子网,并加载所述区块链子网中第一子网节点的历史数据;节点退出单元,用于在第二子网节点加载所述历史数据完成的情况下,第一子网节点退出所述区块链子网。
- 一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器通过运行所述可执行指令以实现如权利要求1至14中任一项所述的方法。
- 一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如权利要求1至14中任一项所述方法的步骤。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210474002.9A CN114866560B (zh) | 2022-04-29 | 2022-04-29 | 区块链节点迁移的方法、装置、电子设备及可读存储介质 |
CN202210474002.9 | 2022-04-29 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2023207077A1 true WO2023207077A1 (zh) | 2023-11-02 |
Family
ID=82635364
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2022/135225 WO2023207077A1 (zh) | 2022-04-29 | 2022-11-30 | 区块链节点的迁移方法及装置 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN114866560B (zh) |
WO (1) | WO2023207077A1 (zh) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114866560B (zh) * | 2022-04-29 | 2023-12-01 | 蚂蚁区块链科技(上海)有限公司 | 区块链节点迁移的方法、装置、电子设备及可读存储介质 |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110058968A (zh) * | 2019-04-17 | 2019-07-26 | 深圳市先河系统技术有限公司 | 去中心化存储的控制方法、系统及相关设备 |
JP6651042B1 (ja) * | 2019-08-28 | 2020-02-19 | 株式会社bitFlyer Blockchain | 複数のノードを有する分散ネットワークに資産の移転を表すトランザクションを記憶する方法及びそのためのプログラム並びに当該分散ネットワークを構成するためのノード |
CN111309711A (zh) * | 2020-03-13 | 2020-06-19 | 财付通支付科技有限公司 | 跨区块链的数据迁移方法、装置、设备及存储介质 |
CN112015517A (zh) * | 2020-08-05 | 2020-12-01 | 北京链飞未来科技有限公司 | 一种基于k8s集群的区块链节点动态迁移方法和系统 |
CN113067896A (zh) * | 2021-06-02 | 2021-07-02 | 支付宝(杭州)信息技术有限公司 | 区块链子网中加入节点的方法和区块链系统 |
WO2022002427A1 (en) * | 2020-06-30 | 2022-01-06 | DFINITY Stiftung | Migration of computational units in distributed networks |
CN114866560A (zh) * | 2022-04-29 | 2022-08-05 | 蚂蚁区块链科技(上海)有限公司 | 区块链节点的迁移方法及装置 |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110351133B (zh) * | 2019-06-28 | 2021-09-17 | 创新先进技术有限公司 | 用于区块链系统中的主节点切换处理的方法及装置 |
WO2021043599A1 (fr) * | 2019-09-02 | 2021-03-11 | Worldline | Migration d'une chaîne de blocs de données |
CN112671881B (zh) * | 2020-12-18 | 2022-09-20 | 成都质数斯达克科技有限公司 | 节点组织管理方法、装置、电子设备及可读存储介质 |
CN113067894B (zh) * | 2021-06-02 | 2021-09-24 | 支付宝(杭州)信息技术有限公司 | 节点退出区块链子网的方法 |
CN113067904B (zh) * | 2021-06-02 | 2021-09-14 | 支付宝(杭州)信息技术有限公司 | 组建区块链子网的方法和区块链系统 |
-
2022
- 2022-04-29 CN CN202210474002.9A patent/CN114866560B/zh active Active
- 2022-11-30 WO PCT/CN2022/135225 patent/WO2023207077A1/zh unknown
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110058968A (zh) * | 2019-04-17 | 2019-07-26 | 深圳市先河系统技术有限公司 | 去中心化存储的控制方法、系统及相关设备 |
JP6651042B1 (ja) * | 2019-08-28 | 2020-02-19 | 株式会社bitFlyer Blockchain | 複数のノードを有する分散ネットワークに資産の移転を表すトランザクションを記憶する方法及びそのためのプログラム並びに当該分散ネットワークを構成するためのノード |
CN111309711A (zh) * | 2020-03-13 | 2020-06-19 | 财付通支付科技有限公司 | 跨区块链的数据迁移方法、装置、设备及存储介质 |
WO2022002427A1 (en) * | 2020-06-30 | 2022-01-06 | DFINITY Stiftung | Migration of computational units in distributed networks |
CN112015517A (zh) * | 2020-08-05 | 2020-12-01 | 北京链飞未来科技有限公司 | 一种基于k8s集群的区块链节点动态迁移方法和系统 |
CN113067896A (zh) * | 2021-06-02 | 2021-07-02 | 支付宝(杭州)信息技术有限公司 | 区块链子网中加入节点的方法和区块链系统 |
CN114866560A (zh) * | 2022-04-29 | 2022-08-05 | 蚂蚁区块链科技(上海)有限公司 | 区块链节点的迁移方法及装置 |
Also Published As
Publication number | Publication date |
---|---|
CN114866560A (zh) | 2022-08-05 |
CN114866560B (zh) | 2023-12-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113067904B (zh) | 组建区块链子网的方法和区块链系统 | |
CN113067894B (zh) | 节点退出区块链子网的方法 | |
CN113259460B (zh) | 跨链交互方法及装置 | |
WO2023124746A1 (zh) | 跨子网交互的权限控制 | |
CN113923232B (zh) | 区块链子网的信息同步方法及装置 | |
CN113067897B (zh) | 跨链交互方法及装置 | |
CN113067895B (zh) | 组建区块链子网的方法和区块链系统 | |
WO2024001022A1 (zh) | 跨子网调用 | |
WO2023050966A1 (zh) | 验证区块链数据 | |
WO2022252996A1 (zh) | 为业务流程合约调度计算服务的方法 | |
WO2023207077A1 (zh) | 区块链节点的迁移方法及装置 | |
CN113259120B (zh) | 同步节点信息列表的方法 | |
CN113067896B (zh) | 区块链子网中加入节点的方法和区块链系统 | |
CN113259464B (zh) | 组建区块链子网的方法和区块链系统 | |
CN113259117B (zh) | 同步节点信息列表的方法 | |
CN113067838B (zh) | 跨链交互方法及装置 | |
CN114363162A (zh) | 区块链日志的生成方法及装置、电子设备、存储介质 | |
WO2023207076A1 (zh) | 区块链子网的组建方法及装置 | |
CN114363335A (zh) | 跨链交互方法及装置 | |
WO2022252993A1 (zh) | 基于链外计算服务的业务执行方法 | |
CN113259462B (zh) | 区块链消息的分发方法及装置 | |
CN114095507B (zh) | 跨链交互方法和区块链系统 | |
CN113259459B (zh) | 区块链子网运行状态的控制方法和区块链系统 | |
CN114880717A (zh) | 数据归档方法及装置 | |
CN114116166B (zh) | 基于智能合约的任务执行方法及装置 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 22939891 Country of ref document: EP Kind code of ref document: A1 |