CN113206893B - Method for block synchronization and node joining block chain network - Google Patents

Method for block synchronization and node joining block chain network Download PDF

Info

Publication number
CN113206893B
CN113206893B CN202110757863.3A CN202110757863A CN113206893B CN 113206893 B CN113206893 B CN 113206893B CN 202110757863 A CN202110757863 A CN 202110757863A CN 113206893 B CN113206893 B CN 113206893B
Authority
CN
China
Prior art keywords
node
network
block
current
block chain
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
CN202110757863.3A
Other languages
Chinese (zh)
Other versions
CN113206893A (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.)
Alipay Hangzhou Information Technology Co Ltd
Original Assignee
Alipay Hangzhou Information Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Alipay Hangzhou Information Technology Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202110757863.3A priority Critical patent/CN113206893B/en
Publication of CN113206893A publication Critical patent/CN113206893A/en
Application granted granted Critical
Publication of CN113206893B publication Critical patent/CN113206893B/en
Priority to PCT/CN2022/100619 priority patent/WO2023279971A1/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1044Group management mechanisms 
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1074Peer-to-peer [P2P] networks for supporting data block transmission mechanisms
    • H04L67/1078Resource delivery mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Databases & Information Systems (AREA)
  • Mathematical Physics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

One or more embodiments of the present disclosure provide a method for block synchronization and node joining in a blockchain network. The method comprises the steps of adding a communication address of at least one current node of a blockchain network in a network configuration file for enabling a target node to join the blockchain network, so that the target node can perform block synchronization even under the condition that each founding node already exits the blockchain network, and requesting the current node of the blockchain network to synchronize a block according to the communication address of the current node contained in the network configuration file.

Description

