Blockchain-based deployment method and apparatus, computer device, and storage medium
Patent Information
- Application Number
- CN202311704474.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-12
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2043-12-12
AI Technical Summary
[0004]有鉴于此,本发明提供了一种基于区块链的部署方法、装置、计算机设备及存储介质,以解决区块链节点及区块数据是由单一企业或者第三方机构来控制和管理的,而这些中心化的节点通常只有部分企业可以直接控制或查看,从而导致其他没有权限的企业无法直接查看或控制节点的问题
[0006]本实施例提供的基于区块链的部署方法,通过将管理节点和工作节点加入到默认通道,并通过DNS智能合约实现管理节点与工作节点之间进行通讯的方式,能够保证节点的所有权和控制权分散在各个工作节点以及管理节点,解决了区块链节点及区块数据是由单一企业或者第三方机构来控制和管理的,而这些中心化的节点通常只有部分企业可以直接控制或查看,从而导致其他没有权限的企业无法直接查看或控制节点的问题。
Smart Images

Figure CN117792897B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of blockchain technology, and more specifically to a blockchain-based deployment method, apparatus, computer equipment, and storage medium. Background Technology
[0002] Currently, most BaaS platforms based on the Hyperledger Fabric blockchain are based on Docker / K8S infrastructure on public or private cloud service platforms, or directly use BaaS services provided by third-party blockchain cloud service platforms. This deployment method mostly adopts centralized deployment of blockchain nodes, and the ownership of the nodes belongs to the rented third-party institution or a single enterprise.
[0003] However, blockchain nodes and block data are controlled and managed by a single enterprise or third-party organization. These centralized nodes are usually only directly controlled or viewed by some enterprises, which means that other enterprises without the necessary permissions cannot directly view or control the nodes. Summary of the Invention
[0004] In view of this, the present invention provides a blockchain-based deployment method, apparatus, computer equipment, and storage medium to solve the problem that blockchain nodes and block data are controlled and managed by a single enterprise or third-party institution, and these centralized nodes are usually only directly controlled or viewed by some enterprises, thus causing other enterprises without the necessary permissions to be unable to directly view or control the nodes.
[0005] In a first aspect, the present invention provides a blockchain-based deployment method, the method comprising: obtaining a DNS contract, a first image file and a second image file of a private Docker repository; allocating the first image file and the second image file to worker nodes and management nodes; generating a default channel corresponding to the management node based on the first image file and the second image file; configuring the DNS contract on the default channel and adding the data information of the management node to the DNS contract; executing the first image file and the second image file on the worker nodes and adding the worker nodes to the default channel, so that the management node and the worker nodes can communicate.
[0006] The blockchain-based deployment method provided in this embodiment, by adding management nodes and worker nodes to the default channel and implementing communication between management nodes and worker nodes through DNS smart contracts, ensures that the ownership and control of nodes are distributed among various worker nodes and management nodes. This solves the problem that blockchain nodes and block data are controlled and managed by a single enterprise or third-party institution, and these centralized nodes are usually only directly controlled or viewed by some enterprises, resulting in other enterprises without the necessary permissions being unable to directly view or control the nodes.
[0007] In some optional implementations, a default channel corresponding to the management node is generated based on the first image file and the second image file, including: creating an initial channel; determining the data information of the management node based on the second image file; and processing the initial channel based on the first image file and the data information to generate the default channel corresponding to the management node.
[0008] The blockchain-based deployment method provided in this embodiment can intelligently generate the default channel corresponding to the management node by determining the data information of the management node.
[0009] In some optional implementations, the first image file includes a node management API service and a node management visualization service, and the second image file includes a container service; further comprising: starting the node management API service, the node management visualization service, and the container service of the target worker node; determining the node parameters of the target worker node based on the node management visualization service; adding the node parameters to the DNS contract to generate the target DNS contract; updating the configured data information of the default channel based on the node management API service, the container service, and the node parameters to obtain the target data information of the default channel; configuring the target data information in the default channel; and adding the target worker node to the default channel.
[0010] The blockchain-based deployment method provided in this embodiment determines the node parameters of the target worker node through the node management API service when adding the target worker node, and generates a target DNS contract based on the node parameters and the DNS contract. This enables intelligent modification of the DNS contract to achieve communication connections between the target worker node, worker nodes, and management nodes.
[0011] In some optional implementations, determining the node parameters of the target work node based on the node management visualization service includes: responding to a trigger operation of the target object and opening the organization management page based on the trigger operation; responding to a selection operation on the organization management page and determining the configuration page of the target work node from the organization management page based on the selection operation; and responding to a mode parameter configuration operation generated for the configuration page and determining the node parameters of the target work node based on the mode parameter configuration operation.
[0012] In some alternative implementations, adding the target worker node to the default channel includes: in response to a click operation on the target object, obtaining the certificate file of the order node; and adding the target worker node to the default channel based on the certificate file.
[0013] The blockchain-based deployment method provided in this embodiment enables the target worker node to communicate with other nodes through the certificate file of the order node, thereby ensuring that the target worker node can be added to the default channel.
[0014] In some optional implementations, adding worker nodes to a default channel includes: obtaining the organization information of the worker nodes; adding the organization information to a DNS contract via the default channel to generate a target DNS contract; determining the target information of the target node based on the target DNS contract; adding the target information to a hosts file; and mapping the target information to various containers in the blockchain based on the hosts file.
[0015] The blockchain-based deployment method provided in this embodiment adds organization information to the DNS contract through a default channel to generate a target DNS contract; determines the target information of the target node based on the target DNS contract; adds the target information to the hosts file; and maps the target information to each container of the blockchain based on the hosts file. This method can ensure that the information of the worker node can be dynamically distributed to each container.
[0016] In some alternative implementations, before configuring the DNS contract on the default channel and adding the management node's data information to the DNS contract, the method further includes: detecting whether the default channel has been successfully established; if the default channel has been successfully established, performing the steps of configuring the DNS contract on the default channel and adding the management node's data information to the DNS contract.
[0017] The blockchain-based deployment method provided in this embodiment avoids the problem of DNS contracts being unable to be configured on the default channel, which would otherwise lead to excessive memory usage, by detecting whether the default channel has been successfully established.
[0018] Secondly, the present invention provides a blockchain-based deployment device, comprising: an acquisition module for acquiring a first image file, a second image file, and a DNS contract; an allocation generation module for allocating the first image file and the second image file to a management node, and generating a default channel corresponding to the management node based on the first image file and the second image file; and a configuration addition module for configuring the DNS contract in the default channel and adding the data information of the management node to the DNS contract to complete the deployment of the management node.
[0019] Thirdly, the present invention provides a computer device, comprising: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the blockchain-based deployment method of the first aspect or any corresponding embodiment described above.
[0020] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to execute the blockchain-based deployment method of the first aspect or any corresponding embodiment thereof. Attached Figure Description
[0021] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0022] Figure 1 This is an automated BaaS management platform based on the Hyperledger Fabric blockchain according to an embodiment of the present invention;
[0023] Figure 2 This is a schematic diagram of the structure of a blockchain deployment service module according to an embodiment of the present invention;
[0024] Figure 3 This is a flowchart illustrating a blockchain-based deployment method according to an embodiment of the present invention;
[0025] Figure 4 This is a flowchart illustrating another blockchain-based deployment method according to an embodiment of the present invention;
[0026] Figure 5 This is a structural block diagram of a blockchain-based deployment device according to an embodiment of the present invention;
[0027] Figure 6 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Detailed Implementation
[0028] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0029] Based on relevant technologies, most BaaS platforms based on Hyperledger Fabric blockchain are currently based on Docker / K8S infrastructure on public or private cloud service platforms, or directly use BaaS services provided by third-party blockchain cloud service platforms. This deployment method mostly adopts centralized deployment of blockchain nodes, and the ownership of the nodes belongs to the rented third-party institution or a single enterprise.
[0030] However, blockchain nodes and block data are controlled and managed by a single enterprise or third-party organization. These centralized nodes are usually only directly controlled or viewed by some enterprises, which means that other enterprises without the necessary permissions cannot directly view or control the nodes.
[0031] Based on this, the blockchain-based deployment method provided in this embodiment, by adding management nodes and worker nodes to the default channel and implementing communication between management nodes and worker nodes through DNS smart contracts, can ensure that the ownership and control of nodes are distributed among various worker nodes and management nodes. This solves the problem that blockchain nodes and block data are controlled and managed by a single enterprise or third-party institution, and these centralized nodes are usually only directly controlled or viewed by some enterprises, resulting in other enterprises without the necessary permissions being unable to directly view or control the nodes.
[0032] Figure 1 This demonstrates an automated BaaS management platform based on the Hyperledger Fabric blockchain, combined with... Figure 1 As shown, the platform comprises an external application layer, a blockchain network layer, and an infrastructure layer. The BaaS service primarily involves the blockchain network layer, which is divided into two parts: Blockchain Deployment (BaaS Deployment) and User Chain. The Blockchain Deployment (BaaSDeployment) includes a node management API service module and a node management visual UI. The node management visual UI interacts with the node management API service module to implement backend and frontend functions such as channel management, organization management, node management, contract management, and middleware management. The infrastructure layer consists of two parts: Docker image management and infrastructure resources. Infrastructure resources include physical machines, virtual machines, cloud hosts, and container clouds.
[0033] Figure 2 This diagram illustrates the structure of a blockchain deployment service module, combined with... Figure 2As shown, the node management API service module is the core module of the BaaS deployment platform. The node management API service module includes: API interface service, certificate management / distribution, channel management, chain network / node management, Util common encapsulation module, application / middleware management, and OSN sorting node / consensus management, totaling 7 modules.
[0034] API interface services refer to the function calls of visual UI modules and externally exposed overall services.
[0035] The certificate management / distribution module manages certificate private keys and signing services (including MSP, organization name, path, file name, etc.), and provides services for certificate distribution and signing between nodes.
[0036] The Channel Management module is used to create and manage channels within the Fabric consortium blockchain. A channel is a logically isolated sub-network of the blockchain, allowing participants to conduct transactions and share data in a private and secure environment. The Channel Management module is responsible for operations such as channel creation, configuration, updates, and permission management.
[0037] The Chain Network / Node Management module interacts with the user chain through the Fabric SDK, manages organizational member relationships and key information such as identity certificates and keys, and can manage channel configuration files. It implements backend logic functions for chain management, including organization management, node management, and contract management. This module ensures the stable operation of the consortium blockchain network, including tasks such as node registration, deregistration, upgrades, and fault recovery.
[0038] The Util common wrapper module is a utility module that provides shared functions and methods to simplify and optimize the development and operation of BaaS platforms. These functions include wrappers for common operations such as checking remote port availability, managing failed retries, loading certificate files, checking file existence, merging map data, encryption and decryption, hash algorithms, and data serialization. The Util common wrapper module provides reusable tools and function libraries to improve the platform's efficiency and reliability.
[0039] Application / middleware management allows users to customize and write third-party applications and middleware. These applications and middleware can invoke contracts, retrieve or modify contract data, extend the contract capabilities of the consortium blockchain, and empower the node management API service module, enabling communication and display between front-end UI pages. It provides functions such as application and middleware deployment, configuration, monitoring, and scaling. This module allows users to deploy their applications to the BaaS platform and manage their lifecycle to ensure application availability and performance.
[0040] The OSN sorting node / consensus management module is primarily used for managing the unique sorting nodes and consensus mechanisms of consortium blockchains. It can add or delete sorting nodes, update consensus configurations, and register new nodes to the common channel.
[0041] According to an embodiment of the present invention, a blockchain-based deployment method embodiment is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0042] This embodiment provides a blockchain-based deployment method that can be used in an automated BaaS management platform based on the Hyperledger Fabric blockchain. Figure 1 This is a flowchart illustrating a blockchain-based deployment method according to an embodiment of the present invention, such as... Figure 3 As shown, the process includes the following steps:
[0043] Step S101: Obtain the DNS contract, the first image file of the private Docker repository, and the second image file.
[0044] On the Docker image management server, a script is executed to establish a private image management service (i.e., a private Docker repository) in the infrastructure layer, and to compile and upload the BaaSDeployment image file (i.e., the first image file) and the image file required by the Fabric blockchain (i.e., the second image file).
[0045] DNS contracts can be used to represent contracts that establish communication links between worker nodes and management nodes. These DNS contracts can be user-defined contracts.
[0046] Step S102: Distribute the first image file and the second image file to the worker node and the management node.
[0047] Worker nodes represent enterprises joining the blockchain. The number of worker nodes can be multiple or single, etc., without specific limitations. Management nodes represent the administrator nodes of the BaaS management platform. Specifically, the worker and management nodes prepare the installation environment, execute scripts, and pull the first and second image files.
[0048] Step S103: Based on the first image file and the second image file, generate the default channel corresponding to the management node.
[0049] Executing scripts on worker and management nodes automatically configures necessary environment variables. These variables may include worker node IDs and addresses, which are not specifically limited here. BaaSDeployment starts the BaaS service in the Docker service, and then sequentially starts the node management API service, the node management visualization service, and the container service in the user chain. This involves executing the first and second image files mentioned above and generating a default channel for the management node. This default channel is used for data sharing between the management and worker nodes.
[0050] It should be noted that the above scripts can be user-defined scripts, and no specific restrictions are imposed here.
[0051] Step S104: Configure the DNS contract on the default channel and add the data information of the management node to the DNS contract.
[0052] The data information may include: IP address, anchor node port, and certificate distribution port. Specifically, the DNS contract is configured in the default channel, enabling the management node and worker nodes of the default channel to establish a communication connection and add the data information to the DNS contract, thus completing the chain network DNS registration.
[0053] Step S105: In the worker node, execute the first image file and the second image file, and add the worker node to the default channel to enable communication between the management node and the worker node.
[0054] Add worker nodes to the default channel to enable communication between the management node and worker nodes.
[0055] The blockchain-based deployment method provided in this embodiment, by adding management nodes and worker nodes to the default channel and implementing communication between management nodes and worker nodes through DNS smart contracts, ensures that the ownership and control of nodes are distributed among various worker nodes and management nodes. This solves the problem that blockchain nodes and block data are controlled and managed by a single enterprise or third-party institution, and these centralized nodes are usually only directly controlled or viewed by some enterprises, resulting in other enterprises without the necessary permissions being unable to directly view or control the nodes.
[0056] This embodiment provides a blockchain-based deployment method, which can be used in the aforementioned automated BaaS management platform based on the Hyperledger Fabric blockchain, etc. Figure 2 This is a flowchart illustrating a blockchain-based deployment method according to an embodiment of the present invention, such as... Figure 4 As shown, the process includes the following steps:
[0057] Step S201: Obtain the DNS contract, the first image file of the private Docker repository, and the second image file. For details, please refer to [link to relevant documentation]. Figure 3 Step S101 of the illustrated embodiment will not be described again here.
[0058] Step S202: Distribute the first image file and the second image file to the worker node and the management node. For details, please refer to [link to details]. Figure 3 Step S102 of the illustrated embodiment will not be described again here.
[0059] Step S203: Based on the first image file and the second image file, generate the default channel corresponding to the management node.
[0060] Specifically, step S203 includes:
[0061] Step S2031: Create the initial channel.
[0062] Initial channels can be used to characterize the initial channels available in an automated BaaS management platform based on the HyperLedger Fabric blockchain.
[0063] Step S2032: Based on the second image file, determine the data information of the management node.
[0064] As mentioned above, the second image file is the image file required by the Fabric blockchain, which may include services such as Peer, Order, and CA. Through services such as Peer, Order, and CA, information such as IP addresses, anchor node ports, and certificate distribution ports can be configured for management nodes.
[0065] Step S2033: Based on the first image file and data information, process the initial channel to generate the default channel corresponding to the management node.
[0066] The initial channel has initial configuration information, which is inherent to the initial channel itself. After the data information is determined, the initial configuration information can be modified using the first image file and the data information to generate the default channel.
[0067] Step S204: Configure the DNS contract on the default channel and add the management node's data information to the DNS contract. For details, please refer to [link to relevant documentation]. Figure 3 Step S104 of the illustrated embodiment will not be described again here.
[0068] Step S205: On the worker node, execute the first image file and the second image file, and add the worker node to the default channel to enable communication between the management node and the worker node. For details, please refer to [link to details]. Figure 3 Step S105 of the illustrated embodiment will not be described again here.
[0069] The blockchain-based deployment method provided in this embodiment can intelligently generate the default channel corresponding to the management node by determining the data information of the management node.
[0070] In an optional implementation, the method further includes:
[0071] Step a1: Start the node management API service, node management visualization service, and container service of the target worker node.
[0072] The target worker node can be used to represent a newly added node to the default channel. Within this target worker node, the installation environment is prepared, scripts are executed, necessary environment variables are automatically configured, the BaaS service is started in the Docker service, and the node management API service, node management visualization service, and necessary container services in the user chain (Peer, CA, etc.) are started sequentially.
[0073] Step a2: Based on the node management visualization service, determine the node parameters of the target working node.
[0074] Using the node management visualization service, users can configure the node parameters of target worker nodes. The specific configuration methods are described in detail below.
[0075] Specifically, step a2 above includes:
[0076] Step a21: In response to the triggering operation of the target object, open the organization management page based on the triggering operation.
[0077] A trigger action is an operation performed by a user (i.e., the target object) through mouse clicks, keyboard selections, or touchscreen input. When a user issues a trigger action, the computer device can respond by opening the organization management page.
[0078] Step a22: In response to a selection operation on the organization management page, determine the configuration page of the target work node from the organization management page based on the selection operation.
[0079] The selection action is an action taken by the user from the organization management page to select a work node from the configuration page. This selection action can be generated by clicking with the mouse, using the keyboard selection keys, or by touching the screen.
[0080] Step a23: In response to the mode parameter configuration operation generated for the configuration page, determine the node parameters of the target working node based on the mode parameter configuration operation.
[0081] Configuration operations are editing or adjusting operations on mode parameters triggered by the user on the configuration page. Specifically, the configuration page displays multiple mode parameters to be configured, and the user can configure or adjust each mode parameter according to actual needs. Correspondingly, the computer device can respond to the user's mode parameter configuration operation and determine the node parameters of the target working node on the configuration page.
[0082] Step a3: Add the node parameters to the DNS contract to generate the target DNS contract.
[0083] Add the node parameters to the DNS contract and broadcast them to all nodes (i.e., the aforementioned worker nodes and management nodes) using the chain network DNS broadcast.
[0084] Step a4: Update the configuration data information of the default channel based on the node management API service, container service, and node parameters to obtain the target data information of the default channel.
[0085] Retrieve the channel configuration information (i.e., data information) for the default channel. Specifically, this can be done by calling the Fabric underlying command `configtxlator`. Then, prepare the new certificate for the target worker node: use the certificate distribution service to obtain the certificate file for the target worker node's MSP. Prepare the new configuration file: use the configuration template file to prepare the path to the new configuration file.
[0086] Step a5: Configure the target data information in the default channel.
[0087] The process involves preparing the order node certificate, converting the channel configuration information (ProtocolBuffers to JSON), determining the merged channel configuration to generate new configuration information, and calling the Fabric underlying command `configtxlator compute_update` during this process. It also calls the Fabric SDK interface to sign and update the channel configuration proposal. Finally, it executes and updates the channel configuration transaction.
[0088] Step a6: Add the target worker node to the default channel.
[0089] Specifically, step a6 above includes:
[0090] Step a61: In response to the click operation of the target object, obtain the certificate file of the order node.
[0091] Step a62: Based on the certificate file, add the target worker node to the default channel.
[0092] Click operations can be generated via mouse clicks, keyboard selection keys, or touch clicks. Specifically, the certificate distribution service is used to obtain the certificate file of the order node's MSP, and the target worker node is added to the default channel using the order node's MSP certificate file.
[0093] The order node serves the following functions: 1. Transaction sorting: After a peer node collects a certain number of transactions, it submits these transactions to the order node. The order node sorts these transactions according to certain rules to ensure that all nodes agree on the order of the transactions and avoid disagreements.
[0094] 2. Transaction Packaging: After sorting, the order node packages the transactions into blocks and broadcasts them to all peer nodes. These blocks contain the transaction information to be processed and the corresponding verification information.
[0095] 3. Consensus Mechanism: Order nodes also participate in the blockchain system's consensus mechanism. They communicate with other order nodes to reach a consensus, ensuring that only blocks that have passed consensus can be added to the blockchain.
[0096] The blockchain-based deployment method provided in this embodiment determines the node parameters of the target worker node through the node management API service when adding the target worker node, and generates a target DNS contract based on the node parameters and the DNS contract. This enables intelligent modification of the DNS contract to achieve communication connections between the target worker node, worker nodes, and management nodes.
[0097] In an optional implementation, the method further includes:
[0098] Step b1: Obtain the organization information of the working nodes.
[0099] Organization information may include: organization MSPID, IP address, anchor node port, and certificate distribution port. Specifically, organization information can be set by the user.
[0100] DNS middleware, combined with DNS contracts, simulates and implements the dynamic domain name system in a blockchain network, also known as multi-consortium blockchain DNS. The DNS middleware module consists of: 1. Block listener; 2. Event handling and polling; 3. DNS contract call listening and filtering; 4. Host record generation; 5. Hosts file management. Specifically...
[0101] Step b2: Add the organization information to the DNS contract through the default channel to generate the target DNS contract.
[0102] Specifically, in the default channel, the registerOrg method of the DNS contract is called by the management node in its management identity. The blockchain network is responsible for executing and recording a new organization information into the DNS contract, and then updating the record of the DNS contract with the organization IP and organization name to generate the target DNS contract.
[0103] In addition, a new block will be added to the blockchain network. Using the distributed synchronization mechanism of the blockchain, this information will be synchronized to the entire blockchain network. In this way, in the default channel, each node in the multi-consortium will receive the new block, and the DNS contracts on all nodes will obtain the DNS information of the newly added node.
[0104] Step b3: Determine the target information of the worker node based on the target DNS contract.
[0105] Step b4: Add the target information to the hosts file and map the target information to the various containers of the blockchain based on the hosts file.
[0106] The DNS middleware first registers a blockchain listener, then enters an event polling waiting process. When a new block is found to be an update of a DNS contract record, the listener extracts the contract call content, generates new IP addresses and other information, and records the newly generated information in the hosts file in Docker. Since this hosts file is mapped to the host machine by Docker, and the hosts file is also globally unique, updating the contents of this file will cover all containers on the Fabric blockchain, as well as this BaaS Deployment platform.
[0107] The blockchain-based deployment method provided in this embodiment adds organization information to the DNS contract through a default channel to generate a target DNS contract; determines the target information of the target node based on the target DNS contract; adds the target information to the hosts file; and maps the target information to each container of the blockchain based on the hosts file. This method can ensure that the information of the worker node can be dynamically distributed to each container.
[0108] In an optional implementation, the method further includes:
[0109] Step c1: Check if the default channel has been successfully established.
[0110] The system checks whether the default channel was established successfully, including two scenarios: Scenario 1: The default channel was established successfully; Scenario 2: The default channel was not established successfully. For Scenario 2, the DNS contract does not need to be configured on the default channel.
[0111] Step c2: If the default channel is successfully established, execute the steps of configuring the DNS contract on the default channel and adding the data information of the management node to the DNS contract.
[0112] For scenario one above, the DNS contract can be configured in the default channel.
[0113] The blockchain-based deployment method provided in this embodiment avoids the problem of DNS contracts being unable to be configured on the default channel, which would otherwise lead to excessive memory usage, by detecting whether the default channel has been successfully established.
[0114] In summary, the beneficial effects of the blockchain-based deployment method provided by this invention are as follows:
[0115] This invention addresses the problems of complex manual deployment methods in traditional consortium blockchains, which hinder multi-consortium expansion. It employs Docker deployment and utilizes a self-developed automated deployment solution to automate consortium blockchain deployment, significantly reducing operational costs and complexity while supporting multi-consortium expansion.
[0116] This addresses the need for dynamic on-chain DNS distribution in multi-consortium blockchains with multi-location deployments. Based on the beneficial effects of the ChainNet DNS module, it enables certificate distribution and chaincode distribution services.
[0117] This invention addresses the issue of reduced blockchain trustworthiness and security caused by centralized node deployment in third-party BaaS platforms. It enables decentralized, cross-network node deployment, ensuring that the owning enterprise has complete control over the node's certificate and private key ownership, thereby improving blockchain trustworthiness and security.
[0118] This invention addresses the needs for data privatization, data privacy, and localized data sharing. Utilizing Fabric's unique channel and private data scheme, it satisfies data privatization and privacy protection requirements in multi-consortium deployments, while also supporting localized data sharing between different consortia.
[0119] This embodiment also provides a blockchain-based deployment device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0120] This embodiment provides a blockchain-based deployment device, such as... Figure 5As shown, it includes: an acquisition module 501, used to acquire a DNS contract, a first image file of a private Docker repository, and a second image file; an allocation module 502, used to allocate the first image file and the second image file to worker nodes and management nodes; a generation module 503, used to generate a default channel corresponding to the management node based on the first image file and the second image file; a first addition module 504, used to configure the DNS contract on the default channel and add the data information of the management node to the DNS contract; and a second addition module 505, used to execute the first image file and the second image file on the worker nodes and add the worker nodes to the default channel so that the management node and the worker nodes can communicate.
[0121] In some optional implementations, the generation module 503 includes: a creation unit for creating an initial channel; a first determination unit for determining the data information of the management node based on a second image file; and a generation unit for processing the initial channel based on the first image file and the data information to generate a default channel corresponding to the management node.
[0122] In some optional implementations, the first image file includes a node management API service and a node management visualization service, and the second image file includes a container service; wherein, the above apparatus further includes: a startup module for starting the node management API service, the node management visualization service, and the container service of the target worker node; a determination module for determining the node parameters of the target worker node based on the node management visualization service; a contract generation module for adding the node parameters to the DNS contract to generate a target DNS contract; an update module for updating the configured data information of the default channel based on the node management API service, the container service, and the node parameters to obtain the target data information of the default channel; a configuration module for configuring the target data information in the default channel; and a target worker node adding module for adding the target worker node to the default channel.
[0123] In some optional implementations, the determining module includes: a trigger operation unit, configured to open the organization management page based on the trigger operation in response to a trigger operation of the target object; a selection operation unit, configured to determine the configuration page of the target work node from the organization management page based on the selection operation in response to a selection operation of the organization management page; and a configuration operation unit, configured to determine the node parameters of the target work node based on the mode parameter configuration operation in response to a mode parameter configuration operation generated for the configuration page.
[0124] In some optional implementations, the target worker node adding module includes: a click operation unit for obtaining the certificate file of the order node in response to a click operation of the target object; and a target worker node adding unit for adding the target worker node to the default channel based on the certificate file.
[0125] In some optional implementations, the second adding module 505 includes: an organization information acquisition unit for acquiring organization information of worker nodes; a target DNS contract generation unit for adding organization information to a DNS contract through a default channel to generate a target DNS contract; a second determination unit for determining target information of target nodes based on the target DNS contract; and a mapping unit for adding target information to a hosts file and mapping the target information to various containers of the blockchain based on the hosts file.
[0126] In an optional implementation, the apparatus further includes: a detection module for detecting whether the default channel has been successfully established; and an execution module for, if the default channel has been successfully established, executing the steps of configuring the DNS contract on the default channel and adding the data information of the management node to the DNS contract.
[0127] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0128] In this embodiment, the blockchain-based deployment device is presented in the form of functional units. Here, a functional unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0129] This invention also provides a computer device having the above-described features. Figure 5 The deployment device shown is based on blockchain.
[0130] Please see Figure 6 , Figure 6 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of the present invention, such as... Figure 6As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 6 Take a processor 10 as an example.
[0131] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.
[0132] The memory 20 stores instructions executable by at least one processor 10 to cause at least one processor 10 to perform the method shown in the above embodiments.
[0133] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0134] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.
[0135] The computer device also includes a communication interface 30 for communicating with other devices or communication networks.
[0136] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.
[0137] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A blockchain-based deployment method, characterized in that, include: Obtain the DNS contract, the first image file of the private Docker repository, and the second image file; Distribute the first image file and the second image file to the worker node and the management node; Based on the first image file and the second image file, a default channel corresponding to the management node is generated; Configure the DNS contract in the default channel, and add the data information of the management node to the DNS contract; In the working node, the first image file and the second image file are executed, and the working node is added to the default channel to enable communication between the management node and the working node.
2. The blockchain-based deployment method according to claim 1, characterized in that, The step of generating the default channel corresponding to the management node based on the first image file and the second image file includes: Create an initial channel; Based on the second image file, determine the data information of the management node; Based on the first image file and the data information, the initial channel is processed to generate the default channel corresponding to the management node.
3. The blockchain-based deployment method according to claim 1, characterized in that, The first image file includes: a node management API service and a node management visualization service; the second image file includes a container service; and also includes: Start the node management API service, node management visualization service, and container service of the target worker node; Based on the node management visualization service, determine the node parameters of the target working node; Add the node parameters to the DNS contract to generate the target DNS contract; The data information configured for the default channel is updated based on the node management API service, the container service, and the node parameters to obtain the target data information for the default channel; Configure the target data information in the default channel; Add the target working node to the default channel.
4. The blockchain-based deployment method according to claim 3, characterized in that, The process of determining the node parameters of the target working node based on the node management visualization service includes: In response to a triggering operation by the target object, the organization management page is opened based on the triggering operation; In response to a selection operation on the organization management page, the configuration page of the target work node is determined from the organization management page based on the selection operation; In response to the mode parameter configuration operation generated for the configuration page, the node parameters of the target working node are determined based on the mode parameter configuration operation.
5. The blockchain-based deployment method according to claim 4, characterized in that, Adding the target working node to the default channel includes: In response to a click action on the target object, retrieve the certificate file of the order node; Based on the certificate file, the target working node is added to the default channel.
6. The blockchain-based deployment method according to claim 1, characterized in that, Adding the working node to the default channel includes: Obtain the organization information of the working node; The organization information is added to the DNS contract through the default channel to generate the target DNS contract; Based on the target DNS contract, the target information of the working node is determined; The target information is added to the hosts file, and the target information is mapped to the various containers of the blockchain based on the hosts file.
7. The blockchain-based deployment method according to claim 1, characterized in that, Before configuring the DNS contract on the default channel and adding the management node's data information to the DNS contract, the process also includes: Check whether the default channel has been successfully established; If the default channel is successfully established, the steps of configuring the DNS contract on the default channel and adding the data information of the management node to the DNS contract are executed.
8. A blockchain-based deployment device, characterized in that, The device includes: The acquisition module is used to obtain the DNS contract, the first image file of the private Docker repository, and the second image file. The allocation module is used to allocate the first image file and the second image file to the worker node and the management node; The generation module is used to generate the default channel corresponding to the management node based on the first image file and the second image file; The first adding module is used to configure the DNS contract in the default channel and add the data information of the management node to the DNS contract; The second adding module is used to execute the first image file and the second image file in the working node, and add the working node to the default channel so that the management node and the working node can communicate.
9. A computer device, characterized in that, include: A memory and a processor are communicatively connected, the memory storing computer instructions, and the processor executing the computer instructions to perform the blockchain-based deployment method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to execute the blockchain-based deployment method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Mirror image file acquisition method and device, computer equipment and storage medium
CN109788032A
Block chain and container-based inference model cloud edge credible collaboration method and system
CN116127484A