A consortium chain network establishment method and device

By employing odd-redundancy deployment of consensus nodes, multi-active deployment of ledger nodes, and separate deployment of smart contracts on a container cloud platform, combined with various consortium access modes, the problem of service unavailability caused by node failures has been solved, improving the availability and scalability of the blockchain network, lowering the technical threshold, and promoting flexible expansion of business cooperation.

CN116546022BActive Publication Date: 2026-03-27CHINA EVERBRIGHT BANK
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-12
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

When deploying a blockchain network on a container cloud platform, node failures can lead to service unavailability and poor availability. Blockchain technology has a high barrier to entry, making it difficult to expand business cooperation and has poor scalability.

Method used

The method employs odd-redundant deployment of consensus nodes, multi-active deployment of ledger nodes, and separate deployment of smart contracts. Combined with consortium access methods including full nodes, light nodes, and custodial models, it enhances system availability and scalability by creating a blockchain network and establishing a consortium blockchain network with consortium members.

Benefits of technology

It improves system availability and scalability, lowers the barrier to entry for blockchain technology, enhances the flexibility and scalability of business cooperation, and ensures service continuity in the event of node failure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116546022B_ABST
    Figure CN116546022B_ABST
Patent Text Reader

Abstract

The application provides a kind of alliance chain network establishment method and device, wherein the method comprises: creating a blockchain network, at least comprising: deploying consensus nodes, accounting nodes and smart contracts;Through a variety of alliance access modes, an alliance chain network is established with alliance members, wherein the plurality of alliance access modes at least include: full node access, light node access, hosting mode access, and a variety of alliance access modes can provide flexible deployment solutions according to different needs of customers, with strong business compatibility and scalability, which can solve the problem of current blockchain alliance chain business expansion difficulty;At the same time, through the multi-live deployment of part of the nodes, node failure leading to service unavailability is avoided, and system availability is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of data processing, in particular to a consortium chain network establishment method and device. BACKGROUND

[0002] Many financial institutions are actively committed to the technical integration of blockchain technology and the financial industry. With the characteristics of decentralization, tamper resistance, smart contracts, and uniqueness of blockchain, combined with the business scenarios of the transaction bank department, innovative financial products are expanded, business efficiency is improved, business scope is expanded, corresponding business between banks is promoted, and industrial value is improved.

[0003] When deploying a blockchain network on a container cloud platform, there are problems such as node failure leading to service unavailability, poor availability, high threshold of blockchain technology, and high difficulty of business cooperation expansion.

[0004] In view of the problems of node failure leading to service unavailability and poor scalability when deploying a blockchain network on a container cloud platform in the related art, no solutions have been proposed. SUMMARY

[0005] Embodiments of the present application provide a consortium chain network establishment method and device to at least solve the problems of node failure leading to service unavailability, poor availability, high threshold of blockchain technology, high difficulty of business cooperation expansion, and poor scalability when deploying a blockchain network on a container cloud platform in the related art.

[0006] According to an embodiment of the present application, a consortium chain network establishment method is provided, applied to a container cloud platform, comprising:

[0007] Creating a blockchain network, at least including deploying consensus nodes, accounting nodes, and smart contracts;

[0008] Establishing a consortium chain network with consortium members through multiple consortium access methods, wherein the multiple consortium access methods at least include full node access, light node access, and hosting mode access.

[0009] Optionally, creating a blockchain network at least includes:

[0010] Deploying consensus nodes of the blockchain network in odd redundancy;

[0011] Deploying accounting nodes of the blockchain network in multi-live mode;

[0012] Deploying smart contracts of the blockchain network in a separate manner.

[0013] Optionally, deploying consensus nodes of the blockchain network in odd redundancy includes:

[0014] deploying consensus nodes of the blockchain network in two k8s (Kubernetes) clusters, each of which includes n consensus nodes, n being an odd number greater than or equal to 3;

[0015] starting n consensus nodes in any one of the two k8s clusters, and the n consensus nodes in the other k8s cluster are in a standby state, the two groups of consensus nodes in the two k8s clusters are configured identically and serve as backups for each other, and the two groups of consensus nodes point to the same high-availability k8s cluster storage address.

[0016] Optionally, the method further comprises:

[0017] when the running cluster 1 fails and cannot be recovered in time, starting the n consensus nodes in cluster 2, and continuing to provide consensus services for the blockchain network through the n consensus nodes in the cluster 2 until the cluster 1 is recovered, wherein the two k8s clusters are the cluster 1 and the cluster 2;

[0018] determining whether to switch back to the cluster 1 or continue to use the services of the cluster 2, and stopping the services of the cluster 1 when continuing to use the cluster 2.

[0019] Optionally, deploying the accounting nodes of the blockchain network in a multi-live manner comprises:

[0020] deploying one accounting node with the same function but different identity in each of the two container cloud clusters to form a data redundancy and program multi-live architecture mode, wherein the same function means participating in the same channel in the blockchain at the same time, and the same smart contract is deployed and installed in the same channel; and the different identity means that the identity of the accounting node in the blockchain is unique.

[0021] Optionally, deploying the smart contract of the blockchain network in a separate manner comprises:

[0022] deploying the smart contract of the blockchain network through an application program interface (API) of the accounting node of the blockchain network, wherein the smart contract of the blockchain network and the corresponding accounting node are deployed on different hosts;

[0023] initiating a container startup process of the smart contract of the blockchain network through the accounting node of the blockchain network.

[0024] Optionally, initiating the container startup process of the smart contract of the blockchain network through the accounting node of the blockchain network comprises:

[0025] A stop command initiated by the accounting node stops the original smart contract container;

[0026] A start new smart contract container command initiated by the accounting node starts the new smart contract container, and the new smart contract container is created and run.

[0027] Optionally, before the start new smart contract container command initiated by the accounting node starts the new smart contract container, the method further comprises:

[0028] If the smart contract image does not exist, compile the smart contract code;

[0029] A create image command initiated by the accounting node generates an image of the smart contract.

[0030] Optionally, the full node access means that the consortium member accesses the blockchain network while deploying a consensus node and an accounting node, and connects the consensus node of the blockchain network through the deployed consensus node, wherein the deployed accounting node is connected with the deployed consensus node.

[0031] The light node access means that the consortium member accesses the blockchain network while only deploying an accounting node, and connects the consensus node of the blockchain network through the deployed accounting node.

[0032] The hosting mode access means that the consortium member accesses the blockchain network without deploying any consensus node or accounting node, and connects the accounting node of the blockchain network through a gateway.

[0033] According to another embodiment of the present application, a consortium chain network establishment device is also provided, which is applied to a container cloud platform and comprises:

[0034] A creation module is configured to create a blockchain network, and at least comprises deploying a consensus node, an accounting node, and a smart contract.

[0035] An establishment module is configured to establish a consortium chain network with a consortium member through a plurality of consortium access modes, wherein the plurality of consortium access modes at least comprise full node access, light node access, and hosting mode access.

[0036] Optionally, the creation module comprises:

[0037] A first deployment sub-module is configured to deploy the consensus node of the blockchain network in an odd number redundancy manner.

[0038] A second deployment sub-module is configured to deploy the accounting node of the blockchain network in a multi-live manner.

[0039] The third deployment sub-module is configured to deploy the smart contract of the blockchain network in a separated manner.

[0040] Optionally, the first deployment sub-module is further configured to:

[0041] The consensus nodes of the blockchain network are deployed in two k8s clusters, each of which includes n consensus nodes, and n is an odd number greater than or equal to 3.

[0042] The n consensus nodes in any one of the two k8s clusters are started, and the n consensus nodes in the other k8s cluster are in a standby state, the configurations of the two groups of consensus nodes in the two k8s clusters are completely consistent, and the two groups of consensus nodes point to the same high-availability k8s cluster storage address.

[0043] Optionally, the apparatus further comprises:

[0044] The backup module is configured to start the n consensus nodes in cluster 2 when cluster 1 in operation fails and cannot be recovered in time, and continue to provide consensus services for the blockchain network through the n consensus nodes in cluster 2 until cluster 1 is recovered, wherein the two k8s clusters are cluster 1 and cluster 2.

[0045] The determination module is configured to determine whether to switch back to cluster 1 or continue to use the services of cluster 2, and stop the services of cluster 1 when continuing to use cluster 2.

[0046] Optionally, the second deployment sub-module is further configured to:

[0047] One same-function but different-identity accounting node is deployed in each of the two container cloud clusters to form a data redundancy and program multi-live architecture mode, wherein the same function means participating in the same channel in the blockchain at the same time, and the same smart contract is deployed and installed in the same channel; and the different identity means that the identity of the accounting node in the blockchain is unique.

[0048] Optionally, the third deployment sub-module comprises:

[0049] The deployment unit is configured to deploy the smart contract of the blockchain network through the API called by the accounting node of the blockchain network, wherein the smart contract of the blockchain network and the corresponding accounting node are deployed on different hosts.

[0050] The initiation unit is configured to initiate a container startup process of the smart contract of the blockchain network through the accounting node of the blockchain network.

[0051] Optionally, the initiation unit is further configured to:

[0052] a stop command initiated by the accounting node to stop the original smart contract container;

[0053] a start new smart contract container command initiated by the accounting node to start the new smart contract container, to create and run the new smart contract container.

[0054] Optionally, the apparatus further comprises:

[0055] a compiling module configured to compile the smart contract code if the smart contract image does not exist;

[0056] a generating module configured to generate an image of the smart contract by initiating a create image command by the accounting node.

[0057] Optionally, the full node access refers to that the consortium member accesses the blockchain network while deploying a consensus node and an accounting node, and connects the consensus node of the blockchain network through the deployed consensus node, wherein the deployed accounting node is connected with the deployed consensus node.

[0058] The light node access refers to that the consortium member accesses the blockchain network while deploying only an accounting node, and connects the consensus node of the blockchain network through the deployed accounting node.

[0059] The hosting mode access refers to that the consortium member accesses the blockchain network without deploying any consensus node or accounting node, and connects the accounting node of the blockchain network through a gateway.

[0060] According to still another embodiment of the present application, a computer readable storage medium is further provided, and the storage medium stores a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when running.

[0061] According to still another embodiment of the present application, an electronic device is further provided, comprising a memory and a processor, the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any of the above method embodiments.

[0062] The blockchain network is created by the application, and at least includes: deploying consensus nodes, accounting nodes and smart contracts; and an alliance chain network is established with alliance members through multiple alliance access modes, wherein the multiple alliance access modes at least include: full node access, light node access and hosting mode access, which can solve the problems in the related art that when a blockchain network is deployed on a container cloud platform, node failure causes service unavailability and poor availability, the blockchain technology has high threshold, business cooperation is difficult to expand, and scalability is poor, the multiple alliance access modes can provide flexible deployment schemes according to different needs of customers, and the business compatibility and scalability are strong; meanwhile, through multi-active deployment of part of the nodes, node failure causing service unavailability is avoided, and system availability is enhanced. BRIEF DESCRIPTION OF DRAWINGS

[0063] The accompanying drawings, which are included to provide a further understanding of the application and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application. In the drawings:

[0064] Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal of an alliance chain network establishment method according to an embodiment of the application;

[0065] Figure 2 FIG. 2 is a flowchart of the alliance chain network establishment method according to the embodiment of the application;

[0066] Figure 3 FIG. 3 is a schematic diagram of full node access according to the embodiment of the application;

[0067] Figure 4 FIG. 4 is a schematic diagram of light node access according to the embodiment of the application;

[0068] Figure 5 FIG. 5 is a schematic diagram of hosting mode access according to the embodiment of the application;

[0069] Figure 6 FIG. 6 is a schematic diagram of blockchain network deployment based on a container cloud platform according to the embodiment of the application;

[0070] Figure 7 FIG. 7 is a block diagram of an alliance chain network establishment device according to the embodiment of the application. DETAILED DESCRIPTION

[0071] The application will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.

[0072] It should be noted that the terms "first," "second," etc., in the specification, claims, and drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0073] The method embodiment provided in Embodiment 1 of this application can be executed on a mobile terminal, computer terminal, or similar computing device. Taking its operation on a mobile terminal as an example, Figure 1 This is a hardware structure block diagram of a mobile terminal for the consortium blockchain network establishment method according to an embodiment of the present invention, as shown below. Figure 1 As shown, a mobile terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. Optionally, the mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0074] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the consortium blockchain network establishment method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0075] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the mobile terminal's communication provider. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.

[0076] In the embodiment, a consortium chain network establishment method running on the mobile terminal or the network architecture is provided, Figure 2 is a flowchart of the consortium chain network establishment method according to the embodiment of the application, as Figure 2 shown, applied to a container cloud platform, the flowchart includes the following steps:

[0077] Step S202, creating a blockchain network, at least including: deploying consensus nodes, accounting nodes and smart contracts;

[0078] Step S204, establishing a consortium chain network with consortium members through a plurality of consortium access modes, wherein the plurality of consortium access modes at least include: full node access, light node access and hosting mode access.

[0079] Figure 3 is a schematic diagram of full node access according to the embodiment of the application, as Figure 3 shown, full node access refers to that when a consortium member accesses the blockchain network, the consensus nodes and the accounting nodes are deployed at the same time, and the deployed consensus nodes are connected to the consensus nodes of the blockchain network, wherein the deployed accounting nodes are connected to the deployed consensus nodes; Figure 4 is a schematic diagram of light node access according to the embodiment of the application, as Figure 4 shown, light node access refers to that when a consortium member accesses the blockchain network, only the accounting nodes are deployed, and the deployed accounting nodes are connected to the consensus nodes of the blockchain network; Figure 5 is a schematic diagram of hosting mode access according to the embodiment of the application, as Figure 5 shown, hosting mode access refers to that when a consortium member accesses the blockchain network, no consensus nodes or accounting nodes are deployed, and the accounting nodes of the blockchain network are connected through a gateway.

[0080] Through the above steps S202 to S204, the problems in the related art that when the blockchain network is deployed on the container cloud platform, the service is unavailable due to node failure, the blockchain technology has high threshold, the business cooperation is difficult to expand, and the scalability is poor can be solved, a plurality of consortium access modes can provide flexible deployment schemes according to different needs of customers, and the business compatibility and the scalability are strong; at the same time, through the multi-live deployment of part of the nodes, the service is avoided to be unavailable due to node failure, and the system availability is enhanced.

[0081] In the embodiment of the application, the above step S202 at least includes:

[0082] S2021, deploying the consensus nodes of the blockchain network in an odd number redundancy manner;

[0083] S2022, deploying the accounting nodes of the blockchain network in a multi-live manner;

[0084] S2023, deploying the smart contract of the blockchain network in a separated manner.

[0085] In addition to the above, the creation of the blockchain network in this embodiment can also include creating a k8s cluster, creating a public chain, creating a channel, and the like.

[0086] In an optional embodiment, the step S2021 can specifically include: deploying consensus nodes of the blockchain network in two k8s clusters, each k8s cluster including n consensus nodes, n being an odd number greater than or equal to 3; starting n consensus nodes in any one of the two k8s clusters, and the n consensus nodes in the other k8s cluster being in a standby state in a cold standby manner, the two groups of consensus nodes in the two k8s clusters being completely consistent in configuration and backing up each other, and the two groups of consensus nodes pointing to the same high-availability k8s cluster storage address.

[0087] Further, when the running cluster 1 fails and cannot be recovered in time, the n consensus nodes in the cluster 2 are started, and the n consensus nodes in the cluster 2 continue to provide consensus services for the blockchain network until the cluster 1 recovers, wherein the two k8s clusters are the cluster 1 and the cluster 2; it is determined whether to switch back to the cluster 1 or continue to use the services of the cluster 2, and when the cluster 2 is continued to be used, the services of the cluster 1 are stopped.

[0088] In an optional embodiment, the step S2022 can specifically include:

[0089] In the two container cloud clusters, one accounting node with the same function but different identity is deployed in each container cloud cluster, forming a data redundancy and program multi-live architecture mode, wherein the same function means participating in the same channel in the blockchain, and the same smart contract is deployed and installed in the same channel; the different identity means that the identity of the accounting node in the blockchain is unique.

[0090] In an optional embodiment, the step S2023 can specifically include: deploying the smart contract of the blockchain network through the API of the accounting node of the blockchain network, wherein the smart contract of the blockchain network is deployed by default on the same host as the corresponding accounting node; initiating a container startup process of the smart contract of the blockchain network through the accounting node of the blockchain network, specifically, stopping the original smart contract container through the stop command initiated by the accounting node; initiating a new smart contract container startup command through the accounting node to start the new smart contract container, create and run the new smart contract container.

