TWI629883B - Node list maintenance system based on blockchain and method thereof - Google Patents

Node list maintenance system based on blockchain and method thereof Download PDF

Info

Publication number
TWI629883B
TWI629883B TW105142869A TW105142869A TWI629883B TW I629883 B TWI629883 B TW I629883B TW 105142869 A TW105142869 A TW 105142869A TW 105142869 A TW105142869 A TW 105142869A TW I629883 B TWI629883 B TW I629883B
Authority
TW
Taiwan
Prior art keywords
node
list
blockchain
nodes
block
Prior art date
Application number
TW105142869A
Other languages
Chinese (zh)
Other versions
TW201824818A (en
Inventor
林祐德
謝宏濤
陳政浩
陳岱鈴
Original Assignee
現代財富控股有限公司
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 現代財富控股有限公司 filed Critical 現代財富控股有限公司
Priority to TW105142869A priority Critical patent/TWI629883B/en
Publication of TW201824818A publication Critical patent/TW201824818A/en
Application granted granted Critical
Publication of TWI629883B publication Critical patent/TWI629883B/en

Links

Abstract

一種基於區塊鏈的節點清單維護系統及其方法,透過智能合約將節點清單儲存在區塊鏈,並且在節點加入區塊鏈網路之前,使用預設的靜態節點清單與區塊鏈網路連結,當節點加入區塊鏈網路之後,持續根據合約地址讀取區塊鏈中的節點清單,並且將節點清單的內容儲存至清單陣列,以便根據清單陣列的節點識別碼連結所有節點,並且維護每一節點之間的連線,用以在認許制(Permissioned)的區塊鏈環境下,提高節點的擴充便利性之技術功效。A blockchain-based node list maintenance system and method thereof, storing a node list in a blockchain through a smart contract, and using a preset static node list and a blockchain network before the node joins the blockchain network Linking, after the node joins the blockchain network, continuously reads the list of nodes in the blockchain according to the contract address, and stores the contents of the node list to the list array to link all the nodes according to the node identifier of the list array, and Maintain the connection between each node to improve the technical convenience of the node's expansion convenience in the Permissioned blockchain environment.

Description

基於區塊鏈的節點清單維護系統及其方法Node list maintenance system based on blockchain and method thereof

本發明涉及一種維護系統及其方法,特別是在認許制的區塊鏈環境下,以區塊鏈儲存節點清單,使節點根據節點清單連結所有節點,用以維護每一節點之間的連線之基於區塊鏈的節點清單維護系統及其方法。The invention relates to a maintenance system and a method thereof, in particular, in a blockchain environment of a privileged system, a blockchain storage node list is used, so that a node connects all nodes according to a node list to maintain a connection between each node. A block-based node list maintenance system and method thereof for a line.

近年來,隨著區塊鏈技術的普及與蓬勃發展,各種基於區塊鏈的應用便如雨後春筍般出現,其中,又以認許制的區塊鏈最受金融業矚目。In recent years, with the popularization and vigorous development of blockchain technology, various blockchain-based applications have sprung up. Among them, the blockchain with recognition system is the most popular in the financial industry.

一般而言,認許制的區塊鏈會先取得整個區塊鏈網路的節點之網路位址,假設有十個節點,便預先取得十個網路位址。接下來為各節點產生一組金鑰對(Key Pair)且利用公鑰產生對應的節點識別碼,以「Ethereum」為例,節點識別碼是透過公鑰、網路地址及服務的通訊埠來產生,如節點識別碼為:「enode://f3bb48a3adf47226eeea89d08915e6d84b62797b5b67e48abb41b3c05c064dcfbe1922775103d7672fa8e122fe50c82baf136666816a360c579f0ad18f61a686@52.78.19.221:30303」。因此,在十個節點的情況下,就會先產生十個節點識別碼。接著,各節點在指定的網路位址上,使用相應的私鑰執行區塊鏈程式,例如:「Ethereum」的「Geth」。各節點會將節點搜尋功能(Node Discovery)關閉,並且使用節點資料作為靜態節點清單(Static Node List)。然而,此一方式在新增節點的情況下,需要逐一更新區塊鏈網路內的各節點之靜態節點清單,當節點數目眾多時,需要耗費大量時間才能完成新增節點,因此,具有節點擴充不便的問題。In general, the occupant blockchain will first obtain the network address of the node of the entire blockchain network. Assuming ten nodes, ten network addresses are obtained in advance. Next, a set of key pairs is generated for each node and a corresponding node identifier is generated by using the public key. Taking "Ethereum" as an example, the node identifier is communicated through the public key, the network address, and the service. Generated, for example, the node identification code is: "enode://f3bb48a3adf47226eeea89d08915e6d84b62797b5b67e48abb41b3c05c064dcfbe1922775103d7672fa8e122fe50c82baf136666816a360c579f0ad18f61a686@52.78.19.221:30303". Therefore, in the case of ten nodes, ten node identification codes are generated first. Then, each node executes the blockchain program using the corresponding private key on the specified network address, for example, "Geth" of "Ethereum". Each node will turn off the node discovery function (Node Discovery) and use the node data as a static node list. However, in the case of adding a new node, it is necessary to update the static node list of each node in the blockchain network one by one. When the number of nodes is large, it takes a lot of time to complete the newly added node, and therefore, has a node. The problem of inconvenient expansion.

綜上所述,可知先前技術中長期以來一直存在節點擴充不便之問題,因此實有必要提出改進的技術手段,來解決此一問題。In summary, it can be seen that there has been a problem of inconvenient node expansion in the prior art, and it is therefore necessary to propose an improved technical means to solve this problem.

本發明揭露一種基於區塊鏈的節點清單維護系統及其方法。The invention discloses a blockchain-based node list maintenance system and a method thereof.

首先,本發明揭露一種基於區塊鏈的節點清單維護系統,此系統包含:節點及管理節點。在節點的部分,多個節點組成區塊鏈網路,每一節點具有相同內容的區塊鏈且包含:生成模組、讀取模組及連線模組。其中,生成模組用以持續根據交易生成區塊,並且在此區塊通過所述節點驗證後,將此區塊連結在區塊鏈的尾端,以及所述節點於初始時,根據預設的創世區塊定義檔產生創世區塊以作為區塊鏈的頭端,並且同時在創世區塊中產生智能合約以記錄節點清單,此智能合約包含預先設定的合約位址;讀取模組用以持續根據合約地址讀取區塊鏈中的節點清單,並且將此節點清單的內容儲存至清單陣列,所述清單陣列包含每一節點的節點識別碼;以及連線模組用以在加入區塊鏈網路之前,通過預設的靜態節點清單與區塊鏈網路連結,當加入區塊鏈網路且更新區塊鏈之後,根據清單陣列的節點識別碼連結所有節點,並且維護每一節點之間的連線。在管理節點的部分,所述管理節點用以連結區塊鏈網路且預先儲存每一節點的網路位址及一組金鑰對,並且根據網路位址及此組金鑰對產生對應每一節點的節點識別碼,以及使用特許帳號將每一節點的節點識別碼儲存至區塊鏈以更新節點清單。First, the present invention discloses a blockchain-based node list maintenance system, which includes: a node and a management node. In the node part, a plurality of nodes form a blockchain network, and each node has a blockchain of the same content and includes: a generating module, a reading module, and a connecting module. The generating module is configured to continuously generate a block according to the transaction, and after the block is verified by the node, the block is connected to the end of the block chain, and the node is initially preset according to the preset The creation block definition file generates the creation block as the head end of the blockchain, and at the same time generates a smart contract in the creation block to record the node list. The smart contract contains the preset contract address; Reading the list of nodes in the blockchain continuously according to the contract address, and storing the contents of the list of nodes to the list array, the list array containing the node identification code of each node; and the connection module for the joining area Before the blockchain network, the preset static node list is connected with the blockchain network. After joining the blockchain network and updating the blockchain, all nodes are connected according to the node identifier of the list array, and each node is maintained. The connection between the nodes. In a part of the management node, the management node is configured to connect to the blockchain network and pre-store each network address and a set of key pairs of each node, and generate corresponding correspondence according to the network address and the pair of key pairs. The node identification code of each node, and the node identification code of each node is stored to the blockchain using the privileged account to update the node list.

另外,本發明揭露一種基於區塊鏈的節點清單維護方法,其步驟包括:提供節點用以組成區塊鏈網路,每一節點具有相同內容的區塊鏈,以及提供管理節點用以連結區塊鏈網路且預先儲存每一節點的網路位址及一組金鑰對;所述節點於初始時,根據預設的創世區塊定義檔產生創世區塊以作為區塊鏈的頭端,並且同時在創世區塊中產生智能合約以記錄節點清單,此智能合約包含預先設定的合約位址,以及持續根據交易生成區塊,並且在此區塊通過所述節點驗證後,將此區塊連結在區塊鏈的尾端;管理節點根據預設的通訊埠、網路位址及此組金鑰對產生對應每一節點的節點識別碼,以及使用特許帳號將每一節點的節點識別碼儲存至區塊鏈以更新節點清單;所述節點在加入區塊鏈網路之前,通過預設的靜態節點清單與區塊鏈網路連結,當加入區塊鏈網路且更新區塊鏈之後,所述節點持續根據合約地址讀取區塊鏈中的節點清單,並且將節點清單的內容儲存至清單陣列;所述節點根據清單陣列的節點識別碼連結所有節點,並且維護每一節點之間的連線。In addition, the present invention discloses a blockchain-based node list maintenance method, the steps comprising: providing a node to form a blockchain network, each node having a blockchain of the same content, and providing a management node for connecting the zone a blockchain network and pre-storing a network address of each node and a set of key pairs; the node initially generates a creation block as a head end of the block chain according to a preset creation block definition file And simultaneously generate a smart contract in the creation block to record the list of nodes, the smart contract contains a pre-set contract address, and the block is generated continuously according to the transaction, and after the block is verified by the node, the area is The block is connected at the end of the blockchain; the management node generates a node identifier corresponding to each node according to the preset communication port, the network address and the pair of key pairs, and identifies the node of each node by using the license account. The code is stored in the blockchain to update the node list; the node is connected to the blockchain network through a preset static node list before joining the blockchain network, when joining the blockchain network After updating the blockchain, the node continuously reads the list of nodes in the blockchain according to the contract address, and stores the contents of the node list to the inventory array; the node links all nodes according to the node identifier of the list array, and maintains The connection between each node.

本發明所揭露之系統與方法如上,與先前技術的差異在於本發明是透過智能合約將節點清單儲存在區塊鏈,並且在節點加入區塊鏈網路之前,使用預設的靜態節點清單與區塊鏈網路連結,當節點加入區塊鏈網路之後,持續根據合約地址讀取區塊鏈中的節點清單,並且將節點清單的內容儲存至清單陣列,以便根據清單陣列的節點識別碼連結所有節點,並且維護每一節點之間的連線。The system and method disclosed by the present invention are as above, and the difference from the prior art is that the present invention stores a node list in a blockchain through a smart contract, and uses a preset static node list before the node joins the blockchain network. The blockchain network is connected. After the node joins the blockchain network, the node list in the blockchain is continuously read according to the contract address, and the contents of the node list are stored in the list array so as to be based on the node identifier of the list array. Link all nodes and maintain the connection between each node.

透過上述的技術手段,本發明可以在認許制的區塊鏈環境下,達成提高節點的擴充便利性之技術功效。Through the above technical means, the present invention can achieve the technical effect of improving the convenience of the node expansion in the blockchain environment of the approved system.

以下將配合圖式及實施例來詳細說明本發明之實施方式,藉此對本發明如何應用技術手段來解決技術問題並達成技術功效的實現過程能充分理解並據以實施。The embodiments of the present invention will be described in detail below with reference to the drawings and embodiments, so that the application of the technical means to solve the technical problems and achieve the technical effects can be fully understood and implemented.

在說明本發明所揭露之基於區塊鏈的節點清單維護系統及其方法之前,先對本發明所自行定義的名詞作說明,本發明所述的管理節點是指權責單位的計算機裝置,負責管理區塊鏈網路的所有節點,包含設定網路位置、金鑰對(即:一對相對應的公鑰及私鑰)及節點識別碼,並且具有特許帳號能夠更新區塊鏈的節點清單。另外,所述清單陣列是指用以儲存從區塊鏈中讀取到的節點清單的記憶體空間,換句話說,清單陣列的內容是可以變化的,可視為一個變數。Before describing the blockchain-based node list maintenance system and the method thereof disclosed in the present invention, the nouns defined by the present invention are first described. The management node according to the present invention refers to a computer device of the authority unit, which is responsible for management. All nodes of the blockchain network include a network location, a key pair (ie, a pair of corresponding public and private keys), and a node identifier, and a list of nodes that the privileged account can update the blockchain. In addition, the list array refers to a memory space for storing a list of nodes read from the blockchain. In other words, the contents of the list array are changeable and can be regarded as a variable.

以下配合圖式對本發明基於區塊鏈的節點清單維護系統及其方法做進一步說明,請先參閱「第1圖」,「第1圖」為本發明基於區塊鏈的節點清單維護系統之系統方塊圖,此系統包含:節點110及管理節點120。在節點110的部分,多個節點110組成區塊鏈網路100,每一節點110具有相同內容的區塊鏈且包含:生成模組111、讀取模組112及連線模組113。其中,生成模組111用以持續根據交易生成區塊(Block),並且在此區塊通過所述節點110驗證後,將此區塊連結在區塊鏈的尾端,以及所述節點110於初始時,根據預設的創世區塊定義檔產生創世區塊(Genesis block)以作為區塊鏈的頭端,並且同時在創世區塊中產生智能合約以記錄節點清單,此智能合約包含預先設定的合約位址。在實際實施上,假設有新的節點清單產生,可透過交易方式生成包含節點清單的區塊,並且在此區塊通過驗證後,將此區塊連結至區塊鏈的尾端,往後,節點110透過合約地址讀取節點清單時,將從最後生成的包含節點清單的區塊來進行讀取。另外,在實際實施上,可利用創世區塊定義檔設定更新智能合約的權限,例如:透過在創世區塊定義檔「genesis.json」中,設定可更新節點清單的帳號,例如:「0x1a9afb711302c5f83b5902843d1c007a1a137632」(即:特許帳號)。特別要說明的是,智能合約可記錄至少一個擁有者(以如上的帳號方式記錄),當所述節點110擁有特許帳號時,即成為智能合約的擁有者,允許發送交易去變更節點清單的內容,在實際實施上,至少需要預先設定一個特許帳號在「genesis.json」中,以避免之後無法變更節點清單的內容。The following is a description of the blockchain-based node list maintenance system and the method thereof according to the following drawings. Please refer to "FIG. 1" first, and "FIG. 1" is the system of the blockchain-based node list maintenance system of the present invention. Block diagram, this system includes: node 110 and management node 120. In the portion of the node 110, the plurality of nodes 110 form a blockchain network 100. Each node 110 has a blockchain of the same content and includes a generation module 111, a reading module 112, and a connection module 113. The generating module 111 is configured to continuously generate a block according to the transaction, and after the block is verified by the node 110, the block is connected to the end of the blockchain, and the node 110 is Initially, a Genesis block is generated as a head end of the blockchain according to a preset creation block definition file, and at the same time, a smart contract is generated in the creation block to record a node list, and the smart contract includes a preset Contract address. In actual implementation, a new node list is generated, and a block containing a node list can be generated by a transaction method, and after the block is verified, the block is linked to the end of the block chain, and then When the node 110 reads the node list through the contract address, it will read from the last generated block containing the node list. In addition, in actual implementation, the authority to update the smart contract can be set by using the creation block definition file, for example, by setting the account of the list of updateable nodes in the creation block definition file "genesis.json", for example: "0x1a9afb711302c5f83b5902843d1c007a1a137632" (ie: franchise account). In particular, the smart contract can record at least one owner (recorded in the above account mode), and when the node 110 owns the license account, it becomes the owner of the smart contract, allowing the transaction to be sent to change the contents of the node list. In actual implementation, at least one privileged account number needs to be preset in "genesis.json" to avoid the possibility of changing the contents of the node list afterwards.

讀取模組112用以持續根據合約地址讀取區塊鏈中的節點清單,並且將此節點清單的內容儲存至清單陣列,所述清單陣列包含每一節點110的節點識別碼。在實際實施上,節點110在讀取節點清單之後,當節點清單的內容與所述節點110的清單陣列之內容相同時,取消將節點清單的內容儲存至清單陣列。如此一來,可以節省將節點清單的內容儲存至清單陣列所耗費的轉換及處理時間,進而增加執行效率。The reading module 112 is configured to continuously read the list of nodes in the blockchain according to the contract address and store the contents of the list of nodes to the inventory array, the list array containing the node identification code of each node 110. In practical implementation, after reading the node list, the node 110 cancels storing the content of the node list to the list array when the content of the node list is the same as the content of the list array of the node 110. In this way, the conversion and processing time spent storing the contents of the node list to the list array can be saved, thereby increasing the execution efficiency.

連線模組113用以在加入區塊鏈網路100之前,通過預設的靜態節點清單與區塊鏈網路100連結,當加入區塊鏈網路100且更新區塊鏈之後,根據清單陣列的節點識別碼連結所有節點110,並且維護每一節點110之間的連線。所述維護每一節點110之間的連線包含中斷與已被刪除的所述節點110的連線,以及建立與新增的所述節點110的連線。在實際實施上,節點110為第一個節點時,預設的靜態節點清單可為空值(Null),第一個節點之後的所述節點110,其預設的靜態節點清單可為區塊鏈網路100中的所述節點110至少其中之一,甚至亦可直接設為管理節點120的節點識別碼。The connection module 113 is used to connect to the blockchain network 100 through a preset static node list before joining the blockchain network 100. After joining the blockchain network 100 and updating the blockchain, according to the list The node identification code of the array links all nodes 110 and maintains the connection between each node 110. The maintaining the connection between each node 110 includes disconnecting the connection with the node 110 that has been deleted, and establishing a connection with the newly added node 110. In actual implementation, when the node 110 is the first node, the preset static node list may be a null value (Null), and the node 110 after the first node may have a preset static node list as a block. At least one of the nodes 110 in the chain network 100 may even be directly set as the node identification code of the management node 120.

在管理節點120的部分,所述管理節點120用以連結區塊鏈網路100且預先儲存每一節點110的網路位址及一組金鑰對,並且根據網路位址及此組金鑰對產生對應每一節點110的節點識別碼,假設產生的節點識別碼為:「enode://f3bb48a3adf47226eeea89d08915e6d84b62797b5b67e48abb41b3c05c064dcfbe1922775103d7672fa8e122fe50c82baf136666816a360c579f0ad18f61a686@52.78.19.221:30303」。在此例的節點識別碼中,使用的金鑰為「f3bb48a3adf47226eeea89d08915e6d84b62797b5b67e48abb41b3c05c064dcfbe1922775103d7672fa8e122fe50c82baf136666816a360c579f0ad18f61a686」、網路位址為「52.78.19.221」及通訊埠為「30303」。另外,管理節點120會使用特許帳號將每一節點110的節點識別碼儲存至區塊鏈以更新節點清單。如此一來,無論新增的新節點或既有的舊節點,皆可待區塊鏈更新完成後,從最新的節點清單中取得節點識別碼,並且根據節點識別碼進行新增(建立)或刪除(中斷)節點連線,無需逐一手動更新在各節點的靜態節點清單,即可自動將每一節點110之間的連線維護在最新狀態。In the portion of the management node 120, the management node 120 is configured to connect to the blockchain network 100 and pre-store the network address and a set of key pairs of each node 110, and according to the network address and the group of gold The key pair generates a node identification code corresponding to each node 110, assuming that the generated node identification code is: "enode://f3bb48a3adf47226eeea89d08915e6d84b62797b5b67e48abb41b3c05c064dcfbe1922775103d7672fa8e122fe50c82baf136666816a360c579f0ad18f61a686@52.78.19.221:30303". In the node identification code of this example, the key used is "f3bb48a3adf47226eeea89d08915e6d84b62797b5b67e48abb41b3c05c064dcfbe1922775103d7672fa8e122fe50c82baf136666816a360c579f0ad18f61a686", the network address is "52.78.19.221", and the communication port is "30303". In addition, the management node 120 stores the node identification code of each node 110 to the blockchain using the privileged account to update the node list. In this way, regardless of the newly added new node or the existing old node, after the blockchain update is completed, the node identification code is obtained from the latest node list, and the node identification code is added (established) or Deleting (interrupting) node connections eliminates the need to manually update the static node list at each node, and automatically maintains the connection between each node 110 in the latest state.

特別要說明的是,所述節點110及管理節點120皆為具有網路連線能力且透過網路相互連接的計算機裝置。舉例來說,其可為伺服器、電腦主機等等。另外,所述管理節點120可視為在區塊鏈網路100中的一個節點,其與節點110的差異僅在於管理節點120會預先儲存每一節點110的網路位址及一組金鑰對,以及能夠產生每一節點110的節點識別碼並儲存至區塊鏈以更新節點清單。In particular, the node 110 and the management node 120 are computer devices having network connection capabilities and interconnected through a network. For example, it can be a server, a computer host, or the like. In addition, the management node 120 can be regarded as a node in the blockchain network 100, which differs from the node 110 only in that the management node 120 pre-stores the network address and a set of key pairs of each node 110. And the node identification code of each node 110 can be generated and stored in the blockchain to update the node list.

接著,請參閱「第2圖」,「第2圖」為本發明基於區塊鏈的節點清單維護方法之方法流程圖,其步驟包括:提供節點110用以組成區塊鏈網路100,每一節點110具有相同內容的區塊鏈,以及提供管理節點120用以連結區塊鏈網路100且預先儲存每一節點110的網路位址及一組金鑰對(步驟210);所述節點110於初始時,根據預設的創世區塊定義檔產生創世區塊以作為區塊鏈的頭端,並且同時在創世區塊中產生智能合約以記錄節點清單,此智能合約包含預先設定的合約位址,以及持續根據交易生成區塊,並且在此區塊通過所述節點110驗證後,將此區塊連結在區塊鏈的尾端(步驟220);管理節點120根據網路位址及此組金鑰對產生對應每一節點110的節點識別碼,以及使用特許帳號將每一節點110的節點識別碼儲存至區塊鏈以更新節點清單(步驟230);所述節點110在加入區塊鏈網路100之前,通過預設的靜態節點清單與區塊鏈網路100連結,當加入區塊鏈網路100且更新區塊鏈之後,所述節點110持續根據合約地址讀取區塊鏈中的節點清單,並且將節點清單的內容儲存至清單陣列(步驟240);所述節點根據清單陣列的節點識別碼連結所有節點,並且維護每一節點110之間的連線(步驟250)。透過上述步驟,即可透過智能合約將節點清單儲存在區塊鏈,並且在節點110加入區塊鏈網路100之前,使用預設的靜態節點清單與區塊鏈網路100連結,當節點110加入區塊鏈網路100之後,持續根據合約地址讀取區塊鏈中的節點清單,並且將節點清單的內容儲存至清單陣列,以便根據清單陣列的節點識別碼連結所有節點110,並且維護每一節點110之間的連線。Next, please refer to "FIG. 2", which is a flowchart of a method for maintaining a node list based on a blockchain according to the present invention. The steps include: providing a node 110 for forming a blockchain network 100, each A node 110 has a blockchain of the same content, and provides a management node 120 for connecting to the blockchain network 100 and pre-storing the network address of each node 110 and a set of key pairs (step 210); At initial stage, node 110 generates a creation block as a head end of the blockchain according to a preset creation block definition file, and simultaneously generates a smart contract in the creation zone to record a node list, the smart contract including a preset The contract address, and the block is continuously generated according to the transaction, and after the block is verified by the node 110, the block is linked at the end of the blockchain (step 220); the management node 120 is based on the network address. And the set of key pairs generates a node identification code corresponding to each node 110, and stores the node identification code of each node 110 to the blockchain using a privileged account to update the node list (step 230); the node 110 is joining Before the blockchain network 100, it is connected to the blockchain network 100 through a preset static node list. After joining the blockchain network 100 and updating the blockchain, the node 110 continues to read the block according to the contract address. a list of nodes in the chain, and storing the contents of the list of nodes to the inventory array (step 240); the nodes concatenate all nodes according to the node identification code of the inventory array and maintain a connection between each node 110 (step 250) . Through the above steps, the node list can be stored in the blockchain through the smart contract, and before the node 110 joins the blockchain network 100, the node is connected to the blockchain network 100 using a preset static node list. After joining the blockchain network 100, the list of nodes in the blockchain is continuously read according to the contract address, and the contents of the node list are stored to the list array to link all the nodes 110 according to the node identifier of the list array, and each is maintained. A connection between a node 110.

以下配合「第3圖」及「第4圖」以實施例的方式進行如下說明,請先參閱「第3圖」,「第3圖」為應用本發明新增節點的節點清單變化之示意圖。假設節點110根據合約地址讀取區塊鏈上的節點清單,節點110會將讀取到的節點清單之內容儲存在清單陣列,其內容如陣列311所示意。在新節點加入區塊鏈網路100之前,管理節點120會根據預先儲存的新節點之網路位址、金鑰對及通訊埠產生相應的節點識別碼320,接著,管理節點120會透過特許帳號更新區塊鏈的節點清單。至於在新節點的部分,新節點在加入區塊鏈網路100之前,會通過預設的靜態節點清單與區塊鏈網路100連結以加入區塊鏈網路100,並且在加入區塊鏈網路100之後,新節點會更新自己本身的區塊鏈,當區塊鏈網路100中的所有節點110皆完成區塊鏈的更新後,節點110從區塊鏈上讀取到的節點清單之內容同樣儲存在清單陣列中,此時,其清單陣列的內容如陣列312所示意。如此一來,所有節點110即可讀取最新節點清單以儲存至自己本身的清單陣列,以便自動維護各節點110之間的連線。The following description will be made by way of example with reference to "Fig. 3" and "Fig. 4". Please refer to "3rd figure" and "3rd figure" as a schematic diagram of the change of the node list of the newly added node of the present invention. Assuming node 110 reads a list of nodes on the blockchain based on the contract address, node 110 stores the contents of the list of read nodes in a list array, the contents of which are illustrated by array 311. Before the new node joins the blockchain network 100, the management node 120 generates a corresponding node identifier 320 according to the network address, key pair and communication port of the new node stored in advance, and then the management node 120 passes the license. The list of nodes for the account update blockchain. As for the new node, the new node joins the blockchain network 100 through the preset static node list to join the blockchain network 100 before joining the blockchain network 100, and joins the blockchain. After the network 100, the new node updates its own blockchain. When all the nodes 110 in the blockchain network 100 complete the update of the blockchain, the node 110 reads the list of nodes from the blockchain. The content is also stored in the inventory array, at which point the contents of its inventory array are as illustrated by array 312. In this way, all nodes 110 can read the latest node list for storage to their own inventory array to automatically maintain the connections between the various nodes 110.

如「第4圖」所示意,「第4圖」為應用本發明刪除節點的節點清單變化之示意圖。假設管理節點120欲刪除一個節點(具有節點識別碼420),其可透過特許帳號,如:「0x1a9afb711302c5f83b5902843d1c007a1a137632」更新區塊鏈的節點清單。當區塊鏈中的各節點110更新區塊鏈並且讀取最新的節點清單後,倘若發現在區塊鏈中讀取到的節點清單與本身的清單陣列的內容(其內容如陣列411所示意)不同時,節點110會將節點清單的內容重新儲存至清單陣列,其內容如陣列412所示意。此時,即完成清單陣列的內容更新,接著,節點110會根據新的清單陣列之內容維護每一節點110之間的連線,在此例中,由於刪除了一個節點識別碼420,所以新的清單陣列之內容不會有節點識別碼420,因此,所有節點110皆會中斷與具有節點識別碼420的節點之連線。As shown in "Fig. 4", "Fig. 4" is a schematic diagram showing changes in the list of nodes for deleting nodes by applying the present invention. It is assumed that the management node 120 wants to delete a node (with the node identification code 420), which can update the node list of the blockchain through a privileged account number, such as: "0x1a9afb711302c5f83b5902843d1c007a1a137632". When each node 110 in the blockchain updates the blockchain and reads the latest node list, it finds the list of nodes read in the blockchain and the contents of its own list array (the contents of which are represented by array 411). At the same time, node 110 will re-storage the contents of the node list to the inventory array, the contents of which are illustrated by array 412. At this point, the content update of the list array is completed. Then, the node 110 maintains the connection between each node 110 according to the content of the new list array. In this example, since a node identifier 420 is deleted, the new The contents of the manifest array do not have a node identification code 420, so all nodes 110 will be disconnected from the node having the node identification code 420.

綜上所述,可知本發明與先前技術之間的差異在於透過智能合約將節點清單儲存在區塊鏈,並且在節點加入區塊鏈網路之前,使用預設的靜態節點清單與區塊鏈網路連結,當節點加入區塊鏈網路之後,持續根據合約地址讀取區塊鏈中的節點清單,並且將節點清單的內容儲存至清單陣列,以便根據清單陣列的節點識別碼連結所有節點,並且維護每一節點之間的連線,藉由此一技術手段可以解決先前技術所存在的問題,進而在認許制的區塊鏈環境下,達成提高節點的擴充便利性之技術功效。In summary, it can be seen that the difference between the present invention and the prior art is that the node list is stored in the blockchain through the smart contract, and the preset static node list and the blockchain are used before the node joins the blockchain network. The network link, after the node joins the blockchain network, continuously reads the list of nodes in the blockchain according to the contract address, and stores the contents of the node list to the list array, so as to link all the nodes according to the node identifier of the list array. And maintaining the connection between each node, by this technical means can solve the problems existing in the prior art, and in the privileged blockchain environment, the technical effect of improving the convenience of the node expansion is achieved.

雖然本發明以前述之實施例揭露如上,然其並非用以限定本發明,任何熟習相像技藝者,在不脫離本發明之精神和範圍內,當可作些許之更動與潤飾,因此本發明之專利保護範圍須視本說明書所附之申請專利範圍所界定者為準。While the present invention has been described above in the foregoing embodiments, it is not intended to limit the invention, and the invention may be modified and modified without departing from the spirit and scope of the invention. The scope of patent protection shall be subject to the definition of the scope of the patent application attached to this specification.

100 區塊鏈網路 110 節點 111 生成模組 112 讀取模組 113 連線模組 120 管理節點 311、312 陣列 320 節點識別碼 411、412 陣列 420 節點識別碼 步驟210 提供多個節點用以組成一區塊鏈網路,每一節點具有相同內容的一區塊鏈,以及提供一管理節點用以連結該區塊鏈網路且預先儲存每一節點的一網路位址及一組金鑰對 步驟220 所述節點於初始時,根據預設的創世區塊定義檔產生一創世區塊以作為該區塊鏈的頭端,並且同時在該創世區塊中產生一智能合約以記錄一節點清單,該智能合約包含預先設定的一合約位址,以及持續根據交易生成一區塊,並且在該區塊通過所述節點驗證後,將該區塊連結在該區塊鏈的尾端 步驟230 該管理節點根據預設的一通訊埠、該網路位址及該組金鑰對產生對應每一節點的一節點識別碼,以及使用一特許帳號將每一節點的該節點識別碼儲存至該區塊鏈以更新該節點清單 步驟240 所述節點在加入該區塊鏈網路之前,通過預設的一靜態節點清單與該區塊鏈網路連結,當加入該區塊鏈網路且更新該區塊鏈之後,所述節點持續根據該合約地址讀取該區塊鏈中的該節點清單,並且將該節點清單的內容儲存至一清單陣列 步驟250 所述節點根據該清單陣列的該節點識別碼連結所有節點,並且維護每一節點之間的連線100 blockchain network 110 node 111 generation module 112 read module 113 connection module 120 management node 311, 312 array 320 node identification code 411, 412 array 420 node identification code step 210 provides multiple nodes to form a blockchain network, each node having a blockchain of the same content, and a management node for connecting the blockchain network and pre-storing a network address and a set of keys for each node And in the initial step, the node generates a creation block according to the preset creation block definition file as the head end of the block chain, and simultaneously generates a smart contract in the creation zone to record a node. In the list, the smart contract includes a predetermined contract address, and a block is continuously generated according to the transaction, and after the block is verified by the node, the block is linked at the end of the block chain. The management node generates a node corresponding to each node according to a preset communication port, the network address, and the pair of key pairs. An identification code, and storing the node identification code of each node to the blockchain to update the node list using a privileged account. Step 240: The node passes a preset static node before joining the blockchain network. The list is linked to the blockchain network. After joining the blockchain network and updating the blockchain, the node continuously reads the list of nodes in the blockchain according to the contract address, and the node is The contents of the manifest are stored in a list array step 250. The node links all nodes according to the node identifier of the list array, and maintains the connection between each node.

第1圖為本發明基於區塊鏈的節點清單維護系統之系統方塊圖。 第2圖為本發明基於區塊鏈的節點清單維護方法之方法流程圖。 第3圖為應用本發明新增節點的節點清單變化之示意圖。 第4圖為應用本發明刪除節點的節點清單變化之示意圖。FIG. 1 is a system block diagram of a node list maintenance system based on a blockchain according to the present invention. FIG. 2 is a flow chart of a method for maintaining a node list based on a blockchain according to the present invention. Figure 3 is a schematic diagram showing changes in the list of nodes to which the new node of the present invention is applied. Figure 4 is a schematic diagram showing the change of the node list of the deleted node by applying the present invention.

Claims (10)

一種基於區塊鏈的節點清單維護系統,該系統包含: 多個節點,用以組成一區塊鏈網路,每一節點具有相同內容的一區塊鏈且包含: 一生成模組,用以持續根據交易生成一區塊,並且在該區塊通過所述節點驗證後,將該區塊連結在該區塊鏈的尾端,以及所述節點於初始時,根據預設的創世區塊定義檔產生一創世區塊以作為該區塊鏈的頭端,並且同時在該創世區塊中產生一智能合約以記錄一節點清單,該智能合約包含預先設定的一合約位址; 一讀取模組,用以持續根據該合約地址讀取該區塊鏈中的該節點清單,並且將該節點清單的內容儲存至一清單陣列,該清單陣列包含每一節點的一節點識別碼;以及 一連線模組,用以在加入該區塊鏈網路之前,通過預設的一靜態節點清單與該區塊鏈網路連結,當加入該區塊鏈網路且更新該區塊鏈之後,根據該清單陣列的該節點識別碼連結所有節點,並且維護每一節點之間的連線;以及 一管理節點,用以連結該區塊鏈網路且預先儲存每一節點的一網路位址及一組金鑰對,並且根據預設的一通訊埠、該網路位址及該組金鑰對產生對應每一節點的一節點識別碼,以及使用一特許帳號將每一節點的該節點識別碼儲存至該區塊鏈以更新該節點清單。A blockchain-based node list maintenance system, the system comprising: a plurality of nodes for forming a blockchain network, each node having a blockchain of the same content and comprising: a generating module for Continuing to generate a block according to the transaction, and after the block is verified by the node, the block is linked at the end of the block chain, and the node is initially defined according to a preset creation block. The file generates a creation block as the head end of the blockchain, and simultaneously generates a smart contract in the creation block to record a list of nodes, the smart contract includes a predetermined contract address; a group for continuously reading the list of nodes in the blockchain according to the contract address, and storing the contents of the list of nodes to a list array, the list array including a node identifier of each node; and a connection a line module, configured to connect to the blockchain network through a preset static node list before joining the blockchain network, after joining the blockchain network and updating the blockchain, according to Clear The node identifier of a single array links all nodes and maintains a connection between each node; and a management node for connecting the blockchain network and pre-storing a network address of each node and a Grouping a key pair, and generating a node identification code corresponding to each node according to a preset communication port, the network address and the pair of key pairs, and using the privileged account to set the node identification code of each node Save to the blockchain to update the list of nodes. 根據申請專利範圍第1項之基於區塊鏈的節點清單維護系統,其中所述節點讀取該節點清單後,當該節點清單的內容與所述節點的該清單陣列的內容相同時,取消將該節點清單的內容儲存至該清單陣列。The blockchain-based node list maintenance system according to claim 1, wherein after the node reads the node list, when the content of the node list is the same as the content of the list array of the node, canceling The contents of the list of nodes are stored to the list array. 根據申請專利範圍第1項之基於區塊鏈的節點清單維護系統,其中維護每一節點之間的連線包含中斷與已被刪除的所述節點的連線,以及建立與新增的所述節點的連線。A blockchain-based node list maintenance system according to claim 1, wherein maintaining a connection between each node includes disconnecting the connection with the node that has been deleted, and establishing and adding the new The connection of the node. 根據申請專利範圍第1項之基於區塊鏈的節點清單維護系統,其中該智能合約記錄至少一擁有者,當所述節點為所述擁有者時,允許所述節點發送交易以更新該區塊鏈中的該節點清單。A blockchain-based node list maintenance system according to claim 1, wherein the smart contract records at least one owner, and when the node is the owner, allows the node to send a transaction to update the block A list of the nodes in the chain. 根據申請專利範圍第1項之基於區塊鏈的節點清單維護系統,其中所述節點為第一個節點時,預設的該靜態節點清單為空值,第一個節點之後的所述節點,預設的該靜態節點清單為該區塊鏈網路的所述節點至少其中之一。According to the blockchain-based node list maintenance system of claim 1, wherein the node is the first node, the preset static node list is a null value, and the node after the first node is The preset list of static nodes is at least one of the nodes of the blockchain network. 一種基於區塊鏈的節點清單維護方法,其步驟包括: 提供多個節點用以組成一區塊鏈網路,每一節點具有相同內容的一區塊鏈,以及提供一管理節點用以連結該區塊鏈網路且預先儲存每一節點的一網路位址及一組金鑰對; 所述節點於初始時,根據預設的創世區塊定義檔產生一創世區塊以作為該區塊鏈的頭端,並且同時在該創世區塊中產生一智能合約以記錄一節點清單,該智能合約包含預先設定的一合約位址,以及持續根據交易生成一區塊,並且在該區塊通過所述節點驗證後,將該區塊連結在該區塊鏈的尾端; 該管理節點根據預設的一通訊埠、該網路位址及該組金鑰對產生對應每一節點的一節點識別碼,以及使用一特許帳號將每一節點的該節點識別碼儲存至該區塊鏈以更新該節點清單; 所述節點在加入該區塊鏈網路之前,通過預設的一靜態節點清單與該區塊鏈網路連結,當加入該區塊鏈網路且更新該區塊鏈之後,所述節點持續根據該合約地址讀取該區塊鏈中的該節點清單,並且將該節點清單的內容儲存至一清單陣列;以及 所述節點根據該清單陣列的該節點識別碼連結所有節點,並且維護每一節點之間的連線。A method for maintaining a node list based on a blockchain, the method comprising: providing a plurality of nodes to form a blockchain network, each node having a blockchain of the same content, and providing a management node for connecting the node Block network and pre-storing a network address and a set of key pairs of each node; the node initially generates a creation block according to a preset creation block definition file as the block At the head end of the chain, and simultaneously generate a smart contract in the creation block to record a list of nodes, the smart contract contains a predetermined contract address, and continuously generate a block according to the transaction, and pass through the block. After the node is verified, the block is connected to the end of the blockchain; the management node generates a node corresponding to each node according to a preset communication port, the network address, and the pair of key pairs. An identification code, and storing the node identification code of each node to the blockchain to update the node list by using a privileged account; the node clears through a preset static node before joining the blockchain network Linking to the blockchain network, after joining the blockchain network and updating the blockchain, the node continuously reads the list of nodes in the blockchain according to the contract address, and the node is The contents of the manifest are stored to an inventory array; and the node links all nodes according to the node identification code of the list array and maintains a connection between each node. 根據申請專利範圍第6項之基於區塊鏈的節點清單維護方法,其中所述節點讀取該節點清單後,當該節點清單的內容與所述節點的該清單陣列的內容相同時,取消將該節點清單的內容儲存至該清單陣列。The blockchain-based node list maintenance method according to claim 6, wherein after the node reads the node list, when the content of the node list is the same as the content of the list array of the node, the cancellation is The contents of the list of nodes are stored to the list array. 根據申請專利範圍第6項之基於區塊鏈的節點清單維護方法,其中該維護每一節點之間的連線的步驟包含中斷與已被刪除的所述節點的連線,以及建立與新增的所述節點的連線。The blockchain-based node list maintenance method according to claim 6 of the patent application scope, wherein the step of maintaining a connection between each node includes disconnecting a connection with the node that has been deleted, and establishing and adding The connection of the node. 根據申請專利範圍第6項之基於區塊鏈的節點清單維護方法,其中該智能合約記錄至少一擁有者,當所述節點為所述擁有者時,允許所述節點發送交易以更新該區塊鏈中的該節點清單。A blockchain-based node list maintenance method according to claim 6, wherein the smart contract records at least one owner, and when the node is the owner, allows the node to send a transaction to update the block A list of the nodes in the chain. 根據申請專利範圍第6項之基於區塊鏈的節點清單維護方法,其中所述節點為第一個節點時,預設的該靜態節點清單為空值,第一個節點之後的所述節點,預設的該靜態節點清單為該區塊鏈網路的所述節點至少其中之一。The blockchain-based node list maintenance method according to claim 6 of the patent application scope, wherein when the node is the first node, the preset static node list is a null value, and the node after the first node is The preset list of static nodes is at least one of the nodes of the blockchain network.
TW105142869A 2016-12-23 2016-12-23 Node list maintenance system based on blockchain and method thereof TWI629883B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW105142869A TWI629883B (en) 2016-12-23 2016-12-23 Node list maintenance system based on blockchain and method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW105142869A TWI629883B (en) 2016-12-23 2016-12-23 Node list maintenance system based on blockchain and method thereof

Publications (2)

Publication Number Publication Date
TW201824818A TW201824818A (en) 2018-07-01
TWI629883B true TWI629883B (en) 2018-07-11

Family

ID=63639909

Family Applications (1)

Application Number Title Priority Date Filing Date
TW105142869A TWI629883B (en) 2016-12-23 2016-12-23 Node list maintenance system based on blockchain and method thereof

Country Status (1)

Country Link
TW (1) TWI629883B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110581892B (en) * 2019-09-17 2022-04-01 上海保险交易所股份有限公司 Block chain based network connection and recovery mechanism
CN111131399B (en) * 2019-12-03 2021-11-26 北京海益同展信息科技有限公司 Method and device for dynamically increasing consensus nodes in block chain

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016015041A1 (en) * 2014-07-25 2016-01-28 Blockchain Technologies Corporation System and method for creating a multi-branched blockchain with configurable protocol rules
US20160191243A1 (en) * 2014-12-31 2016-06-30 William Manning Out-of-band validation of domain name system records
TW201627889A (en) * 2014-10-31 2016-08-01 21公司 Digital currency mining circuitry having shared processing logic

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016015041A1 (en) * 2014-07-25 2016-01-28 Blockchain Technologies Corporation System and method for creating a multi-branched blockchain with configurable protocol rules
TW201627889A (en) * 2014-10-31 2016-08-01 21公司 Digital currency mining circuitry having shared processing logic
US20160191243A1 (en) * 2014-12-31 2016-06-30 William Manning Out-of-band validation of domain name system records

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Hsieh Yung-chen, "Ethereum smart contract 撰寫", Taipei Ethereum Meetup, https://medium.com/taipei-ethereum-meetup/ethereum-smart-contract-%E6%92%B0%E5%AF%AB-68588a3d8358, 2016/11/18. *

Also Published As

Publication number Publication date
TW201824818A (en) 2018-07-01

Similar Documents

Publication Publication Date Title
TWI737944B (en) Block chain-based transaction execution method and device, and electronic equipment
JP6912583B2 (en) Service processing method and equipment
CN107577427B (en) data migration method, device and storage medium for blockchain system
CN108898390B (en) Intelligent contract calling method and device based on block chain and electronic equipment
US20210083856A1 (en) Improved hardware security module management
TWI737107B (en) Data processing method, device, blockchain client and blockchain node
KR102120703B1 (en) Apparatus for managing group of nodes which comprises transaction of dual signature based on group key on blockchain network and computing apparatus
CN110324399B (en) Bringing cluster awareness into a facility management portal
WO2019160128A1 (en) Method for validating transaction in blockchain network and node for configuring same network
CN110673941B (en) Migration method of micro-services in multiple computer rooms, electronic equipment and storage medium
CN113726751B (en) Weight management method, device and equipment in block chain type account book
CN110995473A (en) Service node control method and related equipment
CN110880147B (en) Transaction processing method, related equipment and computer storage medium
TWI629883B (en) Node list maintenance system based on blockchain and method thereof
JP6467540B1 (en) Method for verifying transactions in a blockchain network and nodes for configuring the network
CN110875850A (en) Firmware upgrading method and system, readable storage medium and terminal equipment
CN107391033B (en) Data migration method and device, computing equipment and computer storage medium
CN112860953A (en) Data importing method, device, equipment and storage medium of graph database
WO2016177075A1 (en) Method of checking associative relationship of service data, device and readable storage medium utilizing same
CN113077260A (en) Data access method and device based on block chain and electronic equipment
CN113010894A (en) Data processing method and device and computer readable storage medium
WO2016172948A1 (en) Routing information configuration method and apparatus
CN113949632B (en) Dynamic node configuration method and device for block chain
JP5516251B2 (en) Software installation status management apparatus, software installation status management method, and program
CN111447080B (en) Private network decentralization control method, device and computer readable storage medium