Method for block synchronization and node joining block chain network
Technical Field
One or more embodiments of the present disclosure relate to the field of information technology, and in particular, to a method for block synchronization and a node to join a blockchain network.
Background
The current creation process of the block chain network is to deploy the creation blocks of the block chain in the local of each creation node, and the creation blocks record the communication addresses of each creation node.
And if a new node wants to join the block chain network, a network configuration file containing the created block information can be locally deployed on the new node, the new node locally deploys the created block according to the network configuration file, and further requests other blocks except the created block from the created node synchronous block chain according to the communication address of the created node recorded in the created block, so that the new node can join the block chain network.
However, it is sometimes difficult for a new node to perform block synchronization.
Disclosure of Invention
One or more embodiments of the present disclosure provide a method for block synchronization and node joining in a blockchain network.
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 specification, there is provided a block synchronization method applied to a target node to be added to a blockchain network, the method including:
acquiring a network configuration file; the network profile contains a communication address of at least one current node of the blockchain network;
requesting a block in a block chain to be synchronized from a current node of the block chain network according to a communication address of at least one current node of the block chain network, in case that each created node of the block chain network has exited the network.
According to a second aspect of one or more embodiments of the present specification, there is provided a method for a node to join a blockchain network, where the blockchain network has an intelligent contract deployed therein, and the intelligent contract is used to maintain a current node list of the blockchain network, the method including:
acquiring a node joining transaction;
calling the intelligent contract to execute according to the node joining transaction: if the target node to be added into the block chain network is determined to have the joining qualification, the target node is taken as a current node of the block chain network, and the current node list is updated;
if the target node is determined to be recorded in the current node list, allowing the target node to synchronize a block from a current node in the blockchain network; wherein the target node performs block synchronization based on the block synchronization method of the first aspect.
According to a third aspect of one or more embodiments of the present specification, there is provided a block synchronization apparatus applied to a target node to be added to a blockchain network, the apparatus including:
the acquisition module acquires a network configuration file; the network profile contains a communication address of at least one current node of the blockchain network;
the first request synchronization module requests to synchronize blocks in the block chain from the current node according to the communication address of at least one current node of the block chain network under the condition that each created node of the block chain network exits the network.
According to a fourth aspect of one or more embodiments herein, there is provided a blockchain network in which an intelligent contract is deployed, the intelligent contract being used to maintain a current node list of the blockchain network;
each current node in the block chain network acquires a node to join in a transaction; calling the intelligent contract to execute according to the node joining transaction: if the target node to be added into the block chain network is determined to have the joining qualification, the target node is taken as a current node of the block chain network, and the current node list is updated; if the target node is determined to be recorded in the current node list, allowing the target node to synchronize a block from a current node in the blockchain network;
wherein the target node performs block synchronization based on the block synchronization method of the first aspect.
In the above technical solution, a communication address of at least one current node of a blockchain network is added to a network configuration file for enabling a target node to join the blockchain network, so that the target node can perform block synchronization even when each founding node has exited the blockchain network, and request synchronization of a block from the current node of the blockchain network according to the communication address of the current node included in the network configuration file.
In addition, for a target node to be added to the blockchain network, the blockchain network may first accept and invoke an intelligent contract to execute a node join transaction for requesting the target node to be added to the blockchain network, and after the target node is recorded in a current node list maintained by the intelligent contract, the target node may be permitted to synchronize a block.
By the technical scheme, the success rate of the node joining the block chain network can be improved.
Drawings
FIG. 1 is a schematic diagram of one type of creating an intelligent contract provided by the present specification.
FIG. 2 is a schematic diagram of a calling intelligent contract provided herein.
FIG. 3 is a schematic diagram of the creation and invocation of an intelligent contract provided by the present specification.
Fig. 4 is a flowchart illustrating a block synchronization method provided in the present specification.
Fig. 5 is a flowchart illustrating a method for a node to join a blockchain network provided in this specification.
Fig. 6 is a schematic structural diagram of a block synchronization apparatus provided in this specification.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent 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 certain aspects of one or more embodiments of the specification, as detailed in the claims which follow.
It should be noted that: in other embodiments, the steps of the corresponding methods are not necessarily performed in the order shown and described herein. In some other embodiments, the method may include more or fewer steps than those described herein. Moreover, a single step described in this specification may be broken down into multiple steps for description in other embodiments; multiple 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 alliance chain (Consortium Blockchain). In addition, there are various types of combinations, such as private chain + federation chain, federation chain + public chain, and other different combinations. The most decentralized of these is the public chain. The public chain is represented by bitcoin and ether house, and the participators joining the public chain can read the data record on the chain, participate in transaction, compete for accounting right of new blocks, and the like. Furthermore, each participant (i.e., node) is free to join and leave the network and perform related operations. Private chains are the opposite, with the network's write rights controlled by an organization or organization and the data read rights specified by the organization. Briefly, a private chain can be a weakly centralized system with strictly limited and few participating nodes. This type of blockchain is more suitable for use within a particular establishment. A federation chain is a block chain between a public chain and a private chain, and "partial decentralization" can be achieved. Each node in a federation chain typically has a physical organization or organization corresponding to it; participants jointly maintain blockchain operation by authorizing to join the network and forming a benefit-related alliance.
Whether public, private, or alliance, may provide the functionality of an intelligent contract. An intelligent contract on a blockchain is a contract that can be executed on a blockchain system triggered by a transaction. An intelligent contract may be defined in the form of code.
Taking the ethernet as an example, the support user creates and invokes some complex logic in the ethernet network, which is the biggest challenge of ethernet to distinguish from bitcoin blockchain technology. The core of the ethernet plant as a programmable blockchain is the ethernet plant virtual machine (EVM), each ethernet plant node can run the EVM. The EVM is a well-behaved virtual machine, which means that a variety of complex logic can be implemented through it. The user issuing and invoking smart contracts in the etherhouse is running on the EVM. In fact, what the virtual machine directly runs is virtual machine code (virtual machine bytecode, hereinafter referred to as "bytecode"). The intelligent contracts deployed on the blockchain may be in the form of bytecodes.
For example, as shown in fig. 1, after Bob sends a transaction containing information to create an intelligent contract to the ethernet network, the EVM of node 1 may execute the transaction and generate a corresponding contract instance. The "0 x6f8ae93 …" in fig. 1 represents the address of the contract, the data field of the transaction holds the byte code, and the to field of the transaction is empty. After agreement is reached between the nodes through the consensus mechanism, this contract is successfully created and can be invoked in subsequent procedures. After the contract is created, a contract account corresponding to the intelligent contract appears on the blockchain and has a specific address, and the contract code is stored in the contract account. The behavior of the intelligent contract is controlled by the contract code. In other words, an intelligent contract causes a virtual account to be generated on a blockchain that contains a contract code and an account store (Storage).
As shown in fig. 2, still taking an ethernet house as an example, after Bob sends a transaction for invoking an intelligent contract to the ethernet house network, the EVM of a certain node may execute the transaction and generate a corresponding contract instance. The from field of the transaction in FIG. 2 is the address of the account of the initiator of the transaction (i.e., Bob), the "0 x6f8ae93 …" in the to field represents the address of the smart contract being invoked, and the value field is the value in EtherFang that is kept in the data field of the transaction as the method and parameters for invoking the smart contract. After invoking the smart contract, the value of balance may change. Subsequently, a client can view the current value of balance 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, and all execution records and data are stored on the blockchain, so that after the transaction is completed, transaction certificates which cannot be tampered and cannot be lost are stored on the blockchain.
A schematic diagram of creating an intelligent contract and invoking the intelligent contract is shown in fig. 3. To create an intelligent contract in an ethernet workshop, the intelligent contract needs to be compiled, compiled into byte codes, deployed to a block chain and the like. The intelligent contract is called in the Ethernet workshop, a transaction pointing to the intelligent contract address is initiated, and the intelligent contract codes are distributed and run in the virtual machine of each node in the Ethernet workshop network.
It should be noted that, in addition to the creation of the smart contracts by the users, the smart contracts may also be set by the system in the creation block. Such contracts are generally referred to as foundational contracts. In general, the data structure, parameters, attributes and methods of some blockchain networks may be set in the startup contract. Further, an account with system administrator privileges may create a contract at the system level, or modify a contract at the system level (simply referred to as a system contract). In addition to EVM in the ethernet, different blockchain networks may employ various virtual machines, which is not limited herein.
After executing a transaction that invokes a smart contract, a 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 contract execution results may be obtained by querying the receipt of the transaction. The contract execution result may be represented as an event (event) in the receipt. The message mechanism can realize message passing through an event in a receipt so as to trigger the blockchain node or a node device deploying the blockchain node to execute corresponding processing. The structure of the event may be, for example:
Event:
[topic][data]
[topic][data]
......
in the above example, the number of events may be one or more; wherein, each event respectively comprises fields of a subject (topic) and data (data). The blockchain node or the node device deploying the blockchain node may perform the preset processing by monitoring the topic of the event, in case that the predefined topic is monitored, or read the related content from the data field of the corresponding event, and may perform the preset processing based on the read content.
In the event mechanism, it is equivalent to that there is a client with a monitoring function at a monitoring party (e.g. a user with a monitoring requirement), for example, an SDK or the like for implementing the monitoring function is run on the client, and the client monitors events generated by the blockchain node, and the blockchain node only needs to generate a receipt normally. The passage of transaction information may be accomplished in other ways than through the event mechanism described above. For example, the monitoring code can be embedded in a blockchain platform code running at blockchain nodes, so that the monitoring code can monitor one or more data of transaction content of blockchain transactions, contract states of intelligent contracts, receipts generated by contracts and the like, and send the monitored data to a predefined monitoring party. Since the snoop code is deployed in the blockchain platform code, rather than at the snooper's client, this implementation based on snoop code is relatively more proactive than the event mechanism. The above monitoring code may be added by a developer of the blockchain platform in the development process, or may be embedded by the monitoring party based on the own requirement, which is not limited in this specification.
The blockchain technology is different from the traditional technology in one of decentralization characteristics, namely accounting is performed on each node, or distributed accounting is performed, and the traditional centralized accounting is not performed. To be a difficult-to-defeat, open, non-falsifiable data record decentralized honest and trusted system, the blockchain system needs to be secure, unambiguous, and irreversible in the shortest possible time for distributed data records. In different types of blockchain networks, in order to keep the ledger consistent among the nodes recording the ledger, a consensus algorithm is generally adopted to ensure that the consensus mechanism is the aforementioned mechanism. For example, a common mechanism of block granularity can be implemented between block nodes, such as after a node (e.g., a unique node) generates a block, if the generated block is recognized by other nodes, other nodes record the same block. For another example, a common mechanism of transaction granularity may be implemented between the blockchain nodes, such as after a node (e.g., a unique node) acquires a blockchain transaction, if the blockchain transaction is approved by other nodes, each node that approves the blockchain transaction may add the blockchain transaction to the latest block maintained by itself, and finally, each node may be ensured to generate the same latest block. The consensus mechanism is a mechanism for the blockchain node to achieve a global consensus on the block information (or called blockdata), which can ensure that the latest block is accurately added to the blockchain. The current mainstream consensus mechanisms include: proof of Work (POW), Proof of stock (POS), Proof of commission rights (DPOS), Practical Byzantine Fault Tolerance (PBFT) algorithm, HoneyBadgerBFT algorithm, etc.
The current creation process of the block chain network is to deploy the creation blocks of the block chain in the local of each creation node, and the creation blocks record the communication addresses of each creation node.
Subsequently, if a new node wants to join the blockchain network, a network configuration file can be deployed locally at the new node. It should be noted that the network configuration file generally refers to a file for configuring a node to be added to the blockchain network. The configuration functions provided by the network configuration file are many, including, for example, installing signed certificates, installing virtual machines, installing protocols, and so forth. For a node subsequently requesting to join the blockchain network, the network configuration file provided for the node may also contain the created block information, and the node may synchronize blocks other than the created block from the created node according to the communication address (e.g., IP address) of the created node, so as to join the blockchain network.
After the blockchain network is created, new nodes may be added. Furthermore, the founder node of the blockchain network may subsequently exit the blockchain network. Therefore, there may be a case where each of the created nodes of the blockchain network has already exited the blockchain network, which means that it is highly likely that the latest block cannot be synchronized from the created node based on the communication addresses of the respective created nodes described in the created blocks.
To this end, in one or more embodiments of the present description, a communication address of at least one current node of a blockchain network is added to a network profile for joining a target node to the blockchain network, so that the target node can perform block synchronization even in a case where each founder node has exited the blockchain network, and a block synchronization is requested from the current node of the blockchain network according to the communication address of the current node included in the network profile.
In addition, for a target node to be added to the blockchain network, the blockchain network may first accept and invoke an intelligent contract to execute a node join transaction for requesting the target node to be added to the blockchain network, and after the target node is recorded in a current node list maintained by the intelligent contract, the target node may be permitted to synchronize a block.
Fig. 4 is a flowchart of a block synchronization method provided in the present specification, including the following steps:
s400: a network configuration file is obtained.
The method described in fig. 4 is applied to a target node to be added to a blockchain network.
In some embodiments, the target node may download a network profile for joining the blockchain network from an internet approach.
In other embodiments, the network profile may be deployed online for the target node.
S402: requesting a block in a block chain to be synchronized from a current node of the block chain network according to a communication address of at least one current node of the block chain network, in case that each created node of the block chain network has exited the network.
In some embodiments, the network profile may not contain founder block information for the blockchain network. As such, in step S402, the target node may request to synchronize all tiles in the tile chain from the current node.
In some embodiments, the network profile may contain the created block information of the block chain, so that the target node may request other blocks than the created block from the current node synchronization block chain in step S402.
Furthermore, in step S402, if the network profile includes communication addresses of a plurality of current nodes of the blockchain network, different blocks in a blockchain may be requested to be synchronized from different current nodes according to the communication addresses of at least two current nodes. Therefore, the block synchronization can be performed through a plurality of parallel block synchronization threads, and the efficiency of the block synchronization is improved.
In addition, when at least one created node exists in the block chain network, a communication address of the at least one created node is determined according to created block information, and a block in the block chain is synchronized from the created node.
Fig. 5 is a flowchart of a method for a node to join a blockchain network, which includes the following steps:
s500: and acquiring the node to join the transaction.
The method illustrated in fig. 5 is applied to a blockchain network, and may be understood as being performed by each current node of the blockchain network.
The node join transaction is used to request the blockchain network to agree to join the target node in the blockchain network.
An intelligent contract may be deployed in a blockchain network, where the intelligent contract is used to maintain a current node list of the blockchain network. It can be understood that, in the course of operation of the blockchain network, there may be node exit and node join, and the current node list needs to be updated according to the node exit event and the node join event. Note that a node exit event, similar to a node join event, may be triggered by submitting a transaction to invoke a smart contract to the blockchain network (a node join transaction or a node exit transaction).
S502: and calling the intelligent contract to execute the transaction according to the node joining transaction.
In step S502, the intelligent contract is invoked to execute a step of updating the current node list by using a target node as a current node of the blockchain network if it is determined that the target node to be added to the blockchain network is qualified for adding.
The judgment rule of whether the target node has the qualification for joining can be configured in the intelligent contract according to actual needs. Of course, any node requesting to join the blockchain network may also be considered eligible for joining.
The node joining transaction generally needs to carry information to be checked for determining whether the node is qualified for joining, such as a qualification file of a control party corresponding to the target node.
If the target node is not eligible for joining, the current node list may be denied updating.
S504: in the event that it is determined that the target node is recorded in the current node list, permitting the target node to synchronize blocks from a current node in the blockchain network.
The target node is permitted to synchronize blocks from the current node of the blockchain network, meaning that in the method shown in fig. 4, the current node in the blockchain network that requested the synchronization blocks grants the target node's request, thereby transmitting block data to the target node.
Further, in a case where it is determined that the target node is not recorded in the current node list, the target node is rejected from synchronizing blocks from a current node in the blockchain network.
Fig. 6 is a schematic structural diagram of a block synchronization apparatus provided in this specification, applied to a target node to be added to a blockchain network, where the apparatus includes:
an obtaining module 601, which obtains a network configuration file; the network profile contains a communication address of at least one current node of the blockchain network;
the first request synchronization module 602, in a case where each founder node of the blockchain network has exited the network, requests to synchronize a block in a blockchain from a current node of the blockchain network according to a communication address of at least one current node of the blockchain network.
The network configuration file also comprises creation block information of the block chain;
the first request synchronization module 602 requests other blocks except for the created block from the current node synchronization block chain in the case that each created node of the block chain network has exited the network.
The communication address includes: an IP address.
The first request synchronization module 602, if the network configuration file includes communication addresses of a plurality of current nodes of the block chain network, requests different blocks in different current node synchronization block chains according to the communication addresses of at least two current nodes.
Further comprising:
the second request synchronization module 603, when there is at least one created node in the block chain network, determines a communication address of the at least one created node according to created block information, and requests to synchronize blocks in the block chain from the created nodes.
The present specification also provides a blockchain network, where an intelligent contract is deployed in the blockchain network, and the intelligent contract is used to maintain a current node list of the blockchain network;
each current node in the block chain network acquires a node to join in a transaction; calling the intelligent contract to execute according to the node joining transaction: if the target node to be added into the block chain network is determined to have the joining qualification, the target node is taken as a current node of the block chain network, and the current node list is updated; if the target node is determined to be recorded in the current node list, allowing the target node to synchronize a block from a current node in the blockchain network;
each current node in the blockchain network rejects the target node to synchronize a block from the current node in the blockchain network if it is determined that the target node is not recorded in the current node list.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, 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 divided into various units by function, and are described separately. Of course, the functions of the various elements may be implemented in the same one or more software and/or hardware implementations of the present description.
As will be appreciated by one skilled in the art, 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 flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams 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.
This 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 forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
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 computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic disk storage, quantum memory, graphene-based storage media or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
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 an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may 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 may also be possible or may be advantageous.
The terminology used in the description of the one or more embodiments is for the purpose of describing the particular embodiments only and is not intended to be limiting of the description of the one or more embodiments. As used in one or more embodiments of the present specification 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 and 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, such 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 herein. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
The above description is only for the purpose of illustrating the preferred embodiments of the one or more embodiments of the present disclosure, and is not intended to limit the scope of the one or more embodiments of the present disclosure, and any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the one or more embodiments of the present disclosure should be included in the scope of the one or more embodiments of the present disclosure.

Claims (12)

1. A block synchronization method is applied to a target node to be added into a block chain network, and comprises the following steps:
acquiring a network configuration file; the network configuration file comprises creation block information of a block chain and a communication address of at least one current node of the block chain network;
and under the condition that each created node of the block chain network exits the network, requesting other blocks except created blocks from the current node synchronous block chain according to the communication address of at least one current node of the block chain network.
2. The method of claim 1, wherein the communication address comprises: an IP address.
3. The method of claim 1, wherein requesting synchronization of a block in a blockchain from a current node based on a communication address of at least one current node of the blockchain network comprises:
and if the network configuration file contains the communication addresses of a plurality of current nodes of the block chain network, requesting different blocks in different current node synchronous block chains according to the communication addresses of at least two current nodes.
4. The method of claim 1, further comprising:
and under the condition that at least one created node exists in the block chain network, determining the communication address of the at least one created node according to created block information, and requesting to synchronize blocks in the block chain from the created nodes.
5. A method for a node to join a blockchain network is applied to the blockchain network, an intelligent contract is deployed in the blockchain network, and the intelligent contract is used for maintaining a current node list of the blockchain network, and the method comprises the following steps:
acquiring a node joining transaction;
calling the intelligent contract to execute according to the node joining transaction: if the target node to be added into the block chain network is determined to have the joining qualification, the target node is taken as a current node of the block chain network, and the current node list is updated;
if the target node is determined to be recorded in the current node list, allowing the target node to synchronize a block from a current node in the blockchain network; wherein the target node performs block synchronization based on the block synchronization method of any one of claims 1-4.
6. The method of claim 5, further comprising:
rejecting the target node to synchronize a block from a current node in the blockchain network if it is determined that the target node is not recorded in the current node list.
7. A block synchronization apparatus applied to a target node to be added to a blockchain network, the apparatus comprising:
the acquisition module acquires a network configuration file; the network configuration file comprises creation block information of a block chain and a communication address of at least one current node of the block chain network;
the first request synchronization module requests other blocks except the created blocks in the block chain of the current node according to the communication address of at least one current node of the block chain network under the condition that each created node of the block chain network exits the network.
8. The apparatus of claim 7, the communication address comprising: an IP address.
9. The apparatus of claim 7, the first request synchronization module requests synchronization of different tiles in a tile chain from different current nodes according to communication addresses of at least two current nodes if the network profile contains communication addresses of multiple current nodes of the tile chain network.
10. The apparatus of claim 7, further comprising:
and the second request synchronization module is used for determining the communication address of at least one created node according to created block information and requesting the blocks in the created node synchronization block chain under the condition that at least one created node exists in the block chain network.
11. A blockchain network having intelligent contracts deployed therein, the intelligent contracts being used to maintain a current list of nodes of the blockchain network;
each current node in the block chain network acquires a node to join in a transaction; calling the intelligent contract to execute according to the node joining transaction: if the target node to be added into the block chain network is determined to have the joining qualification, the target node is taken as a current node of the block chain network, and the current node list is updated; if the target node is determined to be recorded in the current node list, allowing the target node to synchronize a block from a current node in the blockchain network;
wherein the target node performs block synchronization based on the block synchronization method of any one of claims 1-4.
12. The blockchain network of claim 11, each current node in the blockchain network rejecting the target node from synchronizing blocks from a current node in the blockchain network if it is determined that the target node is not recorded in the current node list.
CN202110757863.3A 2021-07-05 2021-07-05 Method for block synchronization and node joining block chain network Active CN113206893B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202110757863.3A CN113206893B (en) 2021-07-05 2021-07-05 Method for block synchronization and node joining block chain network
PCT/CN2022/100619 WO2023279971A1 (en) 2021-07-05 2022-06-23 Block synchronization method, and method for making node join blockchain network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110757863.3A CN113206893B (en) 2021-07-05 2021-07-05 Method for block synchronization and node joining block chain network

