A method and system for dynamically constructing a blockchain

By creating server parameters on the BaaS platform, transmitting the blockchain service build program, and initializing the blockchain environment, the problem of existing platforms being unable to dynamically build Hyperledger Fabric blockchains is solved, enabling efficient blockchain system deployment and management, and reducing operational complexity.

CN116866035BActive Publication Date: 2026-03-20SUZHOU HEIYUN INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-11
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

Existing BaaS platforms lack dynamic building capabilities when constructing Hyperledger Fabric blockchains, resulting in high operational complexity. They are unable to perform offline initialization, configure blockchain block production parameters, and create blockchain explorers, thus hindering the rapid construction of blockchain systems.

Method used

This paper provides a method and system for dynamically constructing blockchains. It creates server parameters through a BaaS platform, uses the scp command to transfer the blockchain service build program, creates a 2048-bit public-private key pair, downloads resource packages and initializes the blockchain environment, supports offline deployment, including Go, Docker, Docker-Compose and Fabric images, and enables rapid deployment of blockchain explorers.

Benefits of technology

It reduces the cost of using blockchain systems, improves development efficiency, allows developers to focus on business development, and simplifies the management and deployment process of blockchain systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116866035B_ABST
    Figure CN116866035B_ABST
Patent Text Reader

Abstract

The application relates to a method and system for dynamically constructing a blockchain, and belongs to the computer field.The system comprises an application layer, a service layer, a blockchain layer and a resource layer;the application layer comprises a blockchain server management module, a blockchain management module and an intelligent contract management module;the blockchain server management module initializes a basic environment for constructing a blockchain for a blockchain server, and a developer inputs server parameters to complete blockchain environment deployment;the service layer of the blockchain server management module comprises an initialization environment, operation and maintenance management and security management;the service layer of the blockchain management module comprises node management, blockchain configuration and a blockchain browser establishment;the service layer of the intelligent contract management module comprises uploading an intelligent contract, deploying an intelligent contract and upgrading an intelligent contract.A developer uses a visual interface to create and manage a blockchain system on a pure system, so that the use cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the field of computer, and relates to a method and system for dynamically constructing a blockchain. BACKGROUND

[0002] A blockchain is a distributed ledger (database) maintained by multiple parties, each node stores the same, complete data, ensuring data traceability and non-tamperability, and the blockchain technology has been widely applied in various industries. According to the access mechanism, the blockchain is divided into public chain and alliance chain. In the alliance chain, the approval of the alliance is required to become a blockchain node, which reduces the addition of malicious nodes, and the participating organizations have a basic trust relationship with each other, and the consensus algorithm of the alliance chain is more efficient than that of the public chain. Hyperledger Fabric is the current mainstream alliance chain framework and is widely used in enterprises.

[0003] The current construction of Hyperledger Fabric blockchain requires complex environment configuration and writing of multiple configuration files, which generally requires experienced professionals to operate, and the construction and debugging of the blockchain configuration file are relatively cumbersome, which greatly affects the efficiency of constructing the blockchain. Blockchain as a Service (BaaS) is a cloud service model of blockchain, which simplifies the development and management of blockchain by using the deployment and management convenience of cloud server infrastructure, reduces development cost and improves development efficiency, so that developers can focus more on business logic.

[0004] Currently, there are some BaaS platforms that adapt to Hyperledger Fabric, such as the cello project of hyperledger and some secondary development BaaS platforms based on the cello project. These BaaS platforms mainly include the functions of configuring organizations, configuring agents, configuring nodes, configuring blockchain networks (including network names, consensus and state databases), configuring channels and chaincodes. However, the functions implemented by the existing BaaS platforms are not perfect enough for dynamically constructing a blockchain, such as being unable to perform offline initialization on the blockchain server, configure the block parameters of the blockchain, and create a blockchain explorer, which hinders the operation personnel to quickly construct a blockchain system.

[0005] Therefore, in order to reduce the complexity of the operation personnel in constructing the blockchain, there is an urgent need for a new method and system for dynamically constructing a blockchain based on Hyperledger Fabric to solve this problem. SUMMARY

[0006] Therefore, in order to reduce the complexity of the operation personnel in constructing the blockchain, there is an urgent need for a new method and system for dynamically constructing a blockchain based on Hyperledger Fabric to solve this problem.

[0007] To achieve the above object, the present application provides the following technical solutions:

[0008] A method for dynamically constructing a blockchain, comprising the following steps:

[0009] S1: A user creates server parameters of a blockchain on a BaaS platform, the server parameters including a blockchain name, a host IP, a password of a host root account, a host operating system and a blockchain description, and waiting for a blockchain server environment initialization;

[0010] S2: After receiving a command of the user for initializing the blockchain server, the BaaS background transmits a blockchain service construction program to the blockchain server and starts the blockchain service construction program;

[0011] Among them, the corresponding blockchain service construction program is different for the operating system of the blockchain server, and the blockchain service construction program is transmitted through an scp command;

[0012] S3: The blockchain construction service program creates a 2048-bit public-private key pair for subsequent signature and authentication communication with the BaaS platform;

[0013] Among them, the certificate format is pkcs8, the result of using the RSA private key pair processing is signed, and the result of the processing includes a result code and prompt information of an execution request;

[0014] S4: The BaaS platform initiates a command for obtaining an environment resource package to the blockchain construction service program, and the blockchain construction service program downloads the resource package from a specified resource address according to the operating system version of the local machine; wherein the resource address includes an intranet address, and the downloading process of the environment resource package supports completion without using public internet;

[0015] S5: After the environment resource package is downloaded, an environment initialization script is executed to install the blockchain environment to the blockchain server; wherein the blockchain environment includes go, docker, docker-compose and images and tools of Fabric;

[0016] S6: After the environment initialization is completed, the blockchain construction service program listens to a specified port, receives a request of the BaaS platform and executes a corresponding cmd command, thereby completing the dynamic construction of the blockchain.

[0017] Optionally, the host operating system includes centos7, ubuntu20 and ubuntu22.

[0018] Optionally, the request of the BaaS platform includes generating a blockchain network, installing and downloading a smart contract and running a blockchain browser.

[0019] A system for dynamically constructing a blockchain, comprising an application layer, a service layer, a blockchain layer and a resource layer;

[0020] The application layer comprises a blockchain server management module, a blockchain management module and an intelligent contract management module;

[0021] The blockchain server management module initializes the basic environment for constructing a blockchain for a blockchain server, and a developer inputs server parameters to complete deployment of a blockchain environment;

[0022] The server parameters include a blockchain name, a host IP, a password for a host root account, a host operating system and a blockchain description;

[0023] The service layer of the blockchain server management module comprises initialization of an environment, operation and maintenance management and security management;

[0024] The service layer of the blockchain management module comprises node management, blockchain configuration and establishment of a blockchain browser;

[0025] The service layer of the intelligent contract management module comprises uploading, deploying and upgrading an intelligent contract;

[0026] After receiving the request, the BaaS platform sends a deployment script to the blockchain server through an scp command, and then deploys a blockchain environment by executing an automated script;

[0027] The blockchain environment comprises go, docker, docker-compose and images and tools of Fabric;

[0028] The blockchain layer is a Hyperledger Fabric blockchain and a blockchain browser thereof;

[0029] The node management comprises peer node management and orderer node management; in the management of a peer node, the name of the node and the organization to which the node belongs are set, and in the management of an orderer node, the cluster to which the node belongs, the number of nodes and the blockchain to which the node belongs are set;

[0030] The blockchain configuration is a configuration of different channels of a blockchain, and the configuration parameters include block time, maximum transaction volume of a block, maximum byte number of a block and maximum byte number of a transaction;

[0031] The establishment of a blockchain browser is a blockchain browser constructed using a BaaS platform;

[0032] The intelligent contract management module is used for uploading and installing an intelligent contract;

[0033] The user needs to configure parameters when uploading the smart contract, and the configuration parameters include a contract name, a channel, a language, a version number and a contract file;

[0034] After uploading the smart contract, deployment is performed on a node;

[0035] The resource layer includes a public cloud, a private cloud and Docker.

[0036] Optionally, the host operating system includes centos7, ubuntu20 and ubuntu22.

[0037] Optionally, the deployment on the node includes packaging, installation and instantiation of the contract source code.

[0038] The present application has the beneficial effect that the present application proposes a method and system for dynamically constructing a blockchain of Hyperledger Fabric, and developers can efficiently create and manage a blockchain system on a pure system using a visual interface, and can conveniently deploy a smart contract and deploy a blockchain browser with one key, and the system can significantly reduce the use cost of the blockchain system, so that the developers can focus more on business development.

[0039] Other advantages, objects, and features of the present application will be understood in view of the following specification, and to some extent will be apparent to those skilled in the art from the examination of the following specification, or can be learned from the practice of the present application. The objects and other advantages of the present application can be achieved and obtained by the following specification. BRIEF DESCRIPTION OF DRAWINGS

[0040] In order to make the objects, technical solutions and advantages of the present application clearer, the preferred detailed description of the present application will be combined with the drawings as follows, wherein:

[0041] Figure 1 System architecture diagram of the present application

[0042] Figure 2 Method flowchart of the present application. DETAILED DESCRIPTION

[0043] The embodiments of the present application are described below through specific specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the disclosure of the present specification. The present application can also be implemented or applied by different specific embodiments, and the details in the specification can be modified or changed based on different views and applications without departing from the spirit of the present application. It should be noted that the diagrams provided in the following examples only illustrate the basic concept of the present application in a schematic manner, and the following examples and features in the examples can be combined with each other without conflict.

[0044] The drawings are only used for exemplary illustration, and the representation is only a schematic diagram, not a physical diagram, and cannot be understood as a limitation on the present application; in order to better illustrate the embodiments of the present application, some components in the drawings are omitted, enlarged or reduced, and do not represent the size of the actual product; it is understandable to those skilled in the art that some well-known structures in the drawings and their descriptions can be omitted.

[0045] The same or similar reference numerals in the drawings of the embodiments of the present application correspond to the same or similar components; in the description of the present application, it is understood that if the terms "upper", "lower", "left", "right", "front", "back" and the like indicate the orientation or positional relationship shown in the drawings, only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a particular orientation, be constructed and operated in a particular orientation, therefore the terms describing the positional relationship in the drawings are only used for exemplary illustration, and cannot be understood as a limitation on the present application, for those skilled in the art, the specific meaning of the above terms can be understood according to the specific circumstances.

[0046] As Figure 1 shown, the system for dynamically constructing a blockchain of Hyperledger Fabric provided by the present application is composed of an application layer, a service layer, a blockchain layer and a resource layer, the application layer is an interactive entrance for users to interact with the system in the present application; the service layer is composed of a BaaS platform background and a blockchain construction service program, and provides a blockchain management service for the application layer; the blockchain framework used by the blockchain layer is Hyperledger Fabric v2.3, and the nodes therein store core business data; the resource layer includes public cloud, private cloud, BaaS platform and blockchain system running in Docker.

[0047] The application layer is an interactive entrance for users to use the system, that is, the front-end interface of the BaaS platform, which is realized using the Vue.JS framework. The application layer mainly includes functions such as blockchain server management, blockchain management, smart contract management, and developers can conveniently use the system to construct and manage the blockchain through the browser.

[0048] Among them, the version of Vue.JS is 2.6.10, the blockchain server management function mainly includes initializing the blockchain server environment, operation and maintenance management, security management, etc.; the blockchain management function mainly includes node management, blockchain configuration, blockchain browser creation, etc.; the smart contract management mainly includes uploading smart contract, deploying smart contract, upgrading smart contract.

[0049] The parameters that need to be filled in by the user in the initialization blockchain server environment include a blockchain name, a blockchain server IP, a password of a root account, a blockchain server operating system version (centos7 / ubuntu20 / ubuntu22), and a blockchain description; the operation and maintenance management includes server performance monitoring and log management; the security management includes firewall configuration, malicious software protection, vulnerability repair, and data backup; the node management includes creation, start, stop, and deletion of peer nodes and orderer nodes, and the user can define the name and the organization to which the node belongs when creating the node; the blockchain configuration includes configuration of a block generation time, a maximum transaction volume of a block, a maximum byte number of a block, and a maximum byte number of a transaction; the blockchain browser creation refers to rapid deployment of a corresponding blockchain browser according to an existing blockchain; in the uploading of the smart contract, the user uploads source code of the smart contract in the BaaS platform and specifies a version number, a language, and a channel; in the deployment of the smart contract, the user submits a request for deployment of the smart contract, and the smart contract is deployed on a specified blockchain in a short time, reducing the complexity of operations of a developer; and in the upgrading of the smart contract, the user uploads a new version of the smart contract in the BaaS platform to replace an old contract.

[0050] The service layer is responsible for providing service support for functions contained in the application layer, is mainly composed of a BaaS platform backend and a blockchain service construction program, and is a core part of the system.

[0051] The BaaS platform backend uses a Beego framework, and the blockchain service construction program uses a Gin framework. The BaaS platform backend receives GET or POST requests from the front end, calls related functions to process the requests according to routing rules, and the related functions call the blockchain service construction program on the blockchain server to execute related requests through an HTTP request. The HTTP request is implemented using a gentleman library, and the IP of the blockchain server, the port number, and the specific path need to be passed in. The HTTP request body contains the data to be transmitted, the signature of the request data using the RSA private key of the server, and the signature algorithm. After receiving the request of the BaaS platform, the blockchain server construction program verifies the signature of the request using the public key of the BaaS platform, and continues to process the request after the signature verification is passed. The processing of the request directly executes the corresponding command line using an exec library. The advantage of using the command line is that more requests that cannot be handled by the sdk can be handled, and it is more flexible. The functions of defining a node name and an organization and configuring block parameters are implemented by filling in related fields of a defined template file using a template library.

[0052] The resource layer includes a public cloud, a private cloud and Docker, in the application, the environment of the blockchain server can be initialized offline, so that the system supports the public cloud and the private cloud deployment simultaneously, the BaaS platform and the blockchain system run in the Docker, and management and maintenance are facilitated.

[0053] As Figure 2 shown in the figure, the operation flow of the dynamic construction blockchain system of the application comprises the following steps:

[0054] S1: a user fills in the parameters of the blockchain server in a blockchain page created by a BaaS platform, the parameters include a blockchain name, a host IP, a password of a host root account, a host operating system (centos7 / ubuntu20 / ubuntu22), a blockchain description, and a click of a submission button to wait for the initialization of the environment of the blockchain server.

[0055] S2: after the BaaS background receives a command of the user to initialize the blockchain server, the BaaS background transmits a blockchain service construction program to the blockchain server and starts the program.

[0056] The blockchain service construction program is different for different operating systems of the blockchain server, and the blockchain service construction program is transmitted through an scp command.

[0057] S3: the blockchain construction service program creates a 2048-bit public-private key pair for subsequent signature and authentication communication with the BaaS platform.

[0058] The certificate format is pkcs8, the result of using the RSA private key pair processing is signed, and the result includes a result code of an execution request and prompt information.

[0059] S4: the BaaS platform initiates a command of obtaining an environment resource package to the blockchain construction service program, and the blockchain construction service program downloads the resource package from a specified resource address according to the version of the local operating system. The resource address can be an intranet address, that is, the downloading process of the environment resource package can be completed without using the public Internet.

[0060] S5: after the downloading of the environment resource package is completed, an environment initialization script is executed to install the blockchain environment to the blockchain server. The blockchain environment includes go, docker, docker-compose, Fabric related images and tools, etc.

[0061] S6: after the environment initialization is completed, the blockchain construction service program listens to a specified port, receives the request of the BaaS platform and executes a corresponding cmd command, so as to complete the dynamic construction of the blockchain.

[0062] The request includes generating a block chain network, installing and downloading a smart contract, running a block chain browser, etc.

[0063] It should be appreciated that embodiments of the present application can be realized by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory computer-readable storage medium. The method can be implemented in a computer program using standard programming techniques - including non-transitory computer-readable storage medium configured with a computer program, in which the storage medium so configured makes the computer operate in a specific and predefined manner according to the methods and drawings described in the specific embodiments. Each program can be implemented in a high-level procedural or object-oriented programming language to communicate with a computer system. However, if necessary, the program can be implemented in assembly or machine language. In any case, the language can be a compiled or interpreted language. In addition, the program can be run on a programmed special-purpose integrated circuit for this purpose.

[0064] In addition, the operations of the processes described herein can be performed in any suitable order unless otherwise indicated herein or otherwise clearly contradicted by context. The processes described herein (or variations and / or combinations thereof) can be performed under the control of one or more computer systems configured with executable instructions (e.g., computer programs, one or more computer programs, or one or more applications) to perform operations described herein, and can be implemented as code (e.g., executable instructions, one or more computer programs, or one or more applications) executing collectively on one or more processors, by hardware, or combinations thereof. The computer programs include a plurality of instructions executable by one or more processors.

[0065] Further, the method can be implemented in any suitable type of computing platform operably connected to, including but not limited to, a personal computer, a mini-computer, a mainframe, a workstation, a network or distributed computing environment, a separate or integrated computer platform, or in communication with a charged particle tool or other imaging device, and the like. Aspects of the present application can be implemented in machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated to the computing platform, such as a hard disk, an optical read and / or write storage medium, RAM, ROM, and the like, such that it can be read by a programmable computer and used to configure and operate the computer to perform the processes described herein when the storage medium or device is read by the computer. In addition, the machine-readable code, or portions thereof, can be transmitted over a wired or wireless network. The present application described herein includes these and other different types of non-transitory computer-readable storage media when such media include instructions or programs that implement the steps described above in conjunction with a microprocessor or other data processor. The present application also includes the computer itself when programmed according to the methods and techniques described herein for dynamically building a block chain.

[0066] A computer program can be applied to input data to perform the functions described herein, thereby transforming the input data to generate output data that is stored to non-volatile memory. The output information can also be applied to one or more output devices such as a display. In a preferred embodiment of the application, the transformed data represents a physical and tangible object, including a particular visual depiction of a physical and tangible object produced on a display.

[0067] Finally, it should be noted that the above-mentioned embodiments illustrate rather than limit the application, since the scope of the application is determined by the appended claims.

Claims

1. A method for dynamically constructing a blockchain, characterized in that: The method includes the following steps: S1: The user creates the server parameters for the blockchain on the BaaS platform. The server parameters include the blockchain name, host IP, password for the host root account, host operating system, and blockchain description. The user waits for the blockchain server environment to initialize. S2: After receiving the user's command to initialize the blockchain server, the BaaS backend transmits the blockchain service building program to the blockchain server and starts the blockchain service building program. Among them, the operating system for the blockchain server and the corresponding blockchain service building program are different, and the blockchain service building program is transmitted through the scp command; S3: The blockchain building service program creates a 2048-bit public-private key pair for subsequent communication, signing, and authentication with the BaaS platform. The certificate format is pkcs8, and the result of the processing is signed using an RSA private key. The result of the processing includes the result code of the execution request and the prompt information. S4: The BaaS platform sends a command to the blockchain construction service program to obtain the environment resource package. The blockchain construction service program downloads the resource package from the specified resource address according to the local operating system version. The resource address includes an intranet address, and the download process of the environment resource package can be completed without using the public Internet. S5: After the environment resource package is downloaded, execute the environment initialization script to install the blockchain environment onto the blockchain server; the blockchain environment includes images and tools for Go, Docker, Docker Compose, and Fabric. S6: Once the environment initialization is complete, the blockchain construction service program listens on the specified port, receives requests from the BaaS platform, and executes the corresponding cmd commands to complete the dynamic construction of the blockchain.

2. The method for dynamically constructing a blockchain according to claim 1, characterized in that: The host operating systems include CentOS 7, Ubuntu 20, and Ubuntu 22.

3. The method for dynamically constructing a blockchain according to claim 1, characterized in that: The requests from the BaaS platform include generating a blockchain network, installing and downloading smart contracts, and running a blockchain explorer.

4. A system for dynamically constructing a blockchain, characterized in that: The system comprises an application layer, a service layer, a blockchain layer, and a resource layer; The application layer includes a blockchain server management module, a blockchain management module, and a smart contract management module; The blockchain server management module initializes and builds the basic environment for the blockchain server, and developers input server parameters to complete the deployment of the blockchain environment. The server parameters include the blockchain name, host IP, password for the host root account, host operating system, and blockchain description. The service layer of the blockchain server management module includes initialization environment, operation and maintenance management, and security management. The service layer of the blockchain management module includes node management, blockchain configuration, and the creation of a blockchain explorer. The service layer of the smart contract management module includes uploading smart contracts, deploying smart contracts, and upgrading smart contracts; After receiving the request, the BaaS platform sends the deployment script to the blockchain server via the scp command, and then deploys the blockchain environment by executing the automated script. The blockchain environment includes images and tools for Go, Docker, Docker Compose, and Fabric. The blockchain layer is Hyperledger Fabric, a consortium blockchain framework widely used among enterprises, and its blockchain explorer. The node management includes peer node management and orderer node management; in peer node management, the name of the node and the organization to which it belongs are set, and in orderer node management, the cluster, number, and blockchain to which the node belongs are set. The blockchain configuration is configured for different blockchain channels, and the configuration parameters include block time, maximum transaction size per block, maximum number of bytes per block, and maximum number of bytes per transaction. The establishment of the blockchain explorer refers to building a blockchain explorer using the BaaS platform. The smart contract management module is used to upload and install smart contracts; When uploading a smart contract, users need to configure parameters, including the contract name, channel, language, version number, and contract file. After uploading the smart contract, deploy it on the node; The resource layer includes public cloud, private cloud, and Docker.

5. A system for dynamically constructing a blockchain according to claim 4, characterized in that: The host operating systems include CentOS 7, Ubuntu 20, and Ubuntu 22.

6. A system for dynamically constructing a blockchain according to claim 4, characterized in that: The deployment on the node includes packaging, installing, and instantiating the contract source code.

Citation Information

Patent Citations

  • A blockchain open cloud service platform

    CN109743328A

  • Automatic digital government affair service system based on block chain technology

    CN111814200A