CN117792897A - Deployment method and device based on blockchain, computer equipment and storage medium - Google Patents
Deployment method and device based on blockchain, computer equipment and storage medium Download PDFInfo
- Publication number
- CN117792897A CN117792897A CN202311704474.XA CN202311704474A CN117792897A CN 117792897 A CN117792897 A CN 117792897A CN 202311704474 A CN202311704474 A CN 202311704474A CN 117792897 A CN117792897 A CN 117792897A
- Authority
- CN
- China
- Prior art keywords
- node
- management
- image file
- dns
- contract
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 53
- 238000004891 communication Methods 0.000 claims abstract description 18
- 230000008520 organization Effects 0.000 claims description 36
- 230000015654 memory Effects 0.000 claims description 28
- 238000012800 visualization Methods 0.000 claims description 16
- 230000004044 response Effects 0.000 claims description 10
- 238000012545 processing Methods 0.000 claims description 4
- 239000004744 fabric Substances 0.000 description 14
- 230000006870 function Effects 0.000 description 11
- 238000010586 diagram Methods 0.000 description 8
- 230000007246 mechanism Effects 0.000 description 7
- 238000013507 mapping Methods 0.000 description 5
- 230000008569 process Effects 0.000 description 4
- 238000005538 encapsulation Methods 0.000 description 3
- 230000000007 visual effect Effects 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000009434 installation Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 239000007787 solid Substances 0.000 description 2
- 239000000872 buffer Substances 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 239000003795 chemical substances by application Substances 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000004806 packaging method and process Methods 0.000 description 1
- 238000011084 recovery Methods 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention relates to the technical field of blockchains, and discloses a deployment method, a device, computer equipment and a storage medium based on blockchains, wherein the method comprises the following steps: acquiring a DNS contract, a first image file and a second image file of a private Docker warehouse; distributing the first image file and the second image file to a working node and a management node; generating a default channel corresponding to the management node based on the first image file and the second image file; configuring a DNS contract to a default channel, and adding data information of a management node to the DNS contract; executing the first image file and the second image file in the working node, and adding the working node to a default channel so as to enable communication between the management node and the working node. According to the invention, the management node and the working node are added into the default channel, and communication between the management node and the working node is realized through the DNS intelligent contract, so that ownership and control rights of the nodes can be ensured to be distributed in each working node and the management node.
Description
Technical Field
The invention relates to the technical field of blockchains, in particular to a deployment method, a deployment device, computer equipment and a storage medium based on blockchains.
Background
Currently, based on a Baas platform of HyperLedger Fabric blockchain, mostly based on the infrastructure of Docker/K8S in public cloud or private cloud service platforms, or directly using Baas services provided by a third party blockchain cloud service platform, the deployment mode mostly adopts blockchain node centralized deployment, and node attribution is a rented third party organization or a single enterprise.
However, blockchain nodes and blockdata are controlled and managed by a single enterprise or a third party authority, and these centralized nodes are typically only directly controlled or viewed by some enterprises, so that other enterprises without rights cannot directly view or control the nodes.
Disclosure of Invention
In view of this, the present invention provides a deployment method, apparatus, computer device and storage medium based on blockchain, so as to solve the problem that blockchain nodes and blockdata are controlled and managed by a single enterprise or a third party, and only part of enterprises can usually directly control or view the nodes, so that other enterprises without authority cannot directly view or control the nodes.
In a first aspect, the present invention provides a blockchain-based deployment method, the method comprising: acquiring a DNS contract, a first image file and a second image file of a private Docker warehouse; distributing the first image file and the second image file to a working node and a management node; generating a default channel corresponding to the management node based on the first image file and the second image file; configuring a DNS contract to a default channel, and adding data information of a management node to the DNS contract; and executing the first image file and the second image file in the working node, and adding the working node to a default channel so as to enable communication between the management node and the working node.
According to the deployment method based on the blockchain, the management nodes and the working nodes are added to the default channel, and communication between the management nodes and the working nodes is realized through the DNS intelligent contracts, so that ownership and control rights of the nodes can be distributed among all the working nodes and the management nodes, and the problem that the blockchain nodes and the blockdata are controlled and managed by a single enterprise or a third party mechanism, and only part of the centralized nodes can be directly controlled or checked generally is solved, so that other enterprises without authority cannot directly check or control the nodes.
In some optional embodiments, generating a default channel corresponding to the management node based on the first image file and the second image file includes: creating an initial channel; determining 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 a default channel corresponding to the management node.
According to the deployment method based on the blockchain, the default channel corresponding to the management node can be intelligently generated by determining the data information of the management node.
In some alternative embodiments, the first image file includes: the node management API service and the node management visualization service, and the second image file comprises a container service; wherein, still include: starting node management API service, node management visualization service and container service of the target working node; determining node parameters of a target working node based on the node management visualization service; adding the node parameters to the DNS contract to generate a target DNS contract; updating the data information of the configuration of the default channel based on the node management API service, the container service and the node parameters to obtain target data information of the default channel; configuring target data information in a default channel; the target working node is added to the default channel.
According to the deployment method based on the blockchain, when the target working node is added, the node management API service is used for determining the node parameter of the target working node, and the target DNS contract is generated according to the node parameter and the DNS contract, so that the DNS contract can be intelligently modified, and communication connection between the target working node and the working node and between the target working node and the management node can be realized.
In some alternative embodiments, determining node parameters for the target working node based on the node management visualization service includes: responding to the triggering operation of the target object, and starting an organization management page based on the triggering operation; in response to a selection operation for the organization management page, determining a configuration page of the target working node from the organization management page based on the selection operation; in response to a mode parameter configuration operation generated for the configuration page, node parameters of the target working node are determined based on the mode parameter configuration operation.
In some alternative embodiments, adding the target working node to the default channel includes: responding to clicking operation of a target object, and acquiring a certificate file of an order node; based on the credential file, the target working node is added to the default channel.
According to the deployment method based on the blockchain, the target working node can communicate with other nodes through the certificate file of the order node, so that the target working node can be added to a default channel.
In some alternative embodiments, adding the working node to the default channel includes: obtaining organization information of the working node; through a default channel, adding organization information to a DNS contract to generate a target DNS contract; determining target information of a target node based on a target DNS contract; the target information is added to the hosts file and mapped to the various containers of the blockchain based on the hosts file.
According to the deployment method based on the blockchain, organization information is added to the DNS contracts through a default channel, and target DNS contracts are generated; determining target information of a target node based on a target DNS contract; the manner of adding the target information to the hosts file and mapping the target information to each container of the blockchain based on the hosts file can ensure that the information of the working node can be dynamically distributed to each container.
In some alternative embodiments, before configuring the DNS contract to the default channel and adding the data information of the management node to the DNS contract, further comprising: detecting whether a default channel is established successfully; if the default channel is established successfully, the steps of configuring the DNS contract to the default channel and adding the data information of the management node to the DNS contract are executed.
According to the deployment method based on the blockchain, the problem that the DNS contracts cannot be configured in the default channels and memory resources are occupied can be avoided by detecting whether the default channels are successfully established.
In a second aspect, the present invention provides a blockchain-based deployment device, the device comprising: the acquisition module is used for acquiring the first image file, the second image file and the DNS contract; the allocation generating module is used for allocating the first image file and the second image file to the management node and generating a default channel corresponding to the management node based on the first image file and the second image file; and the configuration adding module is used for configuring the DNS contracts to default channels and adding the data information of the management nodes to the DNS contracts so as to complete the deployment of the management nodes.
In a third aspect, the present invention provides a computer device comprising: the system comprises a memory and a processor, wherein the memory and the processor are in communication connection, the memory stores computer instructions, and the processor executes the computer instructions so as to execute the blockchain-based deployment method of the first aspect or any corresponding implementation mode.
In a fourth aspect, the present invention provides a computer readable storage medium having stored thereon computer instructions for causing a computer to perform the blockchain-based deployment method of the first aspect or any of its corresponding embodiments.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the description below are some embodiments of the present invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is an automated Baas management platform based on a HyperLedger Fabric blockchain in accordance with an embodiment of the invention;
FIG. 2 is a schematic diagram of a block chain deployment service module according to an embodiment of the present invention;
FIG. 3 is a flow diagram of a blockchain-based deployment method in accordance with an embodiment of the invention;
FIG. 4 is a flow diagram of another blockchain-based deployment method in accordance with an embodiment of the invention;
FIG. 5 is a block diagram of a block chain based deployment device according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a hardware structure of a computer device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Based on the related technology, currently, based on the bias platform of HyperLedger Fabric blockchain, most of the deployment modes are based on the infrastructure of Docker/K8S in public cloud or private cloud service platforms or directly use the bias service provided by a third party blockchain cloud service platform, and the deployment modes mostly adopt blockchain node centralized deployment, wherein the node attribution right is a rented third party organization or a single enterprise.
However, blockchain nodes and blockdata are controlled and managed by a single enterprise or a third party authority, and these centralized nodes are typically only directly controlled or viewed by some enterprises, so that other enterprises without rights cannot directly view or control the nodes.
Based on this, in the deployment method based on blockchain provided in this embodiment, by adding the management node and the working node to the default channel and implementing the communication between the management node and the working node by using the DNS intelligent contract, ownership and control rights of the nodes can be ensured to be distributed among each working node and the management node, so that the problem that the blockchain node and the blockdata are controlled and managed by a single enterprise or a third party mechanism, and only part of the enterprises can generally directly control or view the centralized nodes, so that other enterprises without authority cannot directly view or control the nodes is solved.
FIG. 1 illustrates an automated Baas management platform based on HyperLedger Fabric blockchain, which, in conjunction with FIG. 1, includes: an external application layer, a blockchain network layer, and an infrastructure layer. The BaaS service mainly relates to a block chain network layer, wherein the block chain network layer is divided into a block chain Deployment service (BaaS Deployment) and a user chain, and the block chain Deployment service (BaaSDepoyment) comprises a node management API service module and a node management visual UI; the node management visual UI realizes background front-end functions such as channel management, organization management, node management, contract management, middleware management and the like through interaction with the node management API service module. The infrastructure layer comprises two parts: docker mirror management and infrastructure resources. Wherein the infrastructure resources include physical machines, virtual machines, cloud hosts, and container clouds.
Fig. 2 shows a schematic structural diagram of a blockchain deployment service module, and in combination with the schematic structural diagram shown in fig. 2, the node management API service module is a core module of the BaaS deployment platform, and includes: API interface service, certificate management/distribution, channel management, chain network/node management, util common encapsulation module, application/middleware management, OSN ordering node/common management, and 7 big modules in total.
The API interface service belongs to a function call to the visualization UI module and the external exposure integration service.
The certificate management/distribution module functions are services for managing certificate private keys and signature services (including MSP, organization name, path, file name and other information management), distributing certificates among nodes and signing.
The channel management module is used for creating and managing channels in the Fabric alliance chain. The channel is a logically isolated blockchain subnetwork that allows participants to conduct transactions and data sharing in a private and secure environment. The channel management module is responsible for operations such as channel creation, configuration, updating, authority management and the like.
The chain network/node management module interacts with the user chain through the Fabric SDK to manage the organization membership, the key information such as identity certificates and keys, and can manage channel configuration files, so that chain management background logic functions such as organization management, node management and contract management are realized; the module ensures the stable operation of the alliance chain network, including the tasks of registration, cancellation, upgrading, fault recovery and the like of the nodes.
The Util common encapsulation module is a utility module and provides some shared functions and methods for simplifying and optimizing the development and operation of the BaaS platform. These functions include checking if the remote port is available, failed retrying management, loading certificate files, file presence, merging map data, encrypting and decrypting, hashing algorithms, data serialization, etc. The Util common encapsulation module provides a reusable tool and function library to improve the efficiency and reliability of the platform.
And the application/middleware management is realized, a user can custom write third-party applications and middleware, the applications and the middleware can call contracts, acquire or modify contract data, expand contract capability of a alliance chain, and enable the node management API service module to call and display front-end UI pages. The system provides the functions of deployment, configuration, monitoring, expansion and the like of applications and middleware. This module allows users to deploy their own applications to the BaaS platform and manage their lifecycle to ensure the availability and performance of the applications.
The OSN ordering node/consensus management module has the main capabilities of being used for the exclusive ordering node of the alliance chain and the management work of a consensus mechanism, and can add and delete the ordering node, update the consensus configuration and register new nodes to a common channel.
In accordance with an embodiment of the present invention, there is provided a blockchain-based deployment method embodiment, it being noted that the steps shown in the flowchart of the figures may be performed in a computer system, such as a set of computer-executable instructions, and, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in an order other than that shown or described herein.
In this embodiment, a deployment method based on a blockchain is provided, which may be used for an automatic bias management platform based on a HyperLedger Fabric blockchain, and fig. 1 is a schematic flow chart of a deployment method based on a blockchain, as shown in fig. 3, where the flow chart includes the following steps:
step S101, a DNS contract, a first image file and a second image file of a private Docker warehouse are acquired.
On the Docker image management server, a script is executed, a private image management service (i.e., a private Docker repository) is built in the infrastructure layer, and baasupposition image files (i.e., first image files) and image files (i.e., second image files) required by the Fabric blockchain are compiled and uploaded.
DNS contracts can be used to characterize contracts that establish communication links between working nodes and management nodes. The DNS contract may be a contract set autonomously by the user.
Step S102, the first image file and the second image file are distributed to the working node and the management node.
The worker node may be used to characterize an enterprise joining the blockchain. The number of the working nodes may be plural or 1, and the number is not particularly limited herein. The management node may be used to characterize an administrator node of the bias management platform. Specifically, in the working node and the management node, an installation environment is prepared, a script is executed, and the first image file and the second image file are pulled.
Step S103, generating a default channel corresponding to the management node based on the first image file and the second image file.
In the working node and the management node, the execution script automatically configures necessary environment variables, where the environment variables may include ID information, address information, etc. of the working node, and are not limited herein, baaS service is started by BaaS discovery agent in the Docker service, and node management API service, node management visualization service, and container service in the user chain are sequentially started, that is, the first image file and the second image file are executed, and a default channel corresponding to the management node is generated. The default channel is used for the management node and the working node to share data.
The script may be a script set by the user at his own time, and is not particularly limited herein.
Step S104, configuring the DNS contract to the default channel, and adding the data information of the management node to the DNS contract.
The data information may include: IP address, anchor node port, and certificate distribution port. Specifically, the DNS contracts are configured in the default channel, so that the management node and the working node of the default channel can establish a communication connection, and data information is added into the DNS contracts to complete the chain network DNS registration.
Step S105, executing the first image file and the second image file in the working node, and adding the working node to a default channel so as to enable communication between the management node and the working node.
And adding the working node into a default channel, so that communication is carried out between the management node and the working node.
According to the deployment method based on the blockchain, the management nodes and the working nodes are added to the default channel, and communication between the management nodes and the working nodes is realized through the DNS intelligent contracts, so that ownership and control rights of the nodes can be distributed among all the working nodes and the management nodes, and the problem that the blockchain nodes and the blockdata are controlled and managed by a single enterprise or a third party mechanism, and only part of the centralized nodes can be directly controlled or checked generally is solved, so that other enterprises without authority cannot directly check or control the nodes.
In this embodiment, a deployment method based on a blockchain is provided, which may be used in the above-mentioned automatic bias management platform based on HyperLedger Fabric blockchain, and fig. 2 is a schematic flow chart of a deployment method based on a blockchain, as shown in fig. 4, where the flow chart includes the following steps:
step S201, obtaining a DNS contract, a first image file of a private Docker repository, and a second image file. Please refer to step S101 in the embodiment shown in fig. 3 in detail, which is not described herein.
Step S202, the first image file and the second image file are distributed to the working node and the management node. Please refer to step S102 in the embodiment shown in fig. 3 in detail, which is not described herein.
Step S203, a default channel corresponding to the management node is generated based on the first image file and the second image file.
Specifically, the step S203 includes:
in step S2031, an initial channel is created.
The initial channel may be used to characterize the initial channel that is present in an automated bias management platform based on HyperLedger Fabric blockchain.
Step S2032, determining data information of the management node based on the second image file.
From the above, it can be seen that the second image file is the image file required by the Fabric block chain, and may include: peer/Order/CA, etc. Through services such as Peer, order and CA, information such as IP addresses, anchor node ports and certificate distribution ports can be configured for the management nodes.
Step S2033, processing the initial channel based on the first image file and the data information, and generating a default channel corresponding to the management node.
The initial channel is provided with initial configuration information, wherein the initial configuration information is provided by the initial channel, and after the data information is determined, the initial configuration information can be modified through the first image file and the data information to generate a default channel.
In step S204, the DNS contract is configured to the default channel, and the data information of the management node is added to the DNS contract. Please refer to step S104 in the embodiment shown in fig. 3, which is not described herein.
In step S205, 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, so that communication is performed between the management node and the working node. Please refer to step S105 in the embodiment shown in fig. 3 in detail, which is not described herein.
According to the deployment method based on the blockchain, the default channel corresponding to the management node can be intelligently generated by determining the data information of the management node.
In an alternative embodiment, the method further comprises:
step a1, starting node management API service, node management visualization service and container service of the target working node.
The target working node may be used to characterize nodes that newly join the default channel. In the target working node, an installation environment is prepared, a script is executed, necessary environment variables are automatically configured, a BaaS service is started in a Docker service, and a node management API service, a node management visualization service, and necessary container services (Peer, CA, etc.) in a user chain are sequentially started.
Step a2, determining node parameters of the target working node based on the node management visualization service.
According to the node management visualization service, a user can configure node parameters of a target working node. The manner of specific configuration is described in detail below.
Specifically, the step a2 includes:
step a21, responding to the triggering operation of the target object, and opening the organization management page based on the triggering operation.
The triggering operation is an operation generated by a user (i.e., a target object) through a mouse click, a keyboard selection, or a touch screen. When the user sends out the trigger operation, the computer equipment can respond to the sent trigger operation by the user, and open the organization management page.
Step a22, in response to the selection operation for the organization management page, determining the configuration page of the target working node from the organization management page based on the selection operation.
The selection operation is an operation of selecting a configuration page of the work node from the organization management page by a user, and the selection operation may be generated by a mouse click, may be generated by a keyboard selection key, or may be generated by a touch click.
Step a23, in response to the mode parameter configuration operation generated for the configuration page, determining node parameters of the target working node based on the mode parameter configuration operation.
The configuration operation is an editing operation or an adjusting operation generated by a user for the mode parameter triggered on the configuration page. Specifically, a plurality of mode parameters to be configured are displayed in the configuration page, and a user can configure or adjust each mode parameter according to actual requirements. Accordingly, the computer device may determine node parameters of the target working node at the configuration page in response to the user's mode parameter configuration operation.
And a step a3, adding the node parameters to the DNS contract to generate a target DNS contract.
The node parameters are added to the DNS contract and published to all nodes (i.e., the working nodes and management nodes described above) using a chain network DNS broadcast.
And a step a4, updating the data information of the configuration 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.
Channel configuration information (i.e., data information) of the default channel is acquired. Specifically, the channel configuration information may be obtained by calling a Fabric underlying command configtxlator. Then preparing a new certificate of the target working node: using the certificate distribution service, a certificate file of the MSP of the target working node is obtained. Preparing a new configuration file: using the configuration template file, a new configuration file path is prepared.
And a step a5, configuring the target data information in a default channel.
Preparing order node certificate (order node certificate), converting configuration information (protocols Buffers to JSON) of update channels, determining configuration of merge channels to generate new configuration information, and calling Fabric bottom command configtxlator compute _update in the process. The Fabric SDK interface signature update channel configuration proposal is invoked. The channel configuration transaction is executed and updated.
Step a6, adding the target working node to the default channel.
Specifically, the step a6 includes:
step a61, obtaining a certificate file of the order node in response to the clicking operation of the target object.
Step a62, adding the target working node to the default channel based on the certificate file.
The clicking operation may be generated by a mouse click, may be generated by a keyboard selection key, or may be generated by a touch click. Specifically, a certificate distribution service is used to obtain a certificate file of the MSP of the order node, and the target working node is added to the default channel through the certificate file of the MSP of the order node.
The function of the order node is as follows: 1. transaction ordering-when the peer node is used to collect a certain number of transactions, the transactions are submitted to the order node. order nodes can sort the transactions according to a certain rule, so that the order of all the nodes to the transactions is ensured to be agreed, and the divergence is avoided.
2. And (3) transaction packaging: after the ordering is completed, the order node packages the transaction into blocks and broadcasts the blocks to all peer nodes. The blocks contain transaction information to be processed and corresponding verification information.
3. Consensus mechanism: the order node also participates in the consensus mechanism of the blockchain system. It communicates with other order nodes, agreeing to ensure that only commonly owned blocks can be added to the blockchain.
According to the deployment method based on the blockchain, when the target working node is added, the node management API service is used for determining the node parameter of the target working node, and the target DNS contract is generated according to the node parameter and the DNS contract, so that the DNS contract can be intelligently modified, and communication connection between the target working node and the working node and between the target working node and the management node can be realized.
In an alternative embodiment, the method further comprises:
And b1, acquiring organization information of the working node.
The organization information may include: the MSPID, IP address, anchor node Port, certificate distribution Port are organized. In particular, the organization information may be set autonomously by the user.
The DNS middleware is matched and combined with the DNS contracts to simulate and realize a dynamic domain name system in the blockchain network, namely a multi-alliance chain network DNS. DNS middleware module is composed of: 1. block listener 2, event handling and polling call 3, DNS contract call listening filter 4, generate host record 5, hosts file management, in particular,
and b2, adding organization information to the DNS contract through a default channel to generate a target DNS contract.
Specifically, in the default channel, the register org method of the DNS contract is called with the management identity of the management node, and the blockchain network is responsible for executing and recording a new piece of organization information into the DNS contract, and then updating the record of updating the DNS contract by using the organization IP and the organization name to generate the target DNS contract.
In addition, the blockchain network adds a new block, and the information is synchronized to the whole blockchain network by using a distributed synchronization mechanism of the blockchain, so that in a default channel, each node in the multi-alliance receives the new block, and DNS contracts on all nodes acquire DNS information of the newly added node.
And b3, determining target information of the working node based on the target DNS contract.
Step b4, adding the target information to the hosts file, and mapping the target information to each container of the blockchain based on the hosts file.
The method comprises the steps that a blockchain monitor is registered in a DNS middleware first, then an event polling waiting process is carried out, when a newly added block is found to be updated in a DNS contract record, the monitor can extract contract calling content, generate information such as a new IP address and the like, record the newly generated information into a Hosts file in a Docker, and update the file content to all containers of a Fabric blockchain and to the BaaS decryption platform because the Hosts file is mapped to a host machine by the Docker and is a globally unique Hosts.
According to the deployment method based on the blockchain, organization information is added to the DNS contracts through a default channel, and target DNS contracts are generated; determining target information of a target node based on a target DNS contract; the manner of adding the target information to the hosts file and mapping the target information to each container of the blockchain based on the hosts file can ensure that the information of the working node can be dynamically distributed to each container.
In an alternative embodiment, the method further comprises:
step c1, detecting whether the default channel is successfully established.
Detecting whether the default channel is established successfully, including two cases: case one: successful default channel establishment, case two: the default channel setup is unsuccessful. For case two: there is no need to configure DNS contracts to default channels.
Step c2, if the default channel is established successfully, executing the steps of configuring the DNS contract to the default channel and adding the data information of the management node to the DNS contract.
For case one above, a DNS contract may be configured for the default channel.
According to the deployment method based on the blockchain, the problem that the DNS contracts cannot be configured in the default channels and memory resources are occupied can be avoided by detecting whether the default channels are successfully established.
In summary, the deployment method based on the blockchain provided by the invention has the following beneficial effects:
the problem that the traditional manual deployment mode of the alliance chain is complex and unfavorable for multi-alliance expansion is solved. The invention adopts a Docker mode to deploy, realizes the automatic deployment of the alliance chains by using a developed automatic deployment scheme, can greatly reduce the operation and maintenance cost and complexity, and simultaneously supports multi-alliance expansion.
The method and the system solve the requirement of dynamic distribution of DNS on a multi-deployment mid-chain in multi-alliance blockchain. And based on the beneficial effects of the chain network DNS module, certificate distribution and chain code distribution service are realized.
The problem that the reliability and the safety of the blockchain are reduced due to centralized deployment of nodes of the third-party BaaS platform is solved. The invention realizes the decentralization cross-network deployment of the nodes, and the enterprise completely grasps the ownership of the certificate private key of the nodes, thereby improving the credibility and the safety of the blockchain.
And the demands of data privatization and data privacy and local sharing are solved. The invention adopts a unique channel and private data scheme of Fabric, can meet the requirements of privatization and privacy protection of data in multi-alliance deployment, and simultaneously supports local data sharing among different alliances.
The embodiment also provides a deployment device based on a blockchain, which is used for realizing the above embodiment and the preferred implementation manner, and the description is omitted. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
The present embodiment provides a deployment apparatus based on blockchain, as shown in fig. 5, including: an obtaining module 501, configured to obtain a DNS contract, a first image file of a private Docker repository, and a second image file; the distribution module 502 is configured to distribute the first image file and the second image file to the working node and the management node; a generating module 503, configured to generate a default channel corresponding to the management node based on the first image file and the second image file; a first adding module 504, configured to configure a DNS contract to a default channel, and add data information of a management node to the DNS contract; the second adding module 505 is configured 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 communication is performed between the management node and the working node.
In some alternative embodiments, the generating module 503 includes: a creation unit for creating an initial channel; a first determining unit configured to determine data information of the management node based on the second image file; and the generating unit is used for processing the initial channel based on the first image file and the data information and generating a default channel corresponding to the management node.
In some alternative embodiments, the first image file includes: the node management API service and the node management visualization service, and the second image file comprises a container service; wherein, the device further includes: the starting module is used for starting node management API service, node management visual service and container service of the target working node; the determining module is used for determining node parameters of the target working node based on the node management visualization service; the contract generation module is used for adding the node parameters to the DNS contract to generate a target DNS contract; the updating module is used for updating the data information of the configuration 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; the configuration module is used for configuring the target data information in a default channel; and the target working node adding module is used for adding the target working node to the default channel.
In some alternative embodiments, the determining module includes: the trigger operation unit is used for responding to the trigger operation of the target object and opening the organization management page based on the trigger operation; a selection operation unit configured to determine a configuration page of the target working node from the organization management page based on a selection operation in response to the selection operation for the organization management page; and a configuration operation unit for determining node parameters of the target working node based on the mode parameter configuration operation in response to the mode parameter configuration operation generated for the configuration page.
In some alternative embodiments, the target working node addition module includes: the clicking operation unit is used for responding to clicking operation of the target object and acquiring a certificate file of the order node; and the target working node adding unit is used for adding the target working node to the default channel based on the certificate file.
In some alternative embodiments, the second adding module 505 includes: an organization information acquisition unit for acquiring organization information of the working node; the target DNS contract generation unit is used for adding organization information to the DNS contract through a default channel to generate a target DNS contract; a second determining unit configured to determine target information of the target node based on the target DNS contract; and a mapping unit for adding the target information to the hosts file and mapping the target information to respective containers of the blockchain based on the hosts file.
In an alternative embodiment, the apparatus further comprises: the detection module is used for detecting whether the default channel is successfully established; and the execution module is used for executing the steps of configuring the DNS contract in the default channel and adding the data information of the management node to the DNS contract if the default channel is successfully established.
Further functional descriptions of the above respective modules and units are the same as those of the above corresponding embodiments, and are not repeated here.
The blockchain-based deployment device in this embodiment is presented in the form of functional units, herein referred to as ASIC (Application Specific Integrated Circuit ) circuits, processors and memories executing one or more software or firmware programs, and/or other devices that can provide the functionality described above.
The embodiment of the invention also provides computer equipment, which is provided with the deployment device based on the blockchain shown in the figure 5.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a computer device according to an alternative embodiment of the present invention, as shown in fig. 6, the computer device includes: one or more processors 10, memory 20, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components are communicatively coupled to each other using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions executing within the computer device, including instructions stored in or on memory to display graphical information of the GUI on an external input/output device, such as a display device coupled to the interface. In some alternative embodiments, multiple processors and/or multiple buses may be used, if desired, along with multiple memories and multiple memories. Also, multiple computer devices may be connected, each providing a portion of the necessary operations (e.g., as a server array, a set of blade servers, or a multiprocessor system). One processor 10 is illustrated in fig. 6.
The processor 10 may be a central processor, a network processor, or a combination thereof. The processor 10 may further include a hardware chip, among others. The hardware chip may be an application specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general-purpose array logic, or any combination thereof.
Wherein the memory 20 stores instructions executable by the at least one processor 10 to cause the at least one processor 10 to perform a method for implementing the embodiments described above.
The memory 20 may include a storage program area that may store an operating system, at least one application program required for functions, and a storage data area; the storage data area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, memory 20 may optionally include memory located remotely from processor 10, which 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.
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 disk; the memory 20 may also comprise a combination of the above types of memories.
The computer device also includes a communication interface 30 for the computer device to communicate with other devices or communication networks.
The embodiments of the present invention also provide a computer readable storage medium, and the method according to the embodiments of the present invention described above may be implemented in hardware, firmware, or as a computer code which may be recorded on a storage medium, or as original stored in a remote storage medium or a non-transitory machine readable storage medium downloaded through a network and to be stored in a local storage medium, so that the method described herein may be stored on such software process on a storage medium using a general purpose computer, a special purpose processor, or programmable or special purpose hardware. The storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, a solid state disk or the like; further, the storage medium may also comprise a combination of memories of the kind described above. It will be appreciated that a computer, processor, microprocessor controller or programmable hardware includes a storage element that can store or receive software or computer code that, when accessed and executed by the computer, processor or hardware, implements the methods illustrated by the above embodiments.
Although embodiments of the present invention have been described in connection with the accompanying drawings, various modifications and variations may be made by those skilled in the art without departing from the spirit and scope of the invention, and such modifications and variations fall within the scope of the invention as defined by the appended claims.
Claims (10)
1. A blockchain-based deployment method, comprising:
acquiring a DNS contract, a first image file and a second image file of a private Docker warehouse;
distributing the first image file and the second image file to a working node and a management node;
generating a default channel corresponding to the management node based on the first image file and the second image file;
configuring the DNS contract to the default channel, and adding data information of the management node to the DNS contract;
and executing the first image file and the second image file in the working node, and adding the working node to the default channel so as to enable communication between the management node and the working node.
2. The blockchain-based deployment method of claim 1, wherein the generating a default channel corresponding to the management node based on the first image file and the second image file includes:
Creating an initial channel;
determining 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 a default channel corresponding to the management node.
3. The blockchain-based deployment method of claim 1, wherein the first image file includes: the node management API service and the node management visualization service, wherein the second image file comprises a container service; wherein, still include:
starting node management API service, node management visualization service and container service of the target working node;
determining node parameters of the target working node based on the node management visualization service;
adding the node parameters to the DNS contract to generate a target DNS contract;
updating the data information of the configuration of the default channel based on the node management API service, the container service and the node parameter to obtain target data information of the default channel;
configuring the target data information in the default channel;
the target working node is added to the default channel.
4. The blockchain-based deployment method of claim 3, wherein the determining node parameters of the target working node based on the node management visualization service comprises:
responding to the triggering operation of the target object, and starting an organization management page based on the triggering operation;
in response to a selection operation for an organization management page, determining a configuration page of the target working node from the organization management page based on the selection operation;
in response to a mode parameter configuration operation generated for the configuration page, node parameters of the target working node are determined based on the mode parameter configuration operation.
5. The blockchain-based deployment method of claim 4, wherein adding the target working node to the default channel comprises:
responding to clicking operation of a target object, and acquiring a certificate file of an order node;
based on the credential file, the target working node is added to the default channel.
6. The blockchain-based deployment method of claim 1, wherein the adding the working node to the default channel comprises:
Obtaining organization information of the working node;
adding the organization information to the DNS contract through the default channel to generate a target DNS contract;
determining target information of the working node based on the target DNS contract;
the target information is added to a hosts file and mapped to individual containers of the blockchain based on the hosts file.
7. The blockchain-based deployment method of claim 1, further comprising, prior to configuring the DNS contract to the default channel and adding the data information of the management node to the DNS contract:
detecting whether the default channel is established successfully or not;
and if the default channel is established successfully, executing the steps of configuring the DNS contract to the default channel and adding the data information of the management node to the DNS contract.
8. A blockchain-based deployment device, the device comprising:
the acquisition module is used for acquiring a DNS contract, a first image file and a second image file of the private Docker warehouse;
the distribution module is used for distributing the first image file and the second image file to a working node and a management node;
The generation module is used for generating a default channel corresponding to the management node based on the first image file and the second image file;
a first adding module, configured to configure the DNS contract to the default channel, and add data information of the management node to the DNS contract;
and the second adding module is used for executing the first image file and the second image file in the working node, and adding the working node to the default channel so as to enable the management node to communicate with the working node.
9. A computer device, comprising:
a memory and a processor communicatively coupled to each other, the memory having stored therein computer instructions that, upon execution, perform the blockchain-based deployment method of any of claims 1-7.
10. A computer-readable storage medium having stored thereon computer instructions for causing a computer to perform the blockchain-based deployment method of any of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311704474.XA CN117792897A (en) | 2023-12-12 | 2023-12-12 | Deployment method and device based on blockchain, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311704474.XA CN117792897A (en) | 2023-12-12 | 2023-12-12 | Deployment method and device based on blockchain, computer equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117792897A true CN117792897A (en) | 2024-03-29 |
Family
ID=90393685
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311704474.XA Pending CN117792897A (en) | 2023-12-12 | 2023-12-12 | Deployment method and device based on blockchain, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117792897A (en) |
-
2023
- 2023-12-12 CN CN202311704474.XA patent/CN117792897A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108549580B (en) | Method for automatically deploying Kubernets slave nodes and terminal equipment | |
CN112119374B (en) | Selectively providing mutual transport layer security using alternate server names | |
CN108536519B (en) | Method for automatically building Kubernetes main node and terminal equipment | |
US11089115B2 (en) | Discovery of cloud-based infrastructure and resources | |
CN109194506B (en) | Block chain network deployment method, platform and computer storage medium | |
CN108809722B (en) | Method, device and storage medium for deploying Kubernetes cluster | |
WO2020253347A1 (en) | Container cluster management method, device and system | |
US20190207812A1 (en) | Hybrid cloud network configuration management | |
CN111782232A (en) | Cluster deployment method and device, terminal equipment and storage medium | |
US8713177B2 (en) | Remote management of networked systems using secure modular platform | |
CN112181397A (en) | Flow visualization monitoring method and device, computer equipment and storage medium | |
EP2675127B1 (en) | Method and device for automatically migrating system configuration item | |
WO2018014657A1 (en) | Unified portal method, apparatus and system | |
CN111459415A (en) | Cross-cloud data migration method, device, equipment and storage medium | |
CN110324399B (en) | Bringing cluster awareness into a facility management portal | |
JP7551222B2 (en) | Data processing method, device and computer device based on blockchain network | |
CN106911648B (en) | Environment isolation method and equipment | |
JP2023500669A (en) | Cloud services for cross-cloud operations | |
CN118012572A (en) | Techniques for automatically configuring minimum cloud service access rights for container applications | |
CN110138577B (en) | Cluster creation method, first server and readable storage medium | |
CN115604120B (en) | Multi-cloud cluster resource sharing method, device, equipment and storage medium | |
WO2024148833A1 (en) | Container multi-network-interface-card network configuration method, apparatus, and device, and storage medium | |
CN112035062B (en) | Migration method of local storage of cloud computing, computer equipment and storage medium | |
CN110890987A (en) | Method, device, equipment and system for automatically creating cluster | |
CN110928554A (en) | Deployment method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |