CN113612809B - Fabric chain code external calling method under BaaS architecture based on PaaS platform - Google Patents
Fabric chain code external calling method under BaaS architecture based on PaaS platform Download PDFInfo
- Publication number
- CN113612809B CN113612809B CN202110524413.XA CN202110524413A CN113612809B CN 113612809 B CN113612809 B CN 113612809B CN 202110524413 A CN202110524413 A CN 202110524413A CN 113612809 B CN113612809 B CN 113612809B
- Authority
- CN
- China
- Prior art keywords
- chain code
- chain
- organization
- baas
- service
- 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.)
- Active
Links
- 239000004744 fabric Substances 0.000 title claims abstract description 30
- 238000000034 method Methods 0.000 title claims abstract description 29
- 230000008520 organization Effects 0.000 claims abstract description 23
- 238000012544 monitoring process Methods 0.000 claims description 9
- 238000012856 packing Methods 0.000 claims description 3
- 238000012986 modification Methods 0.000 claims description 2
- 230000004048 modification Effects 0.000 claims description 2
- 238000005516 engineering process Methods 0.000 abstract description 6
- 238000007796 conventional method Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45562—Creating, deleting, cloning virtual machine instances
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45575—Starting, stopping, suspending or resuming virtual machine instances
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45595—Network integration; Enabling network access in virtual machine instances
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/50—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees
Abstract
The invention belongs to the technical field of blockchain technology, paaS platform and service technology, and particularly relates to a fabric chain code external calling method under a BaaS architecture based on the PaaS platform, which comprises the following steps: building a chain: creating a 2-organization block chain network of 2 nodes and 3 orders in each organization, and adding the 2 nodes and the 3 orders into the same channel; setting an anchor node: setting a peer0 as an anchor node of the organization in the organization I and the organization II respectively, and installing a chain code on the anchor node only; builder and generator: installing a constructor and a generator on anchor nodes of each organization respectively, wherein the constructor is used for finding out a chain code file, and the generator is used for detecting the chain code file; deploying a chain code: and deploying a chain code management service on the appointed container and uploading a corresponding chain code file. The invention saves resources, and because the chain service is allied in the PaaS environment, the chain code service can be completed by starting only one chain code service, and compared with the prior art that each endorsement node must be installed and started with one chain code service, the resource is saved greatly.
Description
Technical Field
The invention relates to the field of block chain technology, paaS platform and service technology, in particular to a fabric chain code external calling method under a BaaS architecture based on the PaaS platform.
Background
The traditional method is that the bottom chain fabric automatically starts the container technologies such as a dock to run the intelligent contracts (chain codes) of the fabric, and the invention is a machine for flexibly appointing and deploying the intelligent contracts of the fabric by using the PaaS technology.
The existing method has the following problems: 1. the machine position of intelligent contract operation of the blockchain cannot be freely determined, and the intelligent contract operation can only be freely mobilized by a system, so that a great obstacle is generated for intelligent contract operation of fabric on the PaaS environment; 2. meanwhile, the resources of the machine cannot be distributed efficiently, so that deployment and calling are very inflexible, and high-frequency requests cannot be met.
Therefore, we propose a fabric chain code external calling method under BaaS architecture based on PaaS platform to solve the above problems.
Disclosure of Invention
The invention aims to solve the defects in the prior art, and provides a fabric chain code external calling method under a BaaS architecture based on a PaaS platform.
In order to achieve the above purpose, the present invention adopts the following technical scheme:
a fabric chain code external calling method under a BaaS architecture based on a PaaS platform comprises the following steps:
s1, building a chain: creating a 2-organization block chain network of 2 nodes and 3 orders in each organization, and adding the 2 nodes and the 3 orders into the same channel;
s2, setting an anchor node: setting a peer0 as an anchor node of the organization in the organization I and the organization II respectively, and installing a chain code on the anchor node only;
s3, a constructor and a generator: installing a constructor and a generator on anchor nodes of each organization respectively, wherein the constructor is used for finding out a chain code file, and the generator is used for detecting the chain code file;
s4, deploying a chain code: deploying a chain code management service on the appointed container and uploading a corresponding chain code file;
s5, starting a chain code: starting a corresponding chain code file by using a chain code management service, wherein a corresponding monitoring port can be designated in the chain code file;
s6, calling a chain code: thus, all nodes can choose whether to deploy the chain code contracts individually, and can specify the contracts to deploy the container, invoking the contracts that specify the container.
In the fabric chain code external calling method under the BaaS architecture based on the PaaS platform, the channels in the step S1 are private sub-networks, and in fact, in order to isolate different applications, one channel may contain a batch of channel codes.
In the fabric chain code external calling method based on the BaaS architecture of the PaaS platform, the peer in the step S2 is a node for storing the blockchain data, and has endorse and commit functions.
In the fabric chain code external calling method under the BaaS architecture based on the PaaS platform, the step of installing the chain code in the step S2 is as follows: first, installing on the PEER of Org1, specifying that the PEER operates on Org1 by setting an environment variable, the CORE_PEER_ADDRESS sets the PEER to PEER0.Org1.Example. Com; then the peg of Org2 is installed again.
In the fabric chain code external calling method under the BaaS architecture based on the PaaS platform, the step S3 may be followed by modifying the chain code file, which specifically includes the following operations: and generating a monitoring service, and monitoring the appointed port.
In the fabric chain code external calling method under the BaaS architecture based on the PaaS platform, in the step S4, a PeerCLI may be used to deploy a chain code into a channel, and specific operation steps are as follows:
firstly, packing a chain code;
step two, installing a packed chain code;
thirdly, each organization agrees with the content and definition of the chain codes;
and fourthly, submitting the chain codes to the channels.
In the fabric chain code external calling method under the BaaS architecture based on the PaaS platform, the starting chain code in the step S5 is in PaaS environment alliance chain service, and can be completed only by starting one chain code service.
In the fabric chain code external calling method under the BaaS architecture based on the PaaS platform, in the step S6, the container may be designated to deploy the chain code, so as to realize container controllability, and all the chain code containers may be uniformly managed by the chaincode_manager service.
Compared with the prior art, the fabric chain code external calling method based on the PaaS platform under the BaaS architecture has the advantages that:
1. the traditional method is that the container is randomly generated by fabric, and cannot be specified on PaaS, but the invention can specify the container, can specify the container to deploy the chain code, and realizes the container controllability.
2. While the conventional method is that fabric is randomly generated and cannot be effectively and uniformly managed in the PaaS environment, all the chain code containers in the invention can be uniformly managed by the chaincode_manager service.
3. The invention saves resources, and because the chain service is allied in the PaaS environment, the chain code service can be completed by starting only one chain code service, and compared with the prior art that each endorsement node must be installed and started with one chain code service, the resource is saved greatly.
4. The invention is convenient for upgrading, and only one container needs to be started for upgrading.
Drawings
Fig. 1 is a flow chart of a fabric chain code external calling method under BaaS architecture based on PaaS platform.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments.
Examples
Referring to fig. 1, a method for calling fabric chain code outside under BaaS architecture based on PaaS platform includes the following steps:
s1, building a chain: creating a 2-organization block chain network of 2 nodes and 3 orders in each organization, and adding the 2 nodes and the 3 orders into the same channel;
s2, setting an anchor node: setting a peer0 as an anchor node of the organization in the organization I and the organization II respectively, and installing a chain code on the anchor node only;
s3, a constructor and a generator: installing a constructor and a generator on anchor nodes of each organization respectively, wherein the constructor is used for finding out a chain code file, and the generator is used for detecting the chain code file;
s4, deploying a chain code: deploying a chain code management service on the appointed container and uploading a corresponding chain code file;
s5, starting a chain code: starting a corresponding chain code file by using a chain code management service, wherein a corresponding monitoring port can be designated in the chain code file;
s6, calling a chain code: thus, all nodes can choose whether to deploy the chain code contracts individually, and can specify the contracts to deploy the container, invoking the contracts that specify the container.
Wherein the channel in step S1 is a private sub-network, and in fact, to isolate different applications, a channel may contain a batch of channels, and the peer in step S2 is a node for storing blockchain data, and also has an endorse and commit function.
Further, the step of installing the chain code in the step S2 is as follows: first, installing on the PEER of Org1, specifying that the PEER operates on Org1 by setting an environment variable, the CORE_PEER_ADDRESS sets the PEER to PEER0.Org1.Example. Com;
1、export CORE_PEER_TLS_ENABLED=true
2、export CORE_PEER_LOCALMSPID="Org1MSP"
3、export
CORE_PEER_TLS_ROOTCERT_FILE=${PWD}/organizations/peerOr ganizations/org1.example.com/peers/peer0.org1.example.com/t ls/ca.crt
4、export
CORE_PEER_MSPCONFIGPATH=${PWD}/organizations/peerOrgani zations/org1.example.com/users/Admin@org1.example.com/msp
5、export CORE_PEER_ADDRESS=localhost:7051
running the following code installs the chain code on the peer
peer lifecycle chaincode install fabcar.tar.gz
Then the peg of Org2 is installed, in particular,
1、export CORE_PEER_LOCALMSPID="Org2MSP"
2、export
CORE_PEER_TLS_ROOTCERT_FILE=${PWD}/organizations/peerOr ganizations/org2.example.com/peers/peer0.org2.example.com/t ls/ca.crt
3、export
CORE_PEER_TLS_ROOTCERT_FILE=${PWD}/organizations/peerOr ganizations/org2.example.com/peers/peer0.org2.example.com/t ls/ca.crt
4、export
CORE_PEER_MSPCONFIGPATH=${PWD}/organizations/peerOrgani zations/org2.example.com/users/Admin@org2.example.com/msp
5、export CORE_PEER_ADDRESS=localhost:9051
6、peer lifecycle chaincode install fabcar.tar.gz
after step S3, the chain code file may be modified, which specifically includes: generating a monitoring service, and monitoring a designated port; the specific programming method comprises the following steps:
in step S4, the PeerCLI may be used to deploy a chain code into the channel, which specifically includes the following steps:
firstly, packing a chain code;
step two, installing a packed chain code;
thirdly, each organization agrees with the content and definition of the chain codes;
and fourthly, submitting the chain codes to the channels.
The starting chain code in step S5 is in PaaS environment alliance chain service, and only one chain code service needs to be started to finish.
Further, in step S6, the container may be designated to deploy a chain code, so as to implement container controllability, and all the chain code containers may be uniformly managed by the char_manager service.
The foregoing is only a preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art, who is within the scope of the present invention, should make equivalent substitutions or modifications according to the technical scheme of the present invention and the inventive concept thereof, and should be covered by the scope of the present invention.
Claims (8)
1. A fabric chain code external calling method under a BaaS architecture based on a PaaS platform is characterized by comprising the following steps:
s1, building a chain: creating a 2-organization block chain network of 2 nodes and 3 orders in each organization, and adding the 2 nodes and the 3 orders into the same channel;
s2, setting an anchor node: setting a peer0 as an anchor node of the organization in the organization I and the organization II respectively, and installing a chain code on the anchor node only;
s3, a constructor and a generator: installing a constructor and a generator on anchor nodes of each organization respectively, wherein the constructor is used for finding out a chain code file, and the generator is used for detecting the chain code file;
s4, deploying a chain code: deploying a chain code management service on the appointed container and uploading a corresponding chain code file;
s5, starting a chain code: starting a corresponding chain code file by using a chain code management service, wherein a corresponding monitoring port can be designated in the chain code file;
s6, calling a chain code: thus, all nodes can choose whether to deploy the chain code contracts individually, and can specify the contracts to deploy the container, invoking the contracts that specify the container.
2. The method according to claim 1, wherein the channel in the step S1 is a private sub-network, and in fact, to isolate different applications, a channel may contain a batch of channel codes.
3. The method for external calling of fabric chain code under BaaS architecture based on PaaS platform as claimed in claim 2, wherein the peer in step S2 is a node for storing blockchain data, and has endorse and commit functions.
4. The method for external calling of fabric chain codes under BaaS architecture based on PaaS platform as claimed in claim 3, wherein the step of installing the chain codes in the step S2 is as follows: first, installing on the PEER of Org1, specifying that the PEER operates on Org1 by setting an environment variable, the CORE_PEER_ADDRESS sets the PEER to PEER0.Org1.Example. Com; then the peg of Org2 is installed again.
5. The method for external calling of fabric chain codes under BaaS architecture based on PaaS platform according to claim 1, wherein the step S3 is characterized in that the modification of the chain code file can be performed by the following specific operations: and generating a monitoring service, and monitoring the appointed port.
6. The method for external calling of fabric chain codes under BaaS architecture based on PaaS platform as claimed in claim 1, wherein the step S4 can use PeerCLI to deploy the chain codes into the channel, and the specific operation steps are as follows:
firstly, packing a chain code;
step two, installing a packed chain code;
thirdly, each organization agrees with the content and definition of the chain codes;
and fourthly, submitting the chain codes to the channels.
7. The method for external calling of fabric chain codes under BaaS architecture based on PaaS platform as claimed in claim 1, wherein the starting chain code in step S5 is in PaaS environment alliance chain service, and only one chain code service needs to be started.
8. The method for external calling of fabric chain codes under BaaS architecture based on PaaS platform according to claim 1, wherein in step S6, a container can be designated to deploy the chain codes, so as to realize container controllability, and all the chain code containers can be uniformly managed by a chaincode_manager service.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110524413.XA CN113612809B (en) | 2021-05-13 | 2021-05-13 | Fabric chain code external calling method under BaaS architecture based on PaaS platform |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110524413.XA CN113612809B (en) | 2021-05-13 | 2021-05-13 | Fabric chain code external calling method under BaaS architecture based on PaaS platform |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113612809A CN113612809A (en) | 2021-11-05 |
CN113612809B true CN113612809B (en) | 2023-11-14 |
Family
ID=78336438
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110524413.XA Active CN113612809B (en) | 2021-05-13 | 2021-05-13 | Fabric chain code external calling method under BaaS architecture based on PaaS platform |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113612809B (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108965468A (en) * | 2018-08-16 | 2018-12-07 | 北京京东尚科信息技术有限公司 | Block chain network service platform and its chain code installation method, storage medium |
CN110008263A (en) * | 2019-02-20 | 2019-07-12 | 顺丰科技有限公司 | Dynamic organization's extended method and system under Hyperledger fabric cluster mode |
CN110175032A (en) * | 2019-01-17 | 2019-08-27 | 杭州趣链科技有限公司 | A kind of High Availabitity block chain open platform and apply dissemination method |
CN110401656A (en) * | 2019-07-24 | 2019-11-01 | 西安纸贵互联网科技有限公司 | Block chain management system |
WO2020001117A1 (en) * | 2018-06-30 | 2020-01-02 | 华为技术有限公司 | Blockchain maintaining method and apparatus, server, and computer-readable storage medium |
CN112564917A (en) * | 2020-12-01 | 2021-03-26 | 浙商银行股份有限公司 | Cloud service platform based on block chain and deployment method thereof |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9454359B2 (en) * | 2013-01-28 | 2016-09-27 | Red Hat, Inc. | Deployment optimization for high availability in a multi-tenant platform-as-a-service (PaaS) system |
US10528551B2 (en) * | 2017-09-29 | 2020-01-07 | Oracle International Corporation | System and method for providing a representational state transfer proxy service for a blockchain cloud service |
US11769156B2 (en) * | 2018-05-15 | 2023-09-26 | International Business Machines Corporation | Automated data projection for smart contract groups on a blockchain |
-
2021
- 2021-05-13 CN CN202110524413.XA patent/CN113612809B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020001117A1 (en) * | 2018-06-30 | 2020-01-02 | 华为技术有限公司 | Blockchain maintaining method and apparatus, server, and computer-readable storage medium |
CN108965468A (en) * | 2018-08-16 | 2018-12-07 | 北京京东尚科信息技术有限公司 | Block chain network service platform and its chain code installation method, storage medium |
CN110175032A (en) * | 2019-01-17 | 2019-08-27 | 杭州趣链科技有限公司 | A kind of High Availabitity block chain open platform and apply dissemination method |
CN110008263A (en) * | 2019-02-20 | 2019-07-12 | 顺丰科技有限公司 | Dynamic organization's extended method and system under Hyperledger fabric cluster mode |
CN110401656A (en) * | 2019-07-24 | 2019-11-01 | 西安纸贵互联网科技有限公司 | Block chain management system |
CN112564917A (en) * | 2020-12-01 | 2021-03-26 | 浙商银行股份有限公司 | Cloud service platform based on block chain and deployment method thereof |
Also Published As
Publication number | Publication date |
---|---|
CN113612809A (en) | 2021-11-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108536519B (en) | Method for automatically building Kubernetes main node and terminal equipment | |
US11231912B2 (en) | Post-deployment modification of information-technology application using lifecycle blueprint | |
CN110752947B (en) | K8s cluster deployment method and device, and deployment platform | |
WO2018141183A1 (en) | Orchestration and management system and network slice processing method | |
CN111147297B (en) | Multi-layer network plane construction method of kubernets | |
US20130007739A1 (en) | Virtual machine disk image installation | |
CN105224466A (en) | A kind of integration test method based on Docker and system | |
US8230416B2 (en) | System, method and article of manufacture for using shadow installations of software modules during distributed system upgrade | |
US10324701B1 (en) | Rapid deployment of computing instances | |
US11171824B2 (en) | Configuration of computing devices via containers | |
US10282200B2 (en) | Out-of-deployment-scope modification of information-technology application using lifecycle blueprint | |
CN110389766B (en) | HBase container cluster deployment method, system, equipment and computer readable storage medium | |
US20110258620A1 (en) | Method and Apparatus for Making a BPM Application Available to Multiple Tenants | |
CN111654399B (en) | Networking method, device, equipment and storage medium based on SD-WAN | |
CN114116909A (en) | Distributed cloud native database management method and system | |
CN106708573B (en) | System and method for Hadoop cluster automatic installation | |
US20210320950A1 (en) | System and method for secure multitenant operations of a distributed computing cluster | |
CN111770130B (en) | Method for efficient collaborative multiplexing of software and hardware resources in block chain distributed networking | |
CN102197387B (en) | Bootstrap rendezvous federation | |
CN110764918A (en) | Method for managing main nodes in container cluster | |
CN113612809B (en) | Fabric chain code external calling method under BaaS architecture based on PaaS platform | |
CN108073426B (en) | Software management method, device and system based on cloud computing | |
CN110008006B (en) | Container-based big data tool deployment method and system | |
CN114710350B (en) | Method and device for distributing callable resources, electronic equipment and storage medium | |
US11489727B2 (en) | Automatically replicating configuration parameters from securely identified connected systems |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |