CN115086338B - Block chain sub-network construction method, device, electronic equipment and computer readable storage medium - Google Patents

Block chain sub-network construction method, device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN115086338B
CN115086338B CN202210473060.XA CN202210473060A CN115086338B CN 115086338 B CN115086338 B CN 115086338B CN 202210473060 A CN202210473060 A CN 202210473060A CN 115086338 B CN115086338 B CN 115086338B
Authority
CN
China
Prior art keywords
blockchain
node
network
main
configuration information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210473060.XA
Other languages
Chinese (zh)
Other versions
CN115086338A (en
Inventor
陶友贤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ant Blockchain Technology Shanghai Co Ltd
Original Assignee
Ant Blockchain Technology Shanghai Co Ltd
Filing date
Publication date
Application filed by Ant Blockchain Technology Shanghai Co Ltd filed Critical Ant Blockchain Technology Shanghai Co Ltd
Priority to CN202210473060.XA priority Critical patent/CN115086338B/en
Publication of CN115086338A publication Critical patent/CN115086338A/en
Priority to PCT/CN2022/135222 priority patent/WO2023207076A1/en
Application granted granted Critical
Publication of CN115086338B publication Critical patent/CN115086338B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

One or more embodiments of the present disclosure provide a method and apparatus for constructing a blockchain subnetwork. The method may include: each block link point in a block chain main network respectively acquires a transaction for constructing a block chain sub-network, wherein the transaction comprises configuration information of the block chain sub-network, and the configuration information comprises identity information of node members participating in constructing the block chain sub-network; each block link point in the block chain main network respectively executes the transaction; when the configuration information comprises identity information of node members corresponding to the first block chain link points, node equipment for deploying the first block chain nodes generates an generation block comprising the configuration information based on the transaction and starts a second block chain node belonging to the block chain sub-network based on the generation block.

Description

Block chain sub-network construction method, device, electronic equipment and computer readable storage medium
Technical Field
The embodiment of the specification belongs to the technical field of block chains, and particularly relates to a method and a device for constructing a block chain subnet.
Background
Blockchain (Blockchain) technology builds on top of transport networks (e.g., point-to-point networks). Network nodes in the transport network utilize the chained data structures to validate and store data and employ distributed node consensus algorithms to generate and update data. All nodes in the same blockchain network are in peer-to-peer status and have completely consistent blockdata. However, node members corresponding to some nodes in the blockchain network sometimes have a need to implement a small-scale transaction to avoid other node members from obtaining the transactions and their related data.
Disclosure of Invention
In view of this, one or more embodiments of the present disclosure provide a method and apparatus for constructing a blockchain subnetwork.
In order to achieve the above object, one or more embodiments of the present disclosure provide the following technical solutions:
according to a first aspect of one or more embodiments of the present disclosure, a method for constructing a blockchain subnetwork is provided, including:
A plurality of main network nodes respectively acquire transactions for constructing a block chain sub-network, wherein the transactions comprise configuration information of the block chain sub-network, the configuration information comprises identity information of node members participating in constructing the block chain sub-network, the plurality of main network nodes belong to at least two block chain main networks, and each main network node belongs to one block chain main network;
the plurality of main network nodes respectively execute the transaction to permeate out the configuration information;
Node devices deployed with the main network node respectively execute: and under the condition that the configuration information comprises the identity information of the node member corresponding to the self-deployed main network node, loading an creation block generated based on the configuration information to start the sub-network node belonging to the block chain sub-network.
According to a second aspect of one or more embodiments of the present disclosure, another method for constructing a blockchain subnetwork is provided, including:
The method comprises the steps that a plurality of node devices respectively acquire configuration information of block chain subnets, main network nodes deployed in the plurality of node devices are attributed to at least two block chain main networks, each main network node is attributed to one block chain main network, and the configuration information comprises identity information of node members participating in building the block chain subnets;
The plurality of node devices respectively perform: and under the condition that the configuration information comprises the identity information of the node member corresponding to the self-deployed main network node, loading an creation block generated based on the configuration information to start the sub-network node belonging to the block chain sub-network.
According to a third aspect of one or more embodiments of the present disclosure, there is provided an apparatus for constructing a blockchain subnetwork, comprising:
A transaction obtaining unit, configured to obtain transactions for building a blockchain subnetwork by using a plurality of main network nodes, where the transactions include configuration information of the blockchain subnetwork, the configuration information includes identity information of node members participating in building the blockchain subnetwork, and the plurality of main network nodes belong to at least two blockchain main networks, where each main network node belongs to one blockchain main network;
the transaction execution unit is used for respectively executing the transactions by the plurality of main network nodes so as to permeate out the configuration information;
the node starting unit is used for respectively executing the node equipment deployed with the main network node: and under the condition that the configuration information comprises the identity information of the node member corresponding to the self-deployed main network node, loading an creation block generated based on the configuration information to start the sub-network node belonging to the block chain sub-network.
According to a fourth aspect of one or more embodiments of the present disclosure, there is provided another apparatus for constructing a blockchain subnetwork, comprising:
The information acquisition unit is used for respectively acquiring configuration information of the block chain subnets by a plurality of node devices, wherein the main network nodes deployed in the plurality of node devices are attributed to at least two block chain main networks, each main network node is attributed to one block chain main network, and the configuration information comprises identity information of node members participating in constructing the block chain subnets;
A node starting unit, configured to perform: and under the condition that the configuration information comprises the identity information of the node member corresponding to the self-deployed main network node, loading an creation block generated based on the configuration information to start the sub-network node belonging to the block chain sub-network.
According to a fifth aspect of one or more embodiments of the present specification, there is provided an electronic device, comprising:
A processor;
a memory for storing processor-executable instructions;
wherein the processor implements the method of any of the first aspects by executing the executable instructions.
According to a sixth aspect of one or more embodiments of the present description, a computer-readable storage medium is presented, having stored thereon computer instructions which, when executed by a processor, implement the steps of the method according to any of the first aspects.
With the above embodiments, for a plurality of blockchain main networks, at least one main network node in each blockchain main network may together with at least one main network node in other blockchain main networks form a blockchain sub-network, i.e. a blockchain sub-network crossing the main network is formed based on the blockchain main networks. Since the blockchain subnetwork is independent of the respective blockchain subnetwork, transactions conducted in the subnetwork and their associated data are not available to other node members in the subnetwork. It can be seen that the newly constructed blockchain subnetwork can meet the requirements of small-scale transactions among the various node members participating in constructing the subnetwork.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings that are needed in the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments described in the present disclosure, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of creating a smart contract provided by an exemplary embodiment.
FIG. 2 is a schematic diagram of a call to a smart contract provided by an exemplary embodiment.
FIG. 3 is a schematic diagram of creating and invoking a smart contract provided by an exemplary embodiment.
Fig. 4 is a flowchart of a method for constructing a blockchain subnet, in accordance with an exemplary embodiment.
Fig. 5 is a schematic diagram of a block chain subnetwork based on multiple block chain main networks according to an exemplary embodiment.
Fig. 6 is a flowchart of another method for constructing a blockchain subnetwork according to an exemplary embodiment.
Fig. 7 is a schematic diagram of an apparatus according to an exemplary embodiment.
Fig. 8 is a block diagram of an apparatus for constructing a blockchain subnet, according to an exemplary embodiment.
Fig. 9 is a block diagram of another block chain subnetwork building device, in accordance with an exemplary embodiment.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of the present specification. Rather, they are merely examples of apparatus and methods consistent with aspects of one or more embodiments of the present description as detailed in the accompanying claims.
It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the method may include more or fewer steps than described in this specification. Furthermore, individual steps described in this specification, in other embodiments, may be described as being split into multiple steps; while various steps described in this specification may be combined into a single step in other embodiments.
Blockchains are generally divided into three types: public chain (Public Blockchain), private chain (Private Blockchain) and federated chain (Consortium Blockchain). In addition, there are many types of combinations, such as different combinations of private chain+federation chain, federation chain+public chain, and the like. Among them, the highest degree of decentralization is the public chain. Participants joining the public chain may read data records on the chain, participate in transactions, compete for billing rights for new blocks, and so forth. Moreover, each participant (i.e., node) is free to join and leave the network and perform related operations. The private chain is the opposite, the write rights of the network are controlled by an organization or organization, and the data read rights are specified by the organization. In short, the private chain may be a weakly centralized system with few and strict restrictions on participating nodes. This type of blockchain is more suitable for use within a particular organization. The alliance chain is a block chain between public and private chains, and can realize 'partial decentralization'. Each node in the federation chain typically has an entity organization or organization corresponding thereto; participants join the network by authorization and form a benefit-related federation, collectively maintaining blockchain operation.
Whether public, private, or federation, it is possible to provide the functionality of a smart contract. Intelligent contracts on blockchains are contracts on blockchain systems that can be executed by transaction triggers. The smart contracts may be defined in the form of codes.
Taking the ethernet as an example, a user is supported to create and invoke some complex logic in the ethernet network. At the heart of the ethernet as a programmable blockchain is an Ethernet Virtual Machine (EVM), which can be run by each ethernet node. The EVM is a graphics-complete virtual machine, meaning that various complex logic can be implemented by it. The user's issuing and invoking of the smart contract in the ethernet is running on the EVM. In practice, the virtual machine runs directly on virtual machine code (virtual machine bytecode, hereinafter "bytecode"). The intelligent contracts deployed on the blockchain may be in the form of bytecodes.
For example, as shown in fig. 1, bob sends a transaction containing information to create a smart contract to the ethernet network, the EVM of node 1 may execute the transaction and generate the corresponding contract instance. "0x6f8ae93 …" in fig. 1 represents the address of this contract, the data field of the transaction may hold byte code, and the to field of the transaction is empty. After agreement is reached between nodes through the consensus mechanism, this contract is successfully created and can be invoked in a subsequent process. After the contract is created, a contract account corresponding to the intelligent contract appears on the blockchain, and the contract account is stored with a specific address. The behavior of the smart contract is controlled by the contract code. In other words, the smart contract causes a virtual account to be generated on the blockchain that includes a contract code and an account store (Storage).
Still taking the ethernet as an example, as shown in fig. 2, bob sends a transaction for invoking a smart contract to the ethernet network, the EVM of a node may execute the transaction and generate the corresponding contract instance. The from field of the transaction in FIG. 2 is the address of the account of the transaction initiator (i.e., bob), the "0x6f8ae93 …" in the to field represents the address of the called smart contract, the value field may be the value of the digital asset in the ethernet, and the data field of the transaction holds the method and parameters for calling the smart contract. The value of the policy may change after invoking the smart contract. Subsequently, a client may view the current value of the policy through a blockchain node (e.g., node 6 in FIG. 2). The intelligent contract is independently executed at each node in the blockchain network in a specified mode, all execution records and data are stored on the blockchain, so that when the transaction is completed, transaction credentials which cannot be tampered and cannot be lost are stored on the blockchain.
A schematic diagram of creating a smart contract and invoking a smart contract is shown in fig. 3. To create an intelligent contract in the ethernet, the intelligent contract needs to be written, changed into byte codes, deployed to a blockchain and the like. The intelligent contract is called in the Ethernet, a transaction pointing to the intelligent contract address is initiated, and intelligent contract codes are distributed and run in the virtual machine of each node in the Ethernet network.
It should be noted that, in addition to the smart contracts that can be created by the user, the smart contracts can also be set by the system in the creation block. Such contracts are commonly referred to as an opening contract. In general, some blockchain networks may be configured with data structures, parameters, attributes, and methods in the creating contracts. In addition, an account with system administrator rights may create a system level contract, or modify a system level contract (simply referred to as a system contract). In addition, different blockchain networks may employ various virtual machines in addition to the EVM in the ethernet, which is not limited herein.
After executing the transaction invoking the smart contract, the node in the blockchain network generates a corresponding receipt (receipt) for recording information related to executing the smart contract. In this way, information about the result of contract execution can be obtained by querying the receipt of the transaction. The contract execution result may be represented as an event (event) in a receipt. The messaging mechanism may implement messaging through events in the receipt to trigger the blockchain node to perform the corresponding process. The structure of the event may be, for example:
Event:
[topic][data]
[topic][data]
......
In the above examples, the number of events may be one or more; wherein each event includes fields such as a theme (topic) and data (data), respectively. The block link point may perform a preset process by listening to the topic of the event, in case of listening to the predefined topic, or read the related content from the data field of the corresponding event, and may perform the preset process based on the read content.
Blockchain technology differs from one of the decentralized features of conventional technology in that accounting is performed on individual nodes, otherwise known as distributed accounting, rather than conventional centralized accounting. The blockchain system is to be a hard-to-break, public, untampered, decentralised, honest and trusted system for data records, and needs to be secure, clear and irreversible for distributed data records in as short a time as possible. In different types of blockchain networks, in order to keep account books consistent among the nodes of each record account book, a consensus algorithm is generally adopted to ensure that the above-mentioned consensus mechanism is adopted. After a node (e.g., a unique node) creates a block, if the created block is approved by other nodes, the other nodes record the same block. The process that the generated block is approved by other nodes is a consensus mechanism. The consensus mechanism is a mechanism that the blockchain node achieves the consensus of the whole network about the blockinformation (or blockdata), and can ensure that the latest block is accurately added to the blockchain. The consensus mechanisms of the current mainstream include: proof of Work (POW), proof of equity (POS), proof of commission (DELEGATED PROOF OF STAKE, DPOS), practical bayer fault tolerance (PRACTICAL BYZANTINE FAULT TOLERANCE, PBFT) algorithms, honeyBadgerBFT algorithms, and the like.
Because of the decentralization characteristic of the blockchain network, all blockchain nodes in the blockchain network can maintain the same block data, and the special requirements of part of nodes cannot be met. Taking a blockchain as an example, all the coalition members (i.e., node members in the coalition) can form a blockchain network, all the coalition members respectively have corresponding blockchain nodes in the blockchain network, and all transactions and related data occurring on the blockchain network can be obtained through the corresponding blockchain nodes. In some cases, however, there may be some coalition members in different blockchain networks that wish to complete transactions with security requirements, which are both able to be authenticated on the blockchain or by virtue of other advantages of blockchain technology, and able to avoid viewing the transactions and related data by other coalition members in the blockchain network in which they are located. Although the members of the federation may additionally build a new blockchain network in a manner similar to that described above that includes all of the members of the federation, building a new blockchain network from scratch requires significant resources and is time consuming, either in the process of building the blockchain network or in the process of post-build configuration. The requirements among the alliance members are often temporary or have certain timeliness, so that the new blockchain network quickly loses the meaning of existence due to the disappearance of the requirements, thereby further increasing the chain building cost of the blockchain network. The requirements between the members of the federation often vary, and the members of the federation corresponding to each requirement also often vary, so that a new blockchain network may need to be built whenever the members of the federation change, resulting in a great waste of resources and time.
The present description may use the established plurality of blockchain networks as a blockchain master network and establish blockchain subnets based on the plurality of blockchain master networks. Then, in a federated chain scenario such as that described above, federated members may, having participated in the blockchain master network, build the required blockchain subnetwork based on their own needs based on the blockchain master network they are participating in. Because the blockchain subnetwork is built on the basis of the blockchain main network, compared with a completely independent blockchain network, the building process of the blockchain subnetwork has the advantages of greatly reduced consumed resources, time consumption and the like, and extremely high flexibility. The construction scheme of the blockchain subnetwork of the present description is described below with reference to fig. 4.
Referring to fig. 4, fig. 4 is a flowchart of a method for constructing a blockchain subnet according to an exemplary embodiment. As shown in fig. 4, the method applied to the blockchain node may include the steps of:
in step 402, a plurality of main network nodes respectively acquire a transaction for constructing a blockchain sub-network, wherein the transaction comprises configuration information of the blockchain sub-network, the configuration information comprises identity information of node members participating in constructing the blockchain sub-network, and the plurality of main network nodes belong to at least two blockchain main networks.
It will be appreciated that any one of the master network nodes is assigned to a corresponding blockchain master network, and that each of the master network nodes described in the embodiments of the present disclosure is assigned to at least two blockchain master networks. Therefore, n main network nodes participating in building the blockchain sub-network belong to m blockchain main networks, wherein n is more than or equal to m is more than or equal to 2, and n and m are both positive integers. As shown in fig. 5, there are three blockchain main networks mainnet, mainnet, and mainnet3, where the main network nodes nodeA in mainnet1 and nodeH in nodeB, mainnet2 and nodeM in mainnet are the main network nodes participating in the construction of the blockchain sub-network subnet1, where n=4, m=3. It can be seen that the "at least two blockchain main networks" described in this scheme is "a plurality of blockchain main networks", hereinafter referred to as a plurality of blockchain main networks. Moreover, at least one main network node exists in any blockchain main network to participate in constructing the blockchain sub-network.
As described above, for any blockchain main network, a transaction for constructing a blockchain sub-network can be initiated by an administrator of the main network, that is, only the administrator is allowed to construct the blockchain sub-network based on the main network and other main networks, so as to avoid opening the construction authority of the blockchain sub-network to the common users, thereby preventing the security problem caused by the construction authority. In some cases, the common user of the main network can be allowed to initiate the transaction for constructing the blockchain sub-network, so as to meet the networking requirement of the common user, and the common user can still quickly construct the blockchain sub-network under the condition that the manager is inconvenient to initiate the transaction.
For example, as shown in fig. 5, the blockchain main network mainnet includes the main network nodes nodeA, nodeB, nodeC, nodeD and nodeE, the blockchain main network mainnet includes the main network node nodeF, nodeG, nodeH, nodeI, and the blockchain main network mainnet3 includes the main network node nodeJ, nodeK, nodeL, nodeM. Assume nodeA, nodeB, nodeH and nodeM, respectively, that the corresponding node members wish to build a blockchain subnetwork: if nodeA is the administrator of mainnet1 and only the administrator is allowed to initiate transactions to build the blockchain subnetwork, then the above-described transactions to build the blockchain subnetwork may be initiated by nodeA to mainnet 1; if nodeF is an administrator and only the administrator is allowed to initiate transactions to build the blockchain sub-network, then nodeG-nodeI need to request nodeF for nodeF to initiate mainnet2 the above-described transactions to build the blockchain sub-network; if nodeJ is an administrator but allows a common user to initiate transactions to build a blockchain subnet, then nodeK-nodeM can each initiate mainnet transactions to build a blockchain subnet as described above. Of course, the node members corresponding to the blockchain nodes that initiate transactions for building blockchain subnets, whether by an administrator or an average user, do not necessarily participate in the built blockchain subnets, such as, although eventually the blockchain subnets are built by the node members corresponding to nodeA, nodeB, nodeH and nodeM, respectively, the transactions for building blockchain subnets described above may be initiated by nodeE to mainnet1, rather than by nodeA or nodeB to mainnet1, nodeH to mainnet2, and/or nodeM to mainnet 3.
When a blockchain subnetwork is built based on a plurality of blockchain subnetworks, it will be readily appreciated that a logical hierarchical relationship exists between the blockchain subnetwork and the plurality of blockchain subnetworks. For example, when constructing blockchain subnetwork 1 based on mainnet1, mainnet2 and mainnet3 shown in fig. 5, mainnet1, mainnet2 and mainnet3 can be considered to be at the first layer and subnetwork 1 at the second layer. Then, any of the blockchain masters in this specification may be an underlying blockchain network that is not a blockchain subnetwork built on the basis of other blockchain networks, such as mainnet in fig. 5, may be considered a blockchain master of the underlying blockchain network type. Of course, any blockchain main network may be a sub-network of other blockchain networks, for example, a next-level blockchain sub-network (such as a subnet 1.1) may be further constructed based on the subnet1 and other sub-networks in fig. 5, where the subnet1 may be considered as the blockchain main network corresponding to the blockchain sub-network, and this does not affect the subnet1 to belong to the blockchain sub-networks corresponding to mainnet, mainnet2 and mainnet at the same time. It can be seen that the blockchain master network and the blockchain subnetwork are actually relative concepts, and that the same blockchain network may be a blockchain master network in some cases and a blockchain subnetwork in other cases.
Each of the plurality of blockchain main networks may obtain the transaction, and the present description describes each main network node participating in building a blockchain sub-network as an example. Taking any one of the main network nodes in any one of the blockchain main networks as an example: in one embodiment, the transaction acquired by the node may be initiated in the main network by an administrator or a general user of either blockchain main network. Taking an administrator as an example, the administrator of each blockchain main network may negotiate in advance to decide to construct a blockchain sub-network, and then each administrator may initiate the transaction in the corresponding main network, so as to obtain the main network nodes in the main network participating in constructing the blockchain sub-network. In this manner, transactions that constitute blockchain subnets may be initiated in the respective main networks by the participants (e.g., administrators or general users) corresponding to the respective blockchain main networks, respectively.
In another embodiment, the transaction acquired by the node may also be initiated in another blockchain master network by an administrator or a general user of the other blockchain master network and synchronized to either blockchain master network by the other blockchain master network. Still taking an administrator as an example, the administrator of one of the multiple blockchain subnets may initiate the transaction in the main network, and the main network synchronizes the transaction to other respective main networks, so as to obtain the main network nodes participating in the block chain subnets in the other respective main networks. The transaction synchronization between the certain main network and other main networks can be realized by any cross-link interaction technology, which is not limited in this specification. Based on the transaction synchronization mechanism among the block chain main networks, the method only needs a participant corresponding to any block chain main network to initiate the transaction for constructing the block chain sub-network in the main network, other block chain sub-networks and main network nodes in the block chain sub-networks can acquire the transaction, and the participant or the participants of other main networks do not need to repeatedly initiate the transaction in other main networks, thereby being beneficial to simplifying the initiating flow of the transaction and improving the construction efficiency of the block chain sub-network to a certain extent.
For the scheme that any one of the blockchain main networks synchronizes the transaction from another blockchain main network, the main network node of the other blockchain main network can maintain a node list of the main network nodes of the any one of the blockchain main networks, wherein the list is used for recording node identification, identity information, communication address and other node information of each main network node in the any one of the blockchain main networks. Based on the list, the master network node of the other blockchain master network may synchronize the transaction to the any blockchain master network in a number of ways. The main network node may be any node in the other blockchain main network, or may also be a specific node therein, such as a management node, a central node, or a certain node designated by the transaction of the main network.
In one embodiment, the transaction may include a master network identifier of the blockchain master network to which each master network node participating in the creation of the blockchain subnetwork belongs, and the master network node may determine which blockchain master networks the transaction should be synchronized to based on the master network identifier included in the transaction. Taking fig. 5 as an example, assuming that the administrator of mainnet1 initiates a transaction in the main network that constitutes a blockchain subnetwork, the main network node nodeD in mainnet1 may synchronize the transaction to mainnet2 if the main network identification of mainnet2 is included in the transaction. Specifically, nodeD may determine, according to the node list of mainnet2, a node of nodeF to nodeI that has a network connection established with itself, such as nodeI, and may send the transaction to nodeI through the network connection, so that nodeI synchronizes the received transaction to other nodes of mainnet (i.e. nodeF to nodeH), or only to nodes that need to participate in building a blockchain subnet (i.e. nodeH). mainnet1 to mainnet are similar to the process of synchronizing the transactions, and are not repeated. In this way, the other blockchain master network may quickly synchronize the transaction to the blockchain master network to which other master network nodes participating in the building of the blockchain subnetwork belong based on the master network identification.
In another embodiment, the transaction may also include identity information (e.g., public key, etc.) of each of the master network nodes participating in the formation of the blockchain subnetwork, at which point the master network node may determine which master network nodes the transaction should be synchronized to based on the identity information included in the transaction. Still taking fig. 5 as an example, assuming that the administrator of mainnet initiates a transaction in the main network that constitutes a blockchain subnetwork, the main network node nodeD in mainnet1 may synchronize the transaction to nodeM if the public key of node nodeM in mainnet3 is included in the transaction. Specifically, nodeD may determine nodeM from nodeJ to nodeM according to the node list of mainnet3, and further, in the case that a network connection is established between nodeD and nodeM, may directly send the transaction to nodeM; in the event that the network connection is not established, the node of nodeJ-nodeL that has established a network connection with itself, such as nodeJ, may be determined and the transaction may be sent to nodeJ over the network connection to send the received transaction to nodeM by nodeJ. In this way, the other blockchain main network can pointedly and directly synchronize the transaction to other main network nodes participating in the construction of the blockchain sub-network based on the identity information of the main network nodes, so that the synchronization efficiency of the transaction is further improved.
The master network node of another block chain master network can acquire the node list of the master network node of any block chain master network in one of the following modes. For example, the list may be obtained from any of the blockchain home networks. As another example, any of the blockchain master networks described in this scenario may be a separate blockchain network, or may be a subnetwork of other blockchain networks, i.e., the blockchain network may have a parent blockchain network. And in the case that the any blockchain main network and the other blockchain main network are managed by the same parent blockchain network, the main network node of the other blockchain main network can also acquire the node list from the parent blockchain network. For the two acquisition modes, the main network node can be acquired in advance according to a fixed period or respond to the transaction acquisition, and can also be updated according to a change notification sent by any blockchain main network after the self node is changed, or updated according to a change notification sent by the father-level blockchain network after the node of any blockchain main network is determined to be changed, and the details are not repeated. By the method, the main network node of the other block chain main network can automatically update the node list. As another example, an administrator or an average user of the other blockchain home network may submit the list to the home network node if the list is acquired (e.g., acquired in an under-chain manner) to the node. For example, a list update transaction may be initiated in the primary network to in turn the primary network node perform the transaction record the list. In this manner, an administrator or an average user of the other blockchain master network may manually maintain (e.g., record or update) a list of nodes of each master network node in the any blockchain master network for use in cross-chain interactions between the other blockchain master network and the any blockchain network, such as synchronizing the transactions.
At step 404, the plurality of home network nodes respectively execute the transaction to permeate the configuration information.
Step 406, node devices deployed with the main network node respectively execute: and under the condition that the configuration information comprises the identity information of the node member corresponding to the self-deployed main network node, loading an creation block generated based on the configuration information to start the sub-network node belonging to the block chain sub-network.
After the transaction for constructing the block chain sub-network is sent to any block chain main network, the common node in the block chain main network performs common identification, and after the common identification is passed, each block chain link point executes the transaction so as to complete the construction of the block chain sub-network. The consensus process depends on the consensus mechanism employed, such as any of the consensus mechanisms described above, which is not limiting in this description.
By including configuration information in the transactions for constructing the blockchain sub-network, the configuration information may be used to configure the constructed blockchain sub-network so that the constructed blockchain sub-network meets networking requirements. For example, by including in the configuration information identity information of the node members participating in the construction of the blockchain subnetwork, it is possible to specify which node members the constructed blockchain subnetwork corresponds to.
The identity information of the node member may include a public key, or other information capable of characterizing the identity of the node member, such as a node ID, which is not limited in this specification. Taking a public key as an example, each main network node has one or more public and private key pairs, the main network node holds the private key, and the public key is disclosed and uniquely corresponds to the private key, so that the identity of the corresponding main network node can be represented by the public key, and the identity of the node member corresponding to the main network node can also be represented by the public key. Thus, for node members desiring to join a blockchain subnetwork, the public keys of the corresponding blockchain nodes on the blockchain main network for those node members may be added to the transactions that constitute the blockchain subnetwork as identity information for those node members.
In the case that a transaction that constitutes a blockchain subnetwork is acquired, the master network node may execute the transaction to pass through the configuration information to the node device in which it is located. The configuration information may be transmitted through an event mechanism, and a specific transmission manner may be referred to the following embodiments, which are not described herein.
As described above, for any one of the plurality of blockchain subnets, it includes at least one main network node that participates in building a blockchain subnet, and of course, it is also possible for the main network to include a main network node that does not participate in building a subnet (i.e., some main network nodes in the main network participate in building a subnet). In this regard, to distinguish between the two types of master nodes, a master node of the plurality of blockchain master networks that participates in forming a subnet may be referred to as a networking master node (i.e., the plurality of master nodes described in steps 402-406), while the remaining master nodes that do not participate in forming a subnet may be referred to as non-networking master nodes. As shown in fig. 5, nodes nodeA in mainnet and nodeH in nodeB, mainnet2 and nodeM in mainnet are networking master nodes, while other nodes mainnet 1-mainnet 3 are non-networking master nodes. The following description is directed to the process of a networking master node participating in the construction of a blockchain master network.
The networking master node may be a blockchain node on the blockchain master network corresponding to the node member indicated by the configuration information. When constructing a blockchain subnetwork, instead of directly joining the blockchain subnetwork by a networking master node, it is necessary to generate a corresponding subnetwork node by the node device used to deploy the node and join the blockchain subnetwork by the subnetwork node. The networking master node and the corresponding subnet nodes correspond to the same node member, for example, the networking master node belongs to a blockchain master network and the subnet nodes belong to a blockchain subnet under the scene of a alliance chain, so that the node members can respectively participate in transactions of the blockchain master network and the blockchain subnet; and because the block chain main network and the block chain sub network belong to two independent block chain networks, the blocks generated by the block chain main network and the blocks generated by the sub network nodes are respectively stored in different storages (the adopted storages can be databases for example) on the node equipment, so that the mutual isolation between the storages respectively used by the block chain main network and the sub network nodes is realized, the data generated by the block chain sub network can only be synchronized among the sub network nodes in the block chain sub network, the data generated on the block chain sub network can not be obtained by the node members only participating in the block chain main network, the data isolation between the block chain main network and the block chain sub network is realized, and the transaction requirement between part of the node members (namely the node members participating in the block chain sub network) is met.
The networking master node and the subnet node are logically divided blockchain nodes, and from the aspect of physical equipment, the node equipment which is equivalent to the networking master node and the subnet node is arranged to participate in the blockchain master network and the blockchain subnet at the same time. Because the blockchain main network and the blockchain sub network are mutually independent, the identity systems of the two blockchain networks are mutually independent, and even if the networking main node and the sub network node can adopt the identical public key, the networking main node and the sub network node still can be regarded as different blockchain nodes. For example, in fig. 5, the nodeA in mainnet corresponds to the network master node, and the node device deploying the nodeA generates nodeA1 belonging to subnet1, and the nodeA1 corresponds to the subnet node. Therefore, the identity systems are mutually independent, so that even if the public key adopted by the subnet node is different from the networking master node, the implementation of the scheme of the specification is not affected.
Of course, the node members participating in the blockchain subnetwork are not necessarily only part of the node members participating in the blockchain main network. In some cases, node members participating in the blockchain subnetwork may be completely identical to node members participating in the blockchain subnetwork, where all node members may obtain data on the blockchain subnetwork and the blockchain subnetwork, but the data generated by the blockchain subnetwork and the blockchain subnetwork may still be isolated from each other, for example, one type of service may be implemented on the blockchain subnetwork, and another type of service may be implemented on the blockchain subnetwork, so that service data generated by the two types of services may be isolated from each other. For example, for the multiple blockchain home networks mainnet, mainnet, and mainnet3 shown in fig. 5, all nodes in at least one blockchain home network may participate in building the subnet1. Taking the example that all nodes nodeA-nodeE in mainnet1 participate in the construction of subnet1, the node members corresponding to nodeA 1-nodeE 1 in subnet1 are completely identical to the node members corresponding to nodeA-nodeE in mainnet.
In addition to the identity information of the node members described above, the configuration information may include at least one of: the network identification of the blockchain subnetwork, identity information of an administrator of the blockchain subnetwork, attribute configuration for blockchain platform code, and the like, are not limiting in this description. The network identification is used to uniquely characterize the blockchain subnetwork, and thus the network identification of the blockchain subnetwork should be distinguished from the plurality of blockchain subnetworks and other blockchain subnetworks that are built up on the respective blockchain subnetwork. The identity information of the administrator of the blockchain subnetwork, such as a public key that is a member of the node of the administrator; wherein an administrator of the blockchain subnetwork may be the same as an administrator of at least one of the blockchain main networks; or the administrator of the blockchain subnetwork may be different from the administrator of each blockchain main network.
One of the advantages of constructing the blockchain subnetwork through the blockchain main network is that the networking main node is already deployed on the node equipment for generating the subnetwork node, so that the blockchain platform code used by the networking main node can be multiplexed on the subnetwork node, repeated deployment of the blockchain platform code is avoided, and the construction efficiency of the blockchain subnetwork is greatly improved. If the configuration information does not contain the attribute configuration for the blockchain platform code, the subnet node can multiplex the attribute configuration adopted on any group of network master nodes, such as the attribute configuration of a management node or a master node of the blockchain subnet; if the configuration information contains attribute configuration aiming at the blockchain platform code, the subnet node can adopt the attribute configuration, so that the attribute configuration adopted by the subnet node is not limited by the attribute configuration of the networking master node and is irrelevant to the networking master node. The attribute configuration for the blockchain platform code may include at least one of: code version number, whether consensus is required, consensus algorithm type, block size, etc., which is not limiting in this description.
The transactions that constitute the blockchain subnetwork may include transactions that invoke contracts. The transaction may specify the address of the smart contract that was invoked, the method that was invoked, and the parameters that were entered. For example, the invoked contract may be the aforementioned creation contract or system contract, the invoked method may be a method of building a blockchain subnet, and the incoming parameters may include the configuration information described above. In one embodiment, the transaction may contain the following information:
from:Administrator
to:Subnet
method:AddSubnet(string)
string:genesis
Wherein the from field is information of the initiator of the transaction, such as Administrator indicating that the initiator is an administrator; the to field is the address of the called smart contract, e.g., the smart contract may be a Subnet contract, and the to field is specifically the address of the Subnet contract; the method field is a called method, for example, the method for constructing a blockchain Subnet in a Subnet contract may be AddSubnet (string), and string is a parameter in AddSubnet () method, and the value of the parameter is represented by generation in the above example, and the generation is specifically the configuration information described above.
Take the example of nodes nodeA-nodeE on mainnet1 executing a transaction that invokes the AddSubnet () method in the Subnet contract. After the transaction passes the consensus, the nodeA-nodeE respectively execute AddSubnet () method and transmit configuration information to obtain corresponding execution results.
The execution result of the contract may include the configuration information. The execution result of the contract may include the receipt described previously, which may include an event, i.e., a networking event, associated with executing the AddSubnet () method. Topic of networking events may contain predefined networking event identifications to distinguish from other events. For example, in an event associated with executing the AddSubnet () method, the content of the topic is the keyword subnet, and the keyword is distinguished from topic in the event generated by other methods. Then, the node apparatuses 1 to 5 of the nodeA to nodeE or the deployment nodeA to nodeE can determine to monitor the event related to execution of the AddSubnet () method, that is, the networking event, in the case of monitoring the topic including the keyword subnet by monitoring the topic included in each event in the generated receipt. For example, the event in the receipt is as follows:
Event:
[topic:other][data]
[topic:subnet][data]
......
Then, when the 1 st event is monitored, since the content of the contained topic is other, it is determined that the event is irrelevant to the AddSubnet () method; and when the 2 nd event is monitored, determining that the event is related to AddSubnet () method because the content of the topic is subnet, and further reading a data field corresponding to the event, wherein the data field contains the configuration information. Taking the example that the configuration information includes the public key of the node member of the blockchain subnet, the content of the data field may include, for example:
{subnet1;
a public key of nodeA, IP of nodeA, port number … of nodeA;
public key of nodeB, IP of nodeB, port number … of nodeB;
nodeC public key, IP of nodeC, port number … of nodeC;
nodeD public key, IP of nodeD, port number … of nodeD;
}
Wherein, subnet1 is the network identification of the blockchain subnet that it is desired to create. Each blockchain node in the blockchain master network may record network identifications of all blockchain subnets that have been created on the blockchain master network, or other information related to the blockchain subnets, which may be maintained in a Subnet contract as described above, for example, and may specifically correspond to the value of one or more contract states contained in the Subnet contract. Then, it may be determined whether the subnet1 already exists according to the recorded network identifications of all the created blockchain subnets: if the network identification does not exist, the subnet1 is a new block chain subnet which needs to be created currently, and if the network identification exists, the subnet1 is already existing.
In addition to employing network identifications of new blockchain subnets that are desired to be created, predefined new network identifications may also be employed that indicate corresponding networking events for building new blockchain subnets. For example, the subnet1 may be replaced by newsubnet, where newsubnet is a predefined newly created network identifier, and when it is identified that the data field contains newsubnet, the nodes a-nodeE can determine that the event containing newsubnet is a networking event, and a new blockchain subnet needs to be created.
In addition to the network identifier subnet1, the data field also contains identity information of each node member participating in the construction of the blockchain subnet. The node equipment deployed with the main network node can acquire the configuration information through a message mechanism. For example, the main network node may monitor the generated receipt, and trigger the node device where the main network node is located to acquire the creation block or the configuration information included in the networking event when the monitored content of the networking event records the identity information of the node member corresponding to the main network node. For another example, the node device deploying the networking master node may monitor the generated receipt, and acquire the creation block or the configuration information included in the networking event when the monitored content of the networking event indicates that the networking master node belongs to the node member.
As previously described, the node device may directly monitor the receipt. Assuming that the nodes a to nodeM are respectively disposed on the node devices 1 to 13, the node devices 1 to 13 can monitor receipts respectively generated by the nodes a to nodeM, and if the subnet1 is a block chain subnet which needs to be newly constructed, the node devices 1 to M further identify identity information of node members contained in the data field to determine their own processing modes. Taking nodeA and node device 1 as examples: if the node device 1 finds that the data field contains identity information such as a public key, an IP address, a port number, and the like of the nodeA, the node device 1 may generate an creation block according to the configuration information and start a subnet node nodeA1 belonging to the blockchain subnet by loading the creation block when obtaining the configuration information from the data field based on the above-described message mechanism; similarly, node device 2 may generate nodeB1, node device 8 may generate nodeH1, and node device 13 may generate nodeM1. And the node device 3 finds that the identity information contained in the data field is not matched with the identity information, so that the node device 3 does not generate an creation block according to the configuration information in the data field and does not generate a blockchain node in the subnet 1.
As described above, the master network node in the blockchain master network may monitor the receipt and trigger the node device to perform related processing according to the monitoring result. For example, if it is determined that subnet1 is a blockchain subnet that needs to be newly constructed, nodeA-nodeM further identifies the identity information of the node member contained in the data field to determine its own processing mode. For example, nodeA, nodeB, nodeH and nodeM find that the data field contains identity information such as its own public key, IP address and port number, and assume that nodeA, nodeB, nodeH and nodeM are deployed on node devices 1-2, 8 and 13, respectively, for example, nodeA and 1: the nodeA triggers the node equipment 1, so that the node equipment 1 can generate an creation block according to the configuration information under the condition that the node equipment 1 obtains the configuration information from the data field based on the message mechanism, and start the subnet node nodeA1 belonging to the block chain subnet by loading the creation block; similarly, nodeB would trigger node device 2 to generate nodeB1, nodeH would trigger node device 8 to generate nodeC1, nodeM would trigger node device 13 to generate nodeM1. And nodeC finds that the identity information contained in the data field does not match with the identity information, and assuming that nodeC is deployed on the node device 3, the node device 3 does not generate an creation block according to the configuration information in the data field, and does not generate a blockchain node in the subnet 1.
As described above, the networking master node participating in the construction of the blockchain subnetwork and the subnetwork nodes included in the blockchain subnetwork do not necessarily use the same identity information. Thus, in the above embodiment, the identity information generated in advance for nodeA1, nodeB1, nodeH1, and nodeM1 may be contained in the data field, and distinguished from the identity information of nodeA, nodeB, nodeH and nodeM. Still taking nodeA and node device 1 as examples: the node device 1 can generate and load an creation block to start nodeA1 if the identity information of nodeA1 is found in the data field; or nodeA if the identity information of nodeA1 is found in the data field, nodeA triggers the node device 1 to generate and load an creation block start nodeA1. The processing manners of other blockchain nodes or node devices are similar and are not described in detail herein.
In addition to the configuration information, the execution result of the contract may also include an creation block. In other words, in addition to the configuration information may be included in the data field, the generation block including the configuration information may be directly generated in the process of executing the contract call, so that the generation block is included in the data field, and for nodeA, nodeB, nodeH and nodeM described above, the corresponding node devices 1-2, 8 and 13 may directly obtain the generation block from the data field through the message mechanism without self-generation, and may improve the deployment efficiency for nodeA1, nodeB1, nodeH1 and nodeM 1.
In the present specification, the transaction for constructing the blockchain subnetwork may not be a transaction for calling the intelligent contract, so that the blockchain network that does not support the intelligent contract may also implement the technical solution of the present specification, thereby quickly creating the blockchain subnetwork based on a plurality of blockchain main networks. For example, a set of networking transaction type identifiers may be predefined, and when a transaction includes the networking transaction type identifier, the transaction is indicated as being for building a new blockchain subnet, i.e., the transaction is a transaction that builds a blockchain subnet. The blockchain platform code may include related processing logic for constructing a blockchain subnetwork, so that when a main network node running the blockchain platform code executes a transaction, if the transaction includes the networking transaction type identifier, and identity information of a node member corresponding to the main network node is included in configuration information in the transaction, node equipment deploying the main network node may be triggered to generate an creation block including the configuration information based on the processing logic, and a subnetwork node belonging to the blockchain subnetwork may be started by loading the creation block.
The node device is equivalent to deploying a blockchain node on the node device by pulling up a process and creating an instance of running blockchain platform code in the process. For any networking master node, a first instance of running blockchain platform code is created by the node device in the process described above. Similarly, for a subnet node, a second instance of the run blockchain platform code is created by the node device in the process described above. When the first instance and the second instance are located in the same process, because cross-process interaction is not involved, the deployment difficulty of the sub-network nodes can be reduced, and the deployment efficiency is improved; of course, the second instance may also be in a different process on the node device than the first instance, which is not limited by the present description.
By the method, the blockchain sub-network can be created on the blockchain main network. Taking fig. 5 as an example, mainnet1 originally including nodeA-nodeE, mainnet2 originally including nodeF-nodeI, mainnet3 originally including nodeJ-nodeM, based on mainnet, mainnet, and mainnet3, a subnet1 can be constructed, where the subnet1 includes nodeA1, nodeB1, nodeH, and nodeM1, and nodeA1, nodeB and nodeB1, nodeH and nodeH1, nodeM, and nodeM1 are respectively deployed on the same node device. Similarly, a subnet2 or more blockchain subnets can also be built based on mainnet and mainnet2, where subnet2 contains nodeA2, nodeG2 and nodeH2, and nodeA1, nodeA2, nodeH and nodeH1, nodeH2, nodeG and nodeG1 are deployed on the same node device, respectively. And, the subnet1, the subnet2 and the like can be used as a new blockchain main network, and a next-stage blockchain sub-network is further constructed on the basis, and the process is similar to the construction of the subnet1 or the subnet2 and is not repeated here.
With the above embodiments, for a plurality of blockchain main networks, at least one main network node in each blockchain main network may together with at least one main network node in other blockchain main networks form a blockchain sub-network, i.e. a blockchain sub-network crossing the main network is formed based on the plurality of blockchain main networks. Since the blockchain subnetwork is independent of the respective blockchain subnetwork, transactions conducted in the subnetwork and their associated data are not available to other node members in the subnetwork. It can be seen that the newly constructed blockchain subnetwork can meet the requirements of small-scale transactions among the various node members participating in constructing the subnetwork.
The present specification also proposes another method for constructing a blockchain subnetwork. Referring to fig. 6, fig. 6 is a flowchart of another method for constructing a blockchain subnetwork according to an exemplary embodiment. As shown in fig. 6, the method may include the steps of:
In step 602, a plurality of node devices respectively obtain configuration information of a blockchain sub-network, where a main network node deployed in the plurality of node devices belongs to at least two blockchain main networks, and the configuration information includes identity information of node members participating in building the blockchain sub-network.
Step 604, the plurality of node devices respectively perform: and under the condition that the configuration information comprises the identity information of the node member corresponding to the self-deployed main network node, loading an creation block generated based on the configuration information to start the sub-network node belonging to the block chain sub-network.
In this scheme, the main network nodes deployed in the plurality of node devices may respectively execute transactions for constructing the blockchain sub-network, so that each node device may acquire the configuration information that the corresponding main network node executes the transactions. At this time, the foregoing manners of initiating and executing the transaction are not substantially different from the foregoing schemes, and specific processes may be referred to the descriptions of the foregoing embodiments, which are not repeated herein.
Or the configuration information may be sent by other devices to the node device where the main network node is deployed in an off-link manner. In other words, any node device of the plurality of node devices may receive the configuration information sent by other devices in an off-link manner. For example, each participant in the blockchain sub-network to be built may determine or acquire configuration information of the sub-network at the same time under the condition of negotiating to determine to build the sub-network, and then send the configuration information to a corresponding node device deployed with the main network node in other manners. When the other devices send the configuration information to any node device, the message may be sent in a general form of network connection, not based on the blockchain main network or other blockchains in which the node device participates.
And then, or node members corresponding to the main network nodes participating in building the block chain sub-network can also assign the configuration information to the node equipment, for example, the configuration information or a configuration file containing the configuration information can be input through a man-machine interaction interface of the node equipment, so that the node equipment can acquire the configuration information according to the configuration information. The configuration information can be acquired by the node member or obtained through negotiation with other node members, and the configuration file can be generated by the node member or obtained from other related parties, which is not described in detail.
By the above method, the plurality of node devices deployed with the main network node can respectively acquire the configuration information of the block chain sub-network to be constructed, and further, the node devices can generate the generation block based on the acquired configuration information. The foregoing embodiment has been described taking the configuration information as an example, and in fact, the plurality of node devices may also acquire an creation block generated according to the configuration information, such as an creation block containing the configuration information, or the like, in the manner described above.
Based on the generated or obtained generation block, each node device can load the generation block to start the subnet node belonging to the block chain subnet under the condition that the configuration information comprises the identity information of the node member corresponding to the self-deployed main network node. The generating and loading process of the creation block may refer to the description of the foregoing embodiments, which is not repeated herein.
With the above embodiment, a blockchain subnetwork across a main network may also be built based on multiple blockchain main networks. Since the blockchain subnetwork is independent of the respective blockchain subnetwork, transactions conducted in the subnetwork and their associated data are not available to other node members in the subnetwork. It can be seen that, based on the blockchain subnetwork constructed by the scheme, the requirement of small-scale transactions among the various node members participating in constructing the subnetwork can also be satisfied.
Fig. 7 is a schematic block diagram of an apparatus according to an exemplary embodiment. Referring to fig. 7, at the hardware level, the device includes a processor 702, an internal bus 704, a network interface 706, a memory 708, and a non-volatile storage 710, although other hardware required by the service is possible. One or more embodiments of the present description may be implemented in a software-based manner, such as by the processor 702 reading a corresponding computer program from the non-volatile storage 710 into the memory 708 and then running. Of course, in addition to software implementation, one or more embodiments of the present disclosure do not exclude other implementation manners, such as a logic device or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but may also be hardware or a logic device.
As shown in fig. 8, fig. 8 is a block diagram of a migration apparatus for a blockchain node according to an exemplary embodiment of the present disclosure, where the apparatus may be applied to a device shown in fig. 7 to implement the technical solution of the present disclosure. The device comprises:
a transaction obtaining unit 801, configured to obtain transactions for building a blockchain subnetwork by using a plurality of main network nodes, where the transactions include configuration information of the blockchain subnetwork, the configuration information includes identity information of node members participating in building the blockchain subnetwork, and the plurality of main network nodes belong to at least two blockchain main networks, where each main network node belongs to one blockchain main network;
a transaction execution unit 802, configured to execute the transactions by the plurality of home network nodes respectively to permeate the configuration information;
A node starting unit 803, configured to execute, by node devices deployed with the main network node, respectively: and under the condition that the configuration information comprises the identity information of the node member corresponding to the self-deployed main network node, loading an creation block generated based on the configuration information to start the sub-network node belonging to the block chain sub-network.
Optionally, the transaction acquisition unit 801 is further configured to:
any main network node obtains the transaction initiated by an administrator or a common user of any blockchain main network in the blockchain main network; or alternatively
Any master network node obtains the transaction initiated in the other blockchain master network by an administrator or a common user of the other blockchain master network, the transaction being synchronized by the other blockchain master network to the any blockchain master network.
Optionally, the master network node of the other blockchain master network maintains a node list of the master network nodes of any blockchain master network, and the transaction obtaining unit 801 is further configured to:
The main network node of the other blockchain main network sends the transaction to the main network node of any blockchain main network according to the node list under the condition that the transaction comprises the main network identification of any blockchain main network; or alternatively
And the main network node of the other blockchain main network sends the transaction to the main network node of any blockchain main network according to the node list under the condition that the transaction contains the identity information of the main network node of any blockchain main network.
Optionally, the transaction acquisition unit 801 is further configured to:
acquiring the node list from any blockchain main network;
acquiring the node list submitted by an administrator or a common user of the other blockchain main network;
the list of nodes is obtained from a parent blockchain network with the either blockchain master network and the other blockchain master network managed by the parent blockchain network.
Optionally, the transaction that constitutes the blockchain subnetwork includes a transaction that invokes a smart contract.
Optionally, the transaction execution unit 802 is further configured to:
The execution result of the intelligent contract comprises the creation block, and node equipment deployed with the main network node acquires the creation block through a message mechanism; or alternatively
The execution result of the intelligent contract comprises the configuration information, the node equipment deployed with the main network node obtains the configuration information through a message mechanism, and the generation block is generated according to the obtained configuration information.
Optionally, the receipt generated by executing the smart contract includes networking events related to building the blockchain subnet, and the transaction executing unit 802 is further configured to:
The main network node monitors the generated receipts, and triggers node equipment where the main network node is located to acquire the creation block or the configuration information contained in the networking event under the condition that the monitored content of the networking event records the identity information of the node member corresponding to the main network node; or alternatively
And the node equipment deploying the main network node monitors the generated receipt, and acquires the generation block or the configuration information contained in the networking event under the condition that the monitored content of the networking event indicates that the main network node belongs to the node member.
Optionally, the networking event includes: the subject name in the receipt contains a predefined networking identified event.
Optionally, when the content of the networking event includes the following identification, it indicates that the networking event is related to building the blockchain subnet:
The network identification of the block chain sub-network which is expected to be built is different from the network identification of the existing block chain sub-network; or alternatively
And predefining a new network identification, wherein the new network identification indicates that the networking event is used for constructing a new block chain sub-network.
Optionally, the transaction includes a networking transaction type identification indicating that the transaction is to be used to build a new blockchain subnet.
Optionally, the configuration information further includes at least one of:
network identification of the blockchain sub-network, identity information of an administrator of the blockchain sub-network, and attribute configuration for blockchain platform codes.
Optionally, the blockchain subnetwork is the same as an administrator of at least one of the blockchain main networks; or the blockchain subnetwork is different from an administrator of each of the blockchain main networks.
Optionally, the node starting unit 803 is further configured to:
And the node equipment creates a second instance of the platform code corresponding to the block chain sub-network, and triggers the second instance to load an creation block generated based on the configuration information.
Optionally, any of the blockchain primary networks is an underlying blockchain network or a subnetwork managed by other blockchain networks.
Optionally, at least one main network node exists in any block chain main network to participate in building the block chain sub-network.
As shown in fig. 9, fig. 9 is a block diagram of another migration apparatus for a blockchain node provided in the present specification according to an exemplary embodiment, and the apparatus may be applied to the device shown in fig. 7 to implement the technical solution of the present specification. The device comprises:
an information obtaining unit 901, configured to obtain configuration information of a blockchain subnetwork by using a plurality of node devices, where a main network node deployed in the plurality of node devices belongs to at least two blockchain main networks, where each main network node belongs to one blockchain main network, and the configuration information includes identity information of node members participating in building the blockchain subnetwork;
A node starting unit 902, configured to perform: and under the condition that the configuration information comprises the identity information of the node member corresponding to the self-deployed main network node, loading an creation block generated based on the configuration information to start the sub-network node belonging to the block chain sub-network.
Optionally, the information acquisition unit 901 is further configured to one of the following:
any node equipment receives the configuration information sent by other equipment in an under-chain mode;
any node equipment acquires the configuration information designated by a node member, wherein the node member corresponds to a main network node locally deployed by the any node equipment;
any node equipment acquires the configuration information which is transmitted by the locally deployed main network node through executing the transaction for constructing the blockchain sub-network.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. One typical implementation is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being functionally divided into various units, respectively. Of course, the functions of each element may be implemented in one or more software and/or hardware elements when implemented in the present specification.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks. In a typical configuration, a computer includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer 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), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, read only compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic disk storage, quantum memory, graphene-based storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by the computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
The foregoing describes specific embodiments of the present disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
The terminology used in the one or more embodiments of the specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of the specification. As used in this specification, one or more embodiments and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any or all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used in one or more embodiments of the present description to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of one or more embodiments of the present description. The word "if" as used herein may be interpreted as "at … …" or "at … …" or "in response to a determination" depending on the context.
The foregoing description of the preferred embodiment(s) is (are) merely intended to illustrate the embodiment(s) of the present invention, and it is not intended to limit the embodiment(s) of the present invention to the particular embodiment(s) described.

Claims (21)

1. A method of building a blockchain subnetwork, comprising:
A plurality of main network nodes respectively acquire transactions for constructing a block chain sub-network, wherein the transactions comprise configuration information of the block chain sub-network, the configuration information comprises identity information of node members participating in constructing the block chain sub-network, the plurality of main network nodes belong to at least two block chain main networks, and each main network node belongs to one block chain main network;
the plurality of main network nodes respectively execute the transaction to permeate out the configuration information;
Node devices deployed with the main network node respectively execute: and under the condition that the configuration information comprises identity information of node members corresponding to the self-deployed main network nodes, loading an creation block generated based on the configuration information to start a sub-network node belonging to the block chain sub-network, wherein the block chain sub-network is independent of the at least two block chain main networks.
2. The method of claim 1, any master network node in any blockchain master network to obtain the transaction, comprising:
any main network node obtains the transaction initiated by an administrator or a common user of any blockchain main network in the blockchain main network; or alternatively
Any master network node obtains the transaction initiated in the other blockchain master network by an administrator or a common user of the other blockchain master network, the transaction being synchronized by the other blockchain master network to the any blockchain master network.
3. The method of claim 2, the master network node of the other blockchain master network maintaining a node list of master network nodes of the any blockchain master network, the other blockchain master network synchronizing the transaction to the any blockchain master network, comprising:
The main network node of the other blockchain main network sends the transaction to the main network node of any blockchain main network according to the node list under the condition that the transaction comprises the main network identification of any blockchain main network; or alternatively
And the main network node of the other blockchain main network sends the transaction to the main network node of any blockchain main network according to the node list under the condition that the transaction contains the identity information of the main network node of any blockchain main network.
4. A method according to claim 3, wherein the master network node of the other blockchain master network obtains the list of nodes by means of one of:
acquiring the node list from any blockchain main network;
acquiring the node list submitted by an administrator or a common user of the other blockchain main network;
the list of nodes is obtained from a parent blockchain network with the either blockchain master network and the other blockchain master network managed by the parent blockchain network.
5. The method of claim 1, the transaction that constitutes a blockchain subnetwork comprising a transaction that invokes a smart contract.
6. The method according to claim 5,
The execution result of the intelligent contract comprises the creation block, and node equipment deployed with the main network node acquires the creation block through a message mechanism; or alternatively
The execution result of the intelligent contract comprises the configuration information, the node equipment deployed with the main network node obtains the configuration information through a message mechanism, and the generation block is generated according to the obtained configuration information.
7. The method of claim 6, wherein the receipt generated by executing the smart contract includes networking events related to building the blockchain subnetwork, and the node device with the main network node deployed obtains the creation block or the configuration information through a message mechanism, including:
The main network node monitors the generated receipts, and triggers node equipment where the main network node is located to acquire the creation block or the configuration information contained in the networking event under the condition that the monitored content of the networking event records the identity information of the node member corresponding to the main network node; or alternatively
And the node equipment deploying the main network node monitors the generated receipt, and acquires the generation block or the configuration information contained in the networking event under the condition that the monitored content of the networking event indicates that the main network node belongs to the node member.
8. The method of claim 7, the networking event comprising: the subject name in the receipt contains a predefined networking identified event.
9. The method of claim 7, wherein the networking event is indicated as being related to building the blockchain subnet when the content of the networking event includes the following identification:
The network identification of the block chain sub-network which is expected to be built is different from the network identification of the existing block chain sub-network; or alternatively
And predefining a new network identification, wherein the new network identification indicates that the networking event is used for constructing a new block chain sub-network.
10. The method of claim 1, the transaction comprising a networking transaction type identification indicating that the transaction is for building a new blockchain subnet.
11. The method of claim 1, the configuration information further comprising at least one of:
network identification of the blockchain sub-network, identity information of an administrator of the blockchain sub-network, and attribute configuration for blockchain platform codes.
12. The method of claim 1, the blockchain subnetwork being the same as an administrator of at least one of the blockchain main networks; or the blockchain subnetwork is different from an administrator of each of the blockchain main networks.
13. The method of claim 1, the node device loading an creation block generated based on the configuration information, comprising:
And the node equipment creates a second instance of the platform code corresponding to the block chain sub-network, and triggers the second instance to load an creation block generated based on the configuration information.
14. The method of claim 1, any of the blockchain master networks being an underlying blockchain network or a subnetwork managed by other blockchain networks.
15. The method of claim 1, wherein at least one master network node in any one of the blockchain master networks participates in building the blockchain subnetwork.
16. A method of building a blockchain subnetwork, comprising:
The method comprises the steps that a plurality of node devices respectively acquire configuration information of block chain subnets, main network nodes deployed in the plurality of node devices are attributed to at least two block chain main networks, each main network node is attributed to one block chain main network, and the configuration information comprises identity information of node members participating in building the block chain subnets;
the plurality of node devices respectively perform: and under the condition that the configuration information comprises identity information of node members corresponding to the self-deployed main network nodes, loading an creation block generated based on the configuration information to start a sub-network node belonging to the block chain sub-network, wherein the block chain sub-network is independent of the at least two block chain main networks.
17. The method of claim 16, any node device obtaining the configuration information, comprising one of:
any node equipment receives the configuration information sent by other equipment in an under-chain mode;
any node equipment acquires the configuration information designated by a node member, wherein the node member corresponds to a main network node locally deployed by the any node equipment;
any node equipment acquires the configuration information which is transmitted by the locally deployed main network node through executing the transaction for constructing the blockchain sub-network.
18. An apparatus for building a blockchain subnetwork, comprising:
A transaction obtaining unit, configured to obtain transactions for building a blockchain subnetwork by using a plurality of main network nodes, where the transactions include configuration information of the blockchain subnetwork, the configuration information includes identity information of node members participating in building the blockchain subnetwork, and the plurality of main network nodes belong to at least two blockchain main networks, where each main network node belongs to one blockchain main network;
the transaction execution unit is used for respectively executing the transactions by the plurality of main network nodes so as to permeate out the configuration information;
the node starting unit is used for respectively executing the node equipment deployed with the main network node: and under the condition that the configuration information comprises identity information of node members corresponding to the self-deployed main network nodes, loading an creation block generated based on the configuration information to start a sub-network node belonging to the block chain sub-network, wherein the block chain sub-network is independent of the at least two block chain main networks.
19. An apparatus for building a blockchain subnetwork, comprising:
The information acquisition unit is used for respectively acquiring configuration information of the block chain subnets by a plurality of node devices, wherein the main network nodes deployed in the plurality of node devices are attributed to at least two block chain main networks, each main network node is attributed to one block chain main network, and the configuration information comprises identity information of node members participating in constructing the block chain subnets;
a node starting unit, configured to perform: and under the condition that the configuration information comprises identity information of node members corresponding to the self-deployed main network nodes, loading an creation block generated based on the configuration information to start a sub-network node belonging to the block chain sub-network, wherein the block chain sub-network is independent of the at least two block chain main networks.
20. An electronic device, comprising:
A processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to implement the method of any one of claims 1-17 by executing the executable instructions.
21. A computer readable storage medium having stored thereon computer instructions which, when executed by a processor, implement the steps of the method of any of claims 1-17.
CN202210473060.XA 2022-04-29 2022-04-29 Block chain sub-network construction method, device, electronic equipment and computer readable storage medium Active CN115086338B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210473060.XA CN115086338B (en) 2022-04-29 Block chain sub-network construction method, device, electronic equipment and computer readable storage medium
PCT/CN2022/135222 WO2023207076A1 (en) 2022-04-29 2022-11-30 Method and apparatus for establishing blockchain subnet

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210473060.XA CN115086338B (en) 2022-04-29 Block chain sub-network construction method, device, electronic equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN115086338A CN115086338A (en) 2022-09-20
CN115086338B true CN115086338B (en) 2024-07-16

Family

ID=

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018104276A1 (en) * 2016-12-08 2018-06-14 Bundesdruckerei Gmbh Master blockchain
CN113067904A (en) * 2021-06-02 2021-07-02 支付宝(杭州)信息技术有限公司 Method for building block chain sub-network and block chain system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018104276A1 (en) * 2016-12-08 2018-06-14 Bundesdruckerei Gmbh Master blockchain
CN113067904A (en) * 2021-06-02 2021-07-02 支付宝(杭州)信息技术有限公司 Method for building block chain sub-network and block chain system

Similar Documents

Publication Publication Date Title
CN113067904B (en) Method for building block chain sub-network and block chain system
CN113067895B (en) Method for building block chain sub-network and block chain system
CN113067894B (en) Method for node to exit block chain sub-network
CN113098983B (en) Task execution method and device based on intelligent contract
CN113067897B (en) Cross-chain interaction method and device
CN113098982B (en) Block chain message transmission method and device
CN113923232B (en) Information synchronization method and device for block chain subnetwork
CN113259120B (en) Method for synchronizing node information lists
CN113067914B (en) Method and device for distributing subnet identification, electronic equipment and storage medium
CN113067896B (en) Method for adding node in block chain sub-network and block chain system
CN113259458B (en) Method and device for starting/closing block link point service
CN113259118B (en) Method for synchronizing node information lists
CN113067899B (en) Method and device for starting/closing block link point service
CN113259117B (en) Method for synchronizing node information lists
CN113326290B (en) Cross-network query control method
CN114363162A (en) Block chain log generation method and device, electronic equipment and storage medium
CN114866560B (en) Block chain node migration method and device, electronic equipment and readable storage medium
CN113259462B (en) Block chain message distribution method and device
CN113259119B (en) Block chain message distribution method and device
CN114268634B (en) Business execution method based on out-of-chain computing service
CN114095507B (en) Cross-chain interaction method and block chain system
CN115086338B (en) Block chain sub-network construction method, device, electronic equipment and computer readable storage medium
CN114363349B (en) Block chain sub-network starting method and device
WO2023207076A1 (en) Method and apparatus for establishing blockchain subnet
CN113098984B (en) Method for forming multi-layer block chain system based on registration mechanism and block chain system

Legal Events

Date Code Title Description
PB01 Publication
SE01 Entry into force of request for substantive examination
GR01 Patent grant