[0091] Further, if the smart contract image does not exist, the smart contract code is compiled; a command for creating an image is initiated through the accounting node to generate the image of the smart contract; after the image is generated, a command for starting the new smart contract container is initiated through the accounting node to start the new smart contract container, and the new smart contract container is created and run.

[0092] The embodiment of the application meets the fusion requirements of the technical constraints of the blockchain and the availability, scalability, fault isolation and other aspects of the financial industry for technology services, proposes a blockchain network deployment based on a container cloud platform, in the architecture design of the blockchain system, the consensus nodes adopt an odd redundancy deployment mode, the accounting nodes adopt a multi-live deployment mode, the smart contracts adopt a separate deployment mode, and the client node joining mode supports a full node mode, a light node mode and a hosting mode. Figure 6 is a schematic diagram of the blockchain network deployment based on the container cloud platform according to the embodiment of the application, as shown in Figure 6 , comprising:

[0093] Client access mode: full node access, light node access, hosting mode access

[0094] Building an alliance chain network and alliance governance requires investment in hardware and software costs, and a balance is sought between business needs, cost investment and alliance governance, based on the classification and grading principle, according to the customer type and the security protection level, the Blockchain as a Service (Blockchain as a Service, BaaS for short) platform provides a flexible alliance networking mode. Alliance members can choose full nodes, light nodes, hosting modes and other ways to join the alliance chain network, use the network and access resources according to business needs, fully consider the economic benefit and control the cost, so as to ensure the healthy development of the alliance chain to carry the business.

[0095] Full node access, as shown in Figure 3 , when accessing the blockchain network, the consensus node and the accounting node are deployed at the same time, participate in the accounting and consensus of the network, and are the creator of the network and the governor of the alliance;

[0096] Light node access, as shown in Figure 4 , when accessing the blockchain network, only the accounting node is deployed, does not participate in the consensus of the network, is only responsible for accounting, and enhances the decentralization feature;

[0097] Hosting mode access, as shown in Figure 5 , when accessing the blockchain network, no consensus or accounting node is deployed, and network services are obtained through the nodes in the container cloud platform.

[0098] High-availability deployment: consensus node 3+3 deployment, accounting node multi-live deployment, smart contract separate deployment

[0099] The blockchain network creation on the container cloud platform includes k8s cluster creation, consensus node and accounting node deployment, public chain creation, channel creation and smart contract deployment; wherein, the consensus node adopts odd redundant deployment mode, the accounting node adopts multi-live deployment mode, and the smart contract adopts separate deployment mode.

[0100] The consensus node adopts odd redundant deployment: the consensus service is an important component in the blockchain network, and needs to be able to run normally when a consensus node fails. The prerequisite for normal operation is that a majority of consensus nodes are alive, that is, more than 1 / 2 of the nodes need to be normal, so the consensus node needs to be deployed in odd number, and the minimum number is 3; and in order to avoid the occurrence of single point failure leading to the paralysis of the blockchain network, redundant deployment is needed. Therefore, the consensus node odd redundant deployment mode is adopted, specifically: the consensus node is deployed in two k8s clusters, the number of consensus nodes in each cluster is n, n is an odd number greater than or equal to 3; and the configuration of the two groups of nodes is completely consistent, and they are backups for each other, and the two groups of nodes point to the same high-availability cluster storage address; at the same time, only the n nodes in any one cluster are started and run, and the nodes in the other cluster are on standby in cold standby mode; when cluster 1 fails and cannot be recovered in time, start the n nodes in cluster 2 after evaluation, continue to provide consensus service for the blockchain network, until cluster 1 recovers, determine whether to switch back to the original cluster or continue to use the service of cluster 2, when continuing to use cluster 2, the service of cluster 1 needs to be stopped.

[0101] The accounting node adopts multi-live deployment: by deploying one accounting node with the same function and different identity in each of the two container cloud clusters, the architecture mode of data redundancy and program multi-live is realized:

[0102] The same function means that the two accounting nodes have consistent functions, which means that they join the same channel in the blockchain, and the same smart contract is deployed and installed in the same channel;

[0103] Different identities mean that the accounting nodes have unique identity characteristics in the blockchain, including different identity certificates, and differences in access address and access port information of the two nodes;

[0104] Data redundancy means that the accounting nodes have the same function, that is, the block data synchronized from the consensus node and the ledger data of the two accounting nodes are consistent;

[0105] Program multi-live means that the two accounting nodes provide services simultaneously in the dual-active mode of the container cloud platform, improving the high availability and stability of the system.

[0106] Smart contract separation deployment: the smart contract is installed by the ledger node through calling the Docker API, the smart contract and the corresponding ledger node are deployed on different hosts, the container starting process of the smart contract is initiated by the ledger node, and the main steps are divided into three steps.

[0107] A, first send a stop command, regardless of whether it exists originally, stop the original smart contract container;

[0108] B, try to create a smart contract container, if the failure reason is that the smart contract image does not exist (it is the first creation), build the image and recreate the container: compile the smart contract code; initiate the image creation command to generate the smart contract image; initiate the command to recreate the smart contract container.

[0109] C, initiate the start smart contract container command to start the smart contract container, create and run the smart contract container.

[0110] All ledger nodes are installed and deployed through the container cloud platform, and the container cloud platform further calls the underlying k8s API Server to manage the containers of the ledger nodes, and the ledger node container calls the Docker API to install the smart contract. When the ledger node is deployed, the statefulset.yaml file of the k8s to which the ledger node service belongs is updated, and the environment variables are modified as shown in Table 1.

[0111] Table 1

[0112]

[0113] Restart the ledger node service to take effect, and when the user submits a proposal, the ledger node will send a request according to the configured remote Docker API service address to complete the user's proposal transaction.

[0114] According to another embodiment of the application, there is also provided a consortium chain network establishment device applied to a container cloud platform, Figure 7 is a block diagram of the consortium chain network establishment device according to the embodiment of the application, as Figure 7 shown, comprising:

[0115] The creation module 72 is configured to create a blockchain network, and at least includes: deploying consensus nodes, ledger nodes and smart contracts.

[0116] The establishment module 74 is configured to establish a consortium chain network with consortium members through a plurality of consortium access modes, wherein the plurality of consortium access modes at least include: full node access, light node access and hosting mode access.

[0117] Optionally, the creation module 72 comprises:

[0118] The first deployment sub-module is configured to deploy consensus nodes of the blockchain network in an odd redundancy manner.

[0119] The second deployment sub-module is configured to deploy ledger nodes of the blockchain network in a multi-live manner.

[0120] The third deployment sub-module is configured to deploy smart contracts of the blockchain network in a separation manner.

[0121] Optionally, the first deployment sub-module is further configured to:

[0122] The consensus nodes of the blockchain network are deployed in two k8s clusters, each of which includes n consensus nodes, and n is an odd number greater than or equal to 3.

[0123] The n consensus nodes in any one of the two k8s clusters are started, and the n consensus nodes in the other k8s cluster are in a standby state, the configurations of the two groups of consensus nodes are completely consistent, and the two groups of consensus nodes point to the same high-availability k8s cluster storage address.

[0124] Optionally, the apparatus further includes:

[0125] The backup module is configured to start the n consensus nodes in cluster 2 to continue to provide consensus services for the blockchain network through the n consensus nodes in cluster 2 when cluster 1 in operation fails and cannot be recovered in time, until cluster 1 recovers, wherein the two k8s clusters are cluster 1 and cluster 2.

[0126] The determination module is configured to determine whether to switch back to cluster 1 or continue to use the services of cluster 2, and stop the services of cluster 1 when continuing to use cluster 2.

[0127] Optionally, the second deployment sub-module is further configured to:

[0128] One same-function but different-identity ledger node is deployed in each of the two container cloud clusters to form a data redundancy and program multi-live architecture mode, wherein the same function means that the same-function ledger nodes join the same channel in the blockchain and deploy and install the same smart contract in the same channel, and the different identity means that the ledger nodes have unique identity in the blockchain.

[0129] Optionally, the third deployment sub-module includes:

[0130] The deployment unit is configured to deploy the smart contract of the blockchain network through the ledger nodes of the blockchain network calling an API, wherein the smart contract of the blockchain network is deployed on the same host as the corresponding ledger node by default.

[0131] An initiating unit is configured to initiate, by a ledger node of the blockchain network, a container starting process of a smart contract of the blockchain network.

[0132] Optionally, the initiating unit is further configured to:

[0133] stop the original smart contract container by a stop command initiated by the ledger node;

[0134] start the new smart contract container by a start new smart contract container command initiated by the ledger node to create and run the new smart contract container.

[0135] Optionally, the apparatus further comprises:

[0136] a compiling module configured to compile the smart contract code if the smart contract image does not exist;

[0137] a generating module configured to generate the image of the smart contract by initiating, by the ledger node, a create image command.

[0138] Optionally, the full node access refers to that when an alliance member accesses the blockchain network, the consensus node and the ledger node are deployed simultaneously, and the deployed consensus node is connected to the consensus node of the blockchain network, wherein the deployed ledger node is connected to the deployed consensus node.

[0139] The light node access refers to that when an alliance member accesses the blockchain network, only the ledger node is deployed, and the consensus node of the blockchain network is connected through the deployed ledger node.

[0140] The hosting mode access refers to that when an alliance member accesses the blockchain network, neither the consensus node nor the ledger node is deployed, and the ledger node of the blockchain network is connected through a gateway.

[0141] It should be noted that the above various modules can be implemented by software or hardware, and for the latter, the following implementation manners can be used, but are not limited thereto: the above modules are located in the same processor; or the above various modules are located in different processors in any combination.

[0142] Embodiments of the present application also provide a computer-readable storage medium, which stores a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when running.

[0143] Optionally, in the present embodiment, the above storage medium can be configured to store a computer program for executing the following steps:

[0144] S1, creating a blockchain network, at least comprising: deploying a consensus node, a ledger node and a smart contract;

[0145] S2, establish an alliance chain network with alliance members through a plurality of alliance access modes, wherein the plurality of alliance access modes at least include: full node access, light node access, and hosting mode access.

[0146] Optionally, in the embodiment, the storage medium can include, but is not limited to, a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various computer program storage media.

[0147] Embodiments of the application also provide an electronic device including a memory and a processor, the memory storing a computer program, and the processor being configured to execute the computer program to perform the steps in any of the above method embodiments.

[0148] Optionally, the electronic device can further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0149] Optionally, in the embodiment, the processor can be configured to perform the following steps through the computer program:

[0150] S1, creating a blockchain network, at least including: deploying consensus nodes, accounting nodes and smart contracts;

[0151] S2, establishing an alliance chain network with alliance members through a plurality of alliance access modes, wherein the plurality of alliance access modes at least include: full node access, light node access, and hosting mode access.

[0152] Optionally, specific examples in the embodiment can refer to the examples described in the above embodiments and optional implementation manners, which will not be described here again.

[0153] Obviously, those skilled in the art should understand that the above-mentioned modules or steps of the application can be realized by general computing devices, which can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be realized by program codes executable by computing devices, so that they can be stored in storage devices and executed by computing devices, and in some cases, the steps shown or described can be executed in different order, or they can be manufactured into individual integrated circuit modules, or multiple modules or steps can be manufactured into a single integrated circuit module. Thus, the application is not limited to any specific hardware and software combination.

[0154] The above merely describes the preferred embodiments of the present application and is not used to limit the present application. Any modification, equivalent replacement, improvement, etc. within the principles of the present application should be included in the protection scope of the present application.

Claims

1. A method for establishing a consortium chain network, applied to a container cloud platform, and characterized in that, The method comprises: creating a blockchain network, at least comprising: deploying consensus nodes of the blockchain network in an odd redundancy manner, deploying accounting nodes of the blockchain network in a multi-live manner, and deploying smart contracts of the blockchain network in a separation manner; establishing an alliance chain network with alliance members through multiple alliance access modes, wherein the multiple alliance access modes at least comprise: full node access, light node access, and hosting mode access; wherein deploying consensus nodes of the blockchain network in an odd redundancy manner comprises: deploying the consensus nodes of the blockchain network in two k8s clusters, each k8s cluster comprising n consensus nodes, n being an odd number greater than or equal to 3; starting n consensus nodes in any one of the two k8s clusters, and the n consensus nodes in the other k8s cluster are in standby state in a cold standby manner, the configurations of the two groups of consensus nodes in the two k8s clusters are completely consistent, and the two groups of consensus nodes point to the same high-availability k8s cluster storage address.

2. The method of claim 1, wherein, The method further comprises: when the running cluster 1 fails and cannot be recovered in time, starting the n consensus nodes in cluster 2, and continuing to provide consensus service for the blockchain network through the n consensus nodes in cluster 2 until the cluster 1 is recovered, wherein the two k8s clusters are the cluster 1 and the cluster 2; determining whether to switch back to the cluster 1 or continue to use the service of the cluster 2, and stopping the service of the cluster 1 when continuing to use the cluster 2.

3. The method of claim 1, wherein, Deploying the accounting nodes of the blockchain network in a multi-live manner comprises: deploying one accounting node with the same function but different identity in each of the two container cloud clusters, forming a data redundancy and program multi-live architecture mode, wherein the same function means participating in the same channel in the blockchain, and the same smart contract is deployed and installed in the same channel; and the different identity means that the identity of the accounting node in the blockchain is unique.

4. The method of claim 1, wherein, Deploying the smart contracts of the blockchain network in a separation manner comprises: deploying the smart contracts of the blockchain network through the accounting nodes of the blockchain network by calling an application program interface (API), wherein the smart contracts of the blockchain network and the corresponding accounting nodes are deployed on different hosts; initiating a container startup process of the smart contracts of the blockchain network through the accounting nodes of the blockchain network.

5. The method of claim 4, wherein, Initiating a container startup process of the smart contracts of the blockchain network through the accounting nodes of the blockchain network comprises: stopping the original smart contract container through a stop command initiated by the accounting node; starting a new smart contract container command through the accounting node to start the new smart contract container, create and run the new smart contract container.

6. The method of claim 5, wherein, Before starting the new smart contract container command through the accounting node to start the new smart contract container, the method further comprises: if the smart contract image does not exist, compiling the smart contract code; initiating a create image command through the accounting node to generate an image of the smart contract.

7. The method of any one of claims 1-6, wherein, the full node access refers to that the consortium member accesses the blockchain network while deploying a consensus node and a ledger node, and connects the consensus node of the blockchain network through the deployed consensus node, wherein the deployed ledger node is connected with the deployed consensus node; the light node access refers to that the consortium member accesses the blockchain network while deploying only a ledger node, and connects the consensus node of the blockchain network through the deployed ledger node; the hosting mode access refers to that the consortium member accesses the blockchain network without deploying any consensus node or ledger node, and connects the ledger node of the blockchain network through a gateway.

8. A consortium chain network establishment device applied to a container cloud platform, characterized in that, comprises: a creating module configured to create a blockchain network, comprising at least: deploying consensus nodes of the blockchain network in an odd redundancy manner, deploying ledger nodes of the blockchain network in a multi-live manner, and deploying smart contracts of the blockchain network in a separation manner; wherein the deploying the consensus nodes of the blockchain network in the odd redundancy manner comprises: deploying the consensus nodes of the blockchain network in two k8s clusters, each k8s cluster comprising n consensus nodes, n being an odd number greater than or equal to 3; starting n consensus nodes in any one of the two k8s clusters, and n consensus nodes of the other k8s cluster being in a standby state in a cold standby manner, the two groups of consensus nodes in the two k8s clusters being completely consistent in configuration and serving as backups for each other, and the two groups of consensus nodes pointing to a same high-availability k8s cluster storage address; an establishing module configured to establish a consortium chain network with a consortium member through a plurality of consortium access modes, wherein the plurality of consortium access modes comprise at least: full node access, light node access, and hosting mode access.

9. A computer readable storage medium, characterized in that, The storage medium stores a computer program, wherein the computer program is configured to execute the method of any one of claims 1-7 when running. 10.An electronic device comprising a memory and a processor, the electronic device characterized by, The memory stores a computer program, and the processor is configured to execute the computer program to execute the method of any one of claims 1-7.

Citation Information

Patent Citations

  • Node access method based on block chain BaaS platform

    CN111431867A