Publications (2)

Publication Number Publication Date
CN113206893A CN113206893A (en) 2021-08-03
CN113206893B true CN113206893B (en) 2021-09-14

Family

ID=77022765

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110757863.3A Active CN113206893B (en) 2021-07-05 2021-07-05 Method for block synchronization and node joining block chain network

Country Status (2)

Country Link
CN (1) CN113206893B (en)
WO (1) WO2023279971A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113206893B (en) * 2021-07-05 2021-09-14 支付宝(杭州)信息技术有限公司 Method for block synchronization and node joining block chain network
CN113949632B (en) * 2021-12-21 2022-06-28 北京溪塔科技有限公司 Dynamic node configuration method and device for block chain

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107231239A (en) * 2017-06-27 2017-10-03 中国联合网络通信集团有限公司 Create generation block method for anti-counterfeit and device
CN113067896A (en) * 2021-06-02 2021-07-02 支付宝(杭州)信息技术有限公司 Method for adding node in block chain sub-network and block chain system

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102250810B1 (en) * 2018-03-23 2021-05-11 블록체인랩스 주식회사 Blockchain system with consensus algorithm based on proof-of -transaction and method there of
KR102024694B1 (en) * 2018-04-10 2019-09-24 주식회사 에이비씨 Decentralized service platform using multiple service nodes based on block chain
CN109302311B (en) * 2018-09-04 2020-08-14 北京邮电大学 Block chain network for realizing network situation awareness, awareness method and electronic equipment
US10949548B2 (en) * 2018-10-18 2021-03-16 Verizon Patent And Licensing Inc. Systems and methods for providing multi-node resiliency for blockchain peers
CN110868386B (en) * 2019-05-17 2022-05-20 北京安妮全版权科技发展有限公司 Block chain consensus method
CN110300171B (en) * 2019-06-28 2022-04-15 深圳市元征科技股份有限公司 Information acquisition method, system, computer readable storage medium and electronic device
CN110727731B (en) * 2019-09-05 2021-12-21 创新先进技术有限公司 Method for adding node in block chain network and block chain system
CN110855777B (en) * 2019-11-12 2022-09-13 腾讯科技(深圳)有限公司 Node management method and device based on block chain
CN112055077B (en) * 2020-09-02 2023-04-18 杭州复杂美科技有限公司 Block link access method, device and storage medium
CN113067894B (en) * 2021-06-02 2021-09-24 支付宝(杭州)信息技术有限公司 Method for node to exit block chain sub-network
CN113206893B (en) * 2021-07-05 2021-09-14 支付宝(杭州)信息技术有限公司 Method for block synchronization and node joining block chain network

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107231239A (en) * 2017-06-27 2017-10-03 中国联合网络通信集团有限公司 Create generation block method for anti-counterfeit and device
CN113067896A (en) * 2021-06-02 2021-07-02 支付宝(杭州)信息技术有限公司 Method for adding node in block chain sub-network and block chain system

Also Published As

Publication number Publication date
WO2023279971A1 (en) 2023-01-12
CN113206893A (en) 2021-08-03

Similar Documents

Publication Publication Date Title
CN110471984B (en) Service processing method and device based on block chain and electronic equipment
CN113067904B (en) Method for building block chain sub-network and block chain system
CN110458631B (en) Bill number distribution method and device based on block chain and electronic equipment
CN113206893B (en) Method for block synchronization and node joining block chain network
CN113067900B (en) Intelligent contract deployment method and device
CN113327165A (en) Transaction method based on block chain
CN113067897B (en) Cross-chain interaction method and device
CN111753335A (en) Editing method and device for block content
CN113098983B (en) Task execution method and device based on intelligent contract
CN112400182A (en) Method and device for executing intelligent contracts in block chain and electronic equipment
CN113506111A (en) Entity article ownership registration method and device based on block chain
CN113067914B (en) Method and device for distributing subnet identification, electronic equipment and storage medium
CN113326290B (en) Cross-network query control method
CN113067896B (en) Method for adding node in block chain sub-network and block chain system
CN113259464B (en) Method for building block chain sub-network and block chain system
CN113259458B (en) Method and device for starting/closing block link point service
CN113259462B (en) Block chain message distribution method and device
CN113259119B (en) Block chain message distribution method and device
CN113067774B (en) Transaction forwarding method between block chain networks
CN113259236B (en) Transaction forwarding method between block chain networks
CN115086338A (en) Block chain subnet building method and device
CN114146415A (en) Game element transaction method and device based on block chain
CN113469811A (en) Block chain transaction processing method and device
CN113469847A (en) Method for updating creation relation of copyright of works
CN114297171A (en) Account data reading and writing method and device

Legal Events

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