Chain code deployment method, system, device and storage medium

By dispersed chain code deployment among organizations of multiple devices in the blockchain system, the problem of concentrated chain code deployment permissions is solved, and a more flexible and secure chain code deployment method is achieved.

CN112631623BActive Publication Date: 2025-01-17HANGZHOU QULIAN TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011601616.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-29
Publication Date
2025-01-17
Estimated Expiration
2040-12-29

AI Technical Summary

Technical Problem

In the existing chain code deployment methods, users need to log in to the BaaS platform, resulting in too concentrated chain code deployment permissions and lack of decentralization and flexibility.

Method used

Through multiple devices, chain code installation requests are sent to the blockchain system, and chain code is installed on the computing nodes of their respective associated organizations to realize the recognition and decentralized deployment of the chain code. The blockchain system decides whether to instance based on the chain code deployment strategy chain code, separate installation, approval and instantiation operations.

Benefits of technology

It realizes peer-to-peer decentralization of chain code deployment permissions, improves the flexibility and security of the system, and avoids the risks brought by centralized permissions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112631623B_ABST
    Figure CN112631623B_ABST
Patent Text Reader

Abstract

Disclosed is a chain code deployment method, system, device, equipment and storage medium, belonging to the field of blockchain technology. It includes: each of multiple devices with user identifications associated with multiple organizations in the blockchain system sends a chain code installation request carrying a chain code package to the blockchain system; each time the blockchain system receives a chain code installation request sent by a device, it installs the chain code on the computing node of the corresponding organization according to the chain code package carried in the received chain code installation request; the target device sends a chain code instantiation request to the blockchain system; the blockchain system instantiates the chain code when it determines that the chain code meets the chain code deployment policy according to the organization to which the computing node that has successfully installed the chain code belongs. When deploying the chain code, each of the multiple organizations realizes the recognition of the chain code when installing the chain code, thereby dispersing the chain code deployment authority to multiple related organizations, and realizing the equality of organizational authority when deploying the chain code.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of blockchain technology, and in particular to a chain code deployment method, system, device and storage medium. Background Art

[0002] Chaincode is abbreviated as chaincode, which generally refers to the application code written by the user. Chaincode can be deployed on the nodes in the blockchain system, and the data in the distributed ledger of the blockchain system can be operated by calling the chaincode.

[0003] Currently, chaincode deployment can be performed through the BaaS (Backend as a Service) platform. Specifically, if a user wants to deploy a chaincode in a channel in the blockchain system, the user can upload the chaincode to be deployed to the BaaS platform after logging into the BaaS platform, and the BaaS platform will directly deploy the chaincode on the computing nodes of multiple organizations that have joined this channel.

[0004] However, in the above chaincode deployment method, users can deploy chaincodes on nodes in the blockchain system as long as they log in to the BaaS platform, and the chaincode deployment authority is too concentrated. Summary of the invention

[0005] The embodiments of the present application provide a chain code deployment method, system, device, equipment and storage medium, which can achieve the parity of organizational permissions when chain code is deployed. The technical solution is as follows:

[0006] In a first aspect, a chain code deployment method is provided, the method comprising:

[0007] Each of the multiple devices sends a chain code installation request carrying a chain code package to the blockchain system, each of the devices corresponds to an organization in the blockchain system, each of the devices is logged in with a user ID, and the organization corresponding to each device is the organization associated with the logged in user ID in the blockchain system;

[0008] Each time the blockchain system receives a chain code installation request sent by a device, the chain code is installed on the computing node of the corresponding organization according to the chain code package carried in the received chain code installation request;

[0009] A target device among the multiple devices sends a chain code instantiation request to the blockchain system, where the chain code instantiation request is used to request instantiation of the chain code;

[0010] After the blockchain system receives the chain code instantiation request, if it is determined that the chain code satisfies the chain code deployment policy based on the organization to which the computing node that has successfully installed the chain code belongs, the chain code is instantiated, and the chain code deployment policy is used to indicate the organization that needs to approve the chain code when the chain code is deployed.

[0011] In the present application, multiple devices logged with user identifiers associated with each of the multiple organizations send chain code installation requests to the blockchain system. Each time the blockchain system receives a chain code installation request sent by a device, it installs the chain code on the computing node of the corresponding organization according to the chain code package carried in the received chain code installation request. In this way, when deploying the chain code, each of the multiple organizations recognizes the chain code when installing the chain code, thereby distributing the chain code deployment authority to the multiple related organizations, and realizing the equality of organizational authority when deploying the chain code. Afterwards, after the blockchain system receives the chain code instantiation request, if it is determined that the chain code meets the chain code deployment policy based on the organization to which the computing node that has successfully installed the chain code belongs, the chain code is instantiated to complete the deployment of the chain code. In this way, the operations of chain code installation, approval, and instantiation are separated, which improves the flexibility of the system.

[0012] Optionally, the blockchain system installs the chain code on a computing node of a corresponding organization according to the chain code package carried in the received chain code installation request, including:

[0013] The computing node installs the chain code according to the chain code package, and sends a confirmation message carrying the chain code package identifier to the sorting node in the blockchain system after successfully installing the chain code;

[0014] If the blockchain system determines that the chain code satisfies the chain code deployment policy according to the organization to which the computing node that has successfully installed the chain code belongs, it includes:

[0015] The sorting node determines the organization that has approved the chain code based on all received confirmation messages carrying the chain code package identifier, and instantiates the chain code if the organization that has approved the chain code is consistent with the organization indicated by the chain code deployment policy.

[0016] Optionally, the chaincode instantiation request is used to request instantiation of the chaincode on a target channel, and the chaincode deployment strategy is used to indicate any one of the following:

[0017] Deploying the chaincode on the target channel requires approval from all organizations that join the target channel;

[0018] Deploying a chaincode on the target channel requires approval from any organization that joins the target channel;

[0019] Deploying the chaincode on the target channel requires approval from more than half of all organizations joining the target channel.

[0020] Optionally, before each of the multiple devices sends a chain code installation request carrying a chain code package to the blockchain system, the process further includes:

[0021] The target device obtains chain code information;

[0022] The target device sends a chain code packaging request carrying the chain code information to the blockchain system, where the chain code packaging request is used to request the target organization corresponding to the target device to package the chain code;

[0023] After receiving the chain code packaging request, the blockchain system generates the chain code package on the computing node of the target organization according to the chain code information;

[0024] The blockchain system sends the chain code package to the target device.

[0025] Optionally, after the blockchain system sends the chain code package to the target device, it further includes:

[0026] After receiving the chain code package, the target device sends the chain code package to other devices according to the organization indicated by the chain code deployment policy.

[0027] Optionally, the target user identifier logged in by the target device is associated with multiple organizations in the blockchain system, and before the target device sends a chain code packaging request carrying the chain code information to the blockchain system, the further step includes:

[0028] The target device displays a plurality of organization identifiers, wherein the plurality of organization identifiers include an identifier of each organization in the plurality of organizations associated with the target user identifier;

[0029] When the target device detects a selection operation on one of the multiple organization identifiers, the target device uses the selected organization identifier as the target organization identifier, generates a chain code packaging request carrying the target organization identifier and the chain code information, and the chain code packaging request is used to request the target organization identified by the target organization identifier to package the chain code.

[0030] In a second aspect, a chain code deployment method is provided, which is applied to a blockchain system, and the method includes:

[0031] Receiving a chain code installation request carrying a chain code package sent by each of a plurality of devices, wherein each device corresponds to an organization in the blockchain system, each device is logged in with a user identifier, and the organization corresponding to each device is an organization associated with the logged in user identifier in the blockchain system;

[0032] Each time a chain code installation request is received from a device, the chain code is installed on the computing node of the corresponding organization according to the chain code package carried in the received chain code installation request;

[0033] Receive a chain code instantiation request, where the chain code instantiation request is used to request instantiation of the chain code;

[0034] If it is determined that the chain code satisfies the chain code deployment policy according to the organization to which the computing node that has successfully installed the chain code belongs, the chain code is instantiated, and the chain code deployment policy is used to indicate the organization that needs to approve the chain code when the chain code is deployed.

[0035] Optionally, before receiving the chain code installation request carrying the chain code package sent by each device among the multiple devices, the method further includes:

[0036] Receive a chain code packaging request carrying chain code information, where the chain code packaging request is used to request the target organization to package the chain code;

[0037] Generate the chain code package at the computing node of the target organization according to the chain code information;

[0038] The chain code package is sent to a target device corresponding to the target organization.

[0039] Optionally, the chaincode instantiation request is used to request instantiation of the chaincode on a target channel, and the chaincode deployment strategy is used to indicate any one of the following:

[0040] Deploying the chaincode on the target channel requires approval from all organizations that join the target channel;

[0041] Deploying a chaincode on the target channel requires approval from any organization that joins the target channel;

[0042] Deploying the chaincode on the target channel requires approval from more than half of all organizations joining the target channel.

[0043] In a third aspect, a chain code deployment system is provided, the system comprising: a plurality of devices and a blockchain system;

[0044] Each of the multiple devices is used to send a chain code installation request carrying a chain code package to the blockchain system, each of the devices corresponds to an organization in the blockchain system, each of the devices is logged in with a user identifier, and the organization corresponding to each device is the organization associated with the logged in user identifier in the blockchain system;

[0045] The blockchain system is configured to install the chain code on the computing node of the corresponding organization according to the chain code package carried in the received chain code installation request each time a chain code installation request is received from a device;

[0046] A target device among the multiple devices is used to send a chain code instantiation request to the blockchain system, wherein the chain code instantiation request is used to request instantiation of the chain code;

[0047] The blockchain system is used to, after receiving the chain code instantiation request, instantiate the chain code if it is determined that the chain code satisfies the chain code deployment policy based on the organization to which the computing node that has successfully installed the chain code belongs, and the chain code deployment policy is used to indicate the organization that needs to approve the chain code when the chain code is deployed.

[0048] Optionally, the computing node is used to install the chain code according to the chain code package, and after successfully installing the chain code, send a confirmation message carrying the chain code package identifier to the sorting node in the blockchain system;

[0049] The sorting node is used to determine the organization that has approved the chain code according to all received confirmation messages carrying the chain code package identifier, and if the organization that has approved the chain code is consistent with the organization indicated by the chain code deployment policy, instantiate the chain code.

[0050] Optionally, the chaincode instantiation request is used to request instantiation of the chaincode on a target channel, and the chaincode deployment strategy is used to indicate any one of the following:

[0051] Deploying the chaincode on the target channel requires approval from all organizations that join the target channel;

[0052] Deploying a chaincode on the target channel requires approval from any organization that joins the target channel;

[0053] Deploying the chaincode on the target channel requires approval from more than half of all organizations joining the target channel.

[0054] Optionally, the target device is further used to obtain chain code information; send a chain code packaging request carrying the chain code information to the blockchain system, and the chain code packaging request is used to request the target organization corresponding to the target device to package the chain code;

[0055] The blockchain system is also used to generate the chain code package at the computing node of the target organization according to the chain code information after receiving the chain code packaging request; and send the chain code package to the target device.

[0056] Optionally, the target device is further configured to, after receiving the chain code package, send the chain code package to other devices according to the organization indicated by the chain code deployment policy.

[0057] Optionally, the target user identifier logged in by the target device is associated with multiple organizations in the blockchain system;

[0058] The target device is also used to display multiple organization identifiers, including the identifier of each organization in the multiple organizations associated with the target user identifier; when a selection operation for one of the multiple organization identifiers is detected, the selected organization identifier is used as the target organization identifier, and a chain code packaging request carrying the target organization identifier and the chain code information is generated, and the chain code packaging request is used to request the target organization identified by the target organization identifier to package the chain code.

[0059] In a fourth aspect, a chain code deployment device is provided, which is applied to a blockchain system, and the device includes:

[0060] A receiving module, configured to receive a chain code installation request carrying a chain code package sent by each of a plurality of devices, wherein each of the devices corresponds to an organization in the blockchain system, each of the devices is logged in with a user identifier, and the organization corresponding to each of the devices is an organization associated with the logged in user identifier in the blockchain system;

[0061] An installation module is used to install the chain code on the computing node of the corresponding organization according to the chain code package carried in the received chain code installation request every time a chain code installation request is received from a device;

[0062] The receiving module is further used to receive a chain code instantiation request, where the chain code instantiation request is used to request instantiation of the chain code;

[0063] An instantiation module is used to instantiate the chain code when it is determined that the chain code meets the chain code deployment policy according to the organization to which the computing node that has successfully installed the chain code belongs, and the chain code deployment policy is used to indicate the organization that needs to approve the chain code when the chain code is deployed.

[0064] Optionally, the device further includes a generating module and a sending module;

[0065] The receiving module is further used to receive a chain code packaging request carrying chain code information, wherein the chain code packaging request is used to request the target organization to package the chain code;

[0066] The generation module is used to generate the chain code package in the computing node of the target organization according to the chain code information;

[0067] The sending module is used to send the chain code package to a target device corresponding to the target organization.

[0068] Optionally, the chaincode instantiation request is used to request instantiation of the chaincode on a target channel, and the chaincode deployment strategy is used to indicate any one of the following:

[0069] Deploying the chaincode on the target channel requires approval from all organizations that join the target channel;

[0070] Deploying a chaincode on the target channel requires approval from any organization that joins the target channel;

[0071] Deploying the chaincode on the target channel requires approval from more than half of all organizations joining the target channel.

[0072] In a fifth aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the chain code deployment method described in the second aspect.

[0073] In a sixth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the chain code deployment method described in the second aspect is implemented.

[0074] In a seventh aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute the steps of the chain code deployment method described in the second aspect above.

[0075] It can be understood that the beneficial effects of the second, third, fourth, fifth, sixth and seventh aspects mentioned above can be found in the relevant description of the first aspect mentioned above and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0076] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0077] Figure 1 It is a schematic diagram of a blockchain system provided by an embodiment of the present application;

[0078] Figure 2 It is a schematic diagram of a blockchain provided by an embodiment of the present application;

[0079] Figure 3 It is a schematic diagram of a chain code deployment system provided by an embodiment of the present application;

[0080] Figure 4 is a schematic diagram of another chain code deployment system provided in an embodiment of the present application;

[0081] Figure 5It is a schematic diagram of another blockchain system provided in an embodiment of the present application;

[0082] Figure 6 It is a flowchart of a chain code deployment method provided by an embodiment of the present application;

[0083] Figure 7 is a flowchart of another chain code deployment method provided by an embodiment of the present application;

[0084] Figure 8 It is a structural diagram of a chain code deployment device provided in an embodiment of the present application;

[0085] Fig. 9 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0086] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0087] It should be understood that the "plurality" mentioned in this application refers to two or more. In addition, in order to facilitate the clear description of the technical solution of this application, the words "first" and "second" are used to distinguish the same or similar items with basically the same functions and effects. Those skilled in the art can understand that the words "first" and "second" do not limit the quantity and execution order, and the words "first" and "second" do not necessarily limit them to be different.

[0088] Before explaining the embodiments of the present application, the relevant contents of the blockchain are explained first.

[0089] Figure 1 It is a structural diagram of a blockchain system provided in an embodiment of the present application.

[0090] See also Figure 1, the blockchain system 100 refers to a system for sharing data between nodes. The blockchain system 100 may include multiple nodes 101, and the multiple nodes 101 may refer to various clients in the blockchain system 100. Each node 101 can receive input information during normal operation, and maintain the shared data in the blockchain system 100 based on the received input information. In order to ensure the information intercommunication within the blockchain system 100, there may be an information connection between each node 101 in the blockchain system 100, and information can be transmitted between the nodes 101 through the information connection. For example, when any node 101 in the blockchain system 100 receives input information, other nodes 101 in the blockchain system 100 obtain the input information according to the consensus algorithm, and store the input information as data in the shared data, so that the data stored on all nodes 101 in the blockchain system 100 are consistent.

[0091] Each node 101 in the blockchain system 100 stores an identical blockchain. Figure 2 The blockchain consists of multiple blocks. The genesis block includes a block header and a block body. The block header stores the input information characteristic value, version number, timestamp and difficulty value, and the block body stores the input information; the next block of the genesis block takes the genesis block as the parent block, and the next block also includes a block header and a block body. The block header stores the input information characteristic value of the current block, the block header characteristic value, version number, timestamp and difficulty value of the parent block, and so on, so that the block data stored in each block in the blockchain is associated with the block data stored in the parent block, ensuring the security of the input information in the block.

[0092] The blockchain system 100 has computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. The blockchain system 100 is a distributed shared account book and database, which has the characteristics of decentralization, non-tamperability, full traceability, traceability, collective maintenance, openness and transparency. These characteristics ensure the sharing, openness, authenticity, integrity, security and reliability of the blockchain.

[0093] The system architecture involved in the embodiments of the present application is described below.

[0094] Figure 3 is a schematic diagram of a chain code deployment system provided by an embodiment of the present application. Figure 3 , the chain code deployment system includes: multiple devices 301 and a blockchain system 302.

[0095] The multiple devices 301 include a target device 301, and the blockchain system 302 can be the above Figure 1-Figure 2 The blockchain system 100 described in the embodiment.

[0096] For any one of the multiple devices 301, the device 301 may be a general-purpose computer device or a dedicated computer device. In a specific implementation, the device 301 may be a desktop computer, a portable computer, a network server, a palm computer, a mobile phone, a tablet computer, a wireless terminal device, a communication device or an embedded device, and the embodiment of the present application does not limit the type of the device 301.

[0097] In one possible manner, the device 301 is a device that can directly communicate with the blockchain system 302, such as the device 301 can be a network server, etc. In this manner, the device 301 can communicate with the blockchain system 302 via a wired network or a wireless network.

[0098] In another possible manner, the device 301 is a device that cannot communicate directly with the blockchain system 302, such as the device 301 can be a terminal device, etc. In this manner, see Figure 4 , the chain code deployment system may further include a business platform 303. The business platform 303 is a platform that can access the blockchain system 302, for example, the business platform 303 may be a BaaS platform, etc. The business platform 303 may communicate with the device 301 through a wired network or a wireless network, and the business platform 303 may also communicate with the blockchain system 302 through a wired network or a wireless network. In this way, the device 301 may communicate with the blockchain system 302 through the business platform 303.

[0099] The relevant structure of the blockchain system 302 is described below.

[0100] See also Figure 5 , the blockchain system 302 may include one or more organizations 500 and one or more channels 502, Figure 5 In the example, a blockchain system 302 includes three organizations 500 and a channel 502. Each organization 500 includes one or more computing nodes (i.e., peer nodes) 501. One or more computing nodes 501 in each organization can join a channel 502. Each channel 502 also has an ordering node (i.e., Orderer node) 503. The channels 502 in the blockchain system 302 implement private isolation between the organizations 500 in the blockchain system 302. The chain codes and transactions in each channel 502 are visible only to the nodes (including computing nodes 501 and ordering nodes 503) that have joined the channel 502. The same node can join one or more channels 502 and maintain a ledger for each channel 502.

[0101] Multiple devices 301 and blockchain system 302 can perform the following Figure 6The chain code deployment method described in the embodiment is used to implement the deployment of the chain code.

[0102] The chain code deployment method provided in the embodiment of the present application is explained in detail below.

[0103] Figure 6 This is a flowchart of a chain code deployment method provided by an embodiment of the present application. Figure 6 , the method comprises the following steps.

[0104] It is worth noting that each of the multiple devices in the embodiment of the present application is logged in with a user ID, and each user ID is associated with an organization in the blockchain system. Each device corresponds to an organization in the blockchain system, and the organization corresponding to each device is the organization associated with the logged in user ID in the blockchain system.

[0105] The user ID is used to identify the user, such as the user ID can be the user's user name, user ID number, user account number, etc., which is not limited in the present embodiment of the application. The association between the user ID and the organization can be stored in the business platform or in the blockchain system, which is not limited in the present embodiment of the application.

[0106] Step 601: The target device obtains the chain code information.

[0107] The target device is logged in with a target user ID. The target user ID is used to identify the target user, such as the target user ID can be the user name, user ID number, user account number, etc. of the target user, which is not limited in the present embodiment of the application.

[0108] The target user ID is associated with one or more organizations in the blockchain system. The target user ID has management rights over the one or more organizations, including but not limited to the right to deploy chain codes in the one or more organizations. The organization associated with the target user ID can also be referred to as the organization corresponding to the target device logged in with the target user ID.

[0109] The chaincode information may be information related to the chaincode. For example, the chaincode information may include the name, introduction, version number, source code, endorsement policy, etc. of the chaincode. The chaincode may be a smart contract, such as a proof contract, etc.

[0110] The chain code information obtained by the target device may be input into the target device by the target user. Of course, it may also be obtained by the target device through other means, which is not limited in this embodiment of the present application.

[0111] For example, the target device can use the target user ID to log in to the business platform. At this time, the target device displays the front-end page of the business platform. The target user can enter the chain code information in the front-end page, and the target device can obtain the chain code information entered by the target user on the front-end page.

[0112] Step 602: The target device sends a chain code packaging request carrying the chain code information to the blockchain system.

[0113] The chain code packaging request is used to request the target organization corresponding to the target device (i.e., the target organization associated with the target user ID) to package the chain code. Optionally, the chain code packaging request may carry a target organization ID, which is used to identify the target organization. For example, the target organization ID may be the name of the target organization.

[0114] In one possible way, the target device can directly send the chain code packaging request to the blockchain system. In another possible way, the target device can first send the chain code packaging request to the business platform, and then the business platform sends the chain code packaging request to the blockchain system.

[0115] In some embodiments, if the target user identifier is only associated with one organization in the blockchain system, this organization can be directly used as the target organization. In this case, the target device can directly generate a chain code packaging request carrying the identifier of this organization (i.e., the target organization identifier) ​​and the chain code information.

[0116] If the target user ID is associated with multiple organizations in the blockchain system, one organization can be selected from the multiple organizations as the target organization. Specifically, the target device can display multiple organization IDs; when the target device detects a selection operation for one of the multiple organization IDs, the selected organization ID is used as the target organization ID. In this case, the target device can generate a chain code packaging request carrying the target organization ID and the chain code information, and the chain code installation request is used to request the target organization identified by the target organization ID to package the chain code.

[0117] The multiple organization identifiers include the identifier of each organization in the multiple organizations associated with the target user identifier. Each organization identifier is used to identify an organization, and the organization identifier may be the name of the organization, etc.

[0118] The selection operation is used to select an organization identifier from the multiple organization identifiers. The selection operation can be triggered by the target user, such as the selection operation can be a click operation, a slide operation, a voice operation, a gesture operation, a somatosensory operation, etc., which is not limited in the embodiment of the present application.

[0119] For example, the target device can log in to the business platform using the target user ID. The business platform can obtain the ID of each of the multiple organizations associated with the target user ID based on the association relationship between the user ID and the organization, that is, obtain multiple organization IDs, and then send the multiple organization IDs to the target device. After the target device receives the multiple organization IDs, it can display the multiple organization IDs on the front-end page of the business platform. Afterwards, the target user can select an organization ID from the multiple organization IDs displayed on the front-end page of the business platform to specify an organization that needs to package the chain code.

[0120] Step 603: After receiving the chain code packaging request, the blockchain system generates a chain code package on the computing node of the target organization according to the chain code information.

[0121] The chaincode needs to be packaged into a deployable structure before installation. Optionally, it can be packaged into a tar file, which is the chaincode package.

[0122] After receiving the chain code packaging request, the blockchain system can send the chain code information carried in the chain code packaging request to the computing node of the target organization, and the computing node of the target organization will generate a chain code package based on the chain code information.

[0123] The operation of the target organization's computing node generating a chain code package according to the chain code information is similar to the operation of a node generating a chain code package according to the chain code information in the related art, and the present application embodiment will not elaborate on this. For example, the computing node of the target organization can obtain the chain code package according to the chain code information using the peer command.

[0124] Step 604: The blockchain system sends the chain code package to the target device.

[0125] After the target device receives the chaincode package, it can obtain the chaincode deployment policy corresponding to the target channel. The target channel is the channel where the chaincode needs to be deployed. The chaincode deployment policy is used to indicate the organization that needs to approve the chaincode when the chaincode is deployed. Approving the chaincode means agreeing to deploy the chaincode. When the channels where the chaincode needs to be deployed are different, the corresponding chaincode deployment policies can be different.

[0126] The target device can locally store the chain code deployment policy corresponding to each channel in one or more channels, and then obtain the chain code deployment policy corresponding to the target channel from it. Alternatively, the target device can obtain the chain code deployment policy corresponding to the target channel from the business platform or blockchain system.

[0127] Optionally, the chaincode deployment policy can be used to indicate any of the following: deploying chaincode on the target channel requires approval from all organizations joining the target channel; deploying chaincode on the target channel requires approval from any organization joining the target channel; deploying chaincode on the target channel requires approval from more than half of all organizations joining the target channel.

[0128] In this case, after the target device receives the chain code package, it needs to send the chain code package to the corresponding devices of other organizations in order to obtain the recognition of other organizations.

[0129] In one possible approach, after receiving the chain code package, the target device sends the chain code package to other devices according to the organization indicated by the chain code deployment policy.

[0130] In this way, the target device can first determine the user ID associated with the organization indicated by the chaincode deployment policy, and then send the chaincode package to the device logged in with the determined user ID.

[0131] In another possible manner, after the target device receives the chain code package, the target user learns about the chain code package and can then inform other users of the chain code package, and other users can input the chain code package into the device logged in with their respective user IDs.

[0132] Step 605: Each of the multiple devices sends a chain code installation request carrying the chain code package to the blockchain system.

[0133] The multiple devices include the target device. Each device is logged in with a user ID, and each user ID is associated with an organization in the blockchain system. The chain code installation request sent by each device is used to request the organization corresponding to each device (i.e., the organization associated with the user ID logged in by each device) to install the chain code. Optionally, the chain code installation request may also carry a target channel ID, which is used to identify the target channel where the chain code needs to be deployed, such as the target channel ID can be the name of the target channel, etc.

[0134] It is worth noting that for any of the multiple devices, if the user ID logged in by the device is only associated with one organization in the blockchain system, the device can directly send a chaincode installation request carrying the organization's ID and the chaincode package to the blockchain system. The chaincode installation request is used to request the organization identified by the carried organization ID to install the chaincode.

[0135] If the user ID logged in by the device is associated with multiple organizations in the blockchain system, one organization can be selected from the multiple organizations. Specifically, the device can display multiple organization IDs, including the ID of each organization in the multiple organizations associated with the user ID logged in by the device; when the device detects a selection operation for one of the multiple organization IDs, it can generate a chaincode installation request carrying the selected organization ID and the chaincode package. The chaincode installation request is used to request the organization identified by the carried organization ID to install the chaincode.

[0136] For example, the device can log in to the business platform using a user ID. The business platform can obtain the ID of each of the multiple organizations associated with the user ID logged in by the device based on the association relationship between the user ID and the organization, that is, obtain multiple organization IDs, and then send the multiple organization IDs to the device. After receiving the multiple organization IDs, the device can display the multiple organization IDs on the front-end page of the business platform. After that, the user can select an organization ID from the multiple organization IDs displayed on the front-end page of the business platform to specify an organization that needs to install the chain code. After that, the user can enter the chain code package in the front-end page of the business platform and click the install button. The device can generate a chain code installation request carrying the selected organization ID and the chain code package and send it to the business platform. After receiving the chain code installation request, the business platform can send the chain code installation request to the blockchain system.

[0137] Step 606: Whenever the blockchain system receives a chain code installation request sent by a device, it installs the chain code on the computing node of the corresponding organization according to the chain code package carried in the received chain code installation request.

[0138] After the blockchain system receives a chaincode installation request sent by a device, it can send the chaincode installation request to the computing node of the organization corresponding to the device (that is, the organization associated with the user ID of the device login, that is, the organization identified by the organization ID carried by the chaincode installation request), and the computing node will install the chaincode according to the chaincode package.

[0139] The operation of the computing node installing the chain code according to the chain code package is similar to the operation of a computing node installing the chain code according to the chain code package in the related art, and this embodiment of the present application will not be elaborated in detail.

[0140] The computing node will review the chain code during the process of installing the chain code according to the chain code package, and can only successfully install the chain code after the chain code is approved. In other words, if the computing node successfully installs the chain code according to the chain code package, it means that the computing node has approved the chain code, which means that the organization to which the computing node belongs recognizes the chain code.

[0141] After the computing node successfully installs the chaincode according to the chaincode package, it can send a confirmation message carrying the chaincode package identifier to the sorting node in the blockchain system. Specifically, the computing node can send a confirmation message carrying the chaincode package identifier to the sorting node of the target channel identified by the target channel identifier carried by the chaincode installation request. The chaincode package identifier is used to identify the chaincode package, such as the chaincode package identifier can be the name of the chaincode package. The confirmation message is used to indicate that the organization to which the computing node belongs has approved the chaincode.

[0142] In this case, after receiving the confirmation message carrying the chain code package identifier sent by each computing node, the sorting node can know that each computing node has successfully installed the chain code, and also know that the organization to which each computing node belongs has approved the chain code. That is, the sorting node can determine the organization that has approved the chain code based on all the confirmation messages received that carry the chain code package identifier.

[0143] Step 607: The target device sends a chain code instantiation request to the blockchain system.

[0144] The chaincode instantiation request is used to request the instantiation of the chaincode, and the chaincode instantiation request can carry chaincode initialization parameters. Optionally, the chaincode instantiation request is used to request the instantiation of the chaincode on the target channel, and the chaincode instantiation request can carry the target channel identifier.

[0145] For example, the target device can log in to the business platform using the target user ID. At this time, the target device displays the front page of the business platform, and the target user can enter the chain code initialization parameters on the front page of the business platform and click the instantiation button. The target device can generate a chain code instantiation request carrying the chain code initialization parameters and send it to the business platform. The business platform can send the chain code instantiation request to the blockchain system.

[0146] Step 608: After the blockchain system receives the chain code instantiation request, if it is determined that the chain code meets the chain code deployment policy based on the organization to which the computing node that has successfully installed the chain code belongs, the chain code is instantiated.

[0147] Specifically, the sorting node can determine the organization that has approved the chain code based on all received confirmation messages carrying the chain code package identifier. If the organization that has approved the chain code is consistent with the organization indicated by the chain code deployment policy, the chain code is instantiated to complete the deployment of the chain code. The operation of the sorting node instantiating the chain code is similar to the operation of a node instantiating a chain code in the related art, and the embodiment of the present application will not be elaborated on this in detail.

[0148] For example, the chaincode deployment policy is used to indicate that the deployment of the chaincode on the target channel requires the approval of all organizations that join the target channel. Then the sorting node can instantiate the chaincode when all organizations that join the target channel approve the chaincode, and the deployment of the chaincode on the target channel is completed.

[0149] For another example, the chaincode deployment policy is used to indicate that the deployment of the chaincode on the target channel requires the approval of any organization that joins the target channel. Then the sorting node can instantiate the chaincode if any organization that joins the target channel approves the chaincode, and the deployment of the chaincode on the target channel is completed at this time.

[0150] For another example, the chaincode deployment policy is used to indicate that the deployment of the chaincode on the target channel requires the approval of more than half of all organizations that join the target channel. Then the sorting node can instantiate the chaincode when most of the organizations that join the target channel approve the chaincode, and the deployment of the chaincode on the target channel is completed at this time.

[0151] In an embodiment of the present application, multiple devices logged with user identifiers associated with each of the multiple organizations send chain code installation requests to the blockchain system. Each time the blockchain system receives a chain code installation request sent by a device, it installs the chain code on the computing node of the corresponding organization according to the chain code package carried in the received chain code installation request. In this way, when deploying the chain code, each of the multiple organizations recognizes the chain code when installing the chain code, thereby distributing the chain code deployment authority to the multiple related organizations, and realizing the equality of organizational authority when the chain code is deployed. Afterwards, after the blockchain system receives the chain code instantiation request, if it is determined that the chain code meets the chain code deployment policy based on the organization to which the computing node that has successfully installed the chain code belongs, the chain code is instantiated to complete the deployment of the chain code. In this way, the operations of chain code installation, approval, and instantiation are separated, which improves the flexibility of the system.

[0152] Figure 7 is a flowchart of a chain code deployment method provided by an embodiment of the present application. The method is applied to a blockchain system, which can be the above Figure 1-Figure 2 The blockchain system 100 described in the embodiment may also be Figure 3-Figure 5 The blockchain system 302 described in the embodiment. Figure 7 , the method may include the following steps:

[0153] Step 701: Receive a chain code installation request carrying a chain code package sent by each of multiple devices.

[0154] Each device corresponds to an organization in the blockchain system. Each device is logged in with a user ID. The organization corresponding to each device is the organization associated with the logged in user ID in the blockchain system.

[0155] The relevant content of step 701 is already mentioned above. Figure 6 Step 605 in the embodiment is described in detail, and will not be described in detail in the embodiment of the present application.

[0156] Step 702: Every time a chain code installation request is received from a device, the chain code is installed on the computing node of the corresponding organization according to the chain code package carried in the received chain code installation request.

[0157] The relevant contents of step 702 are already described above. Figure 6 Step 606 in the embodiment is described in detail, and will not be described in detail in the embodiment of the present application.

[0158] Step 703: Receive a chaincode instantiation request.

[0159] The chaincode instantiation request is used to request the instantiation of the chaincode.

[0160] The relevant content of step 703 is already mentioned above. Figure 6 Step 607 in the embodiment is described in detail, and will not be described in detail in the embodiment of the present application.

[0161] Step 704: If the chain code satisfies the chain code deployment policy according to the organization to which the computing node that has successfully installed the chain code belongs, the chain code is instantiated.

[0162] The chaincode deployment policy is used to indicate the organizations that need to approve the chaincode when it is deployed.

[0163] The relevant content of step 704 is already mentioned above. Figure 6 Step 608 in the embodiment is described in detail, and will not be described in detail in the embodiment of the present application.

[0164] In an embodiment of the present application, multiple devices logged with user identifiers associated with each of the multiple organizations send chain code installation requests to the blockchain system. Each time the blockchain system receives a chain code installation request sent by a device, it installs the chain code on the computing node of the corresponding organization according to the chain code package carried in the received chain code installation request. In this way, when deploying the chain code, each of the multiple organizations recognizes the chain code when installing the chain code, thereby distributing the chain code deployment authority to the multiple related organizations, and realizing the equality of organizational authority when the chain code is deployed. Afterwards, after the blockchain system receives the chain code instantiation request, if it is determined that the chain code meets the chain code deployment policy based on the organization to which the computing node that has successfully installed the chain code belongs, the chain code is instantiated to complete the deployment of the chain code. In this way, the operations of chain code installation, approval, and instantiation are separated, which improves the flexibility of the system.

[0165] Figure 8is a schematic diagram of a chain code deployment device provided in an embodiment of the present application, which can be applied to a blockchain system, and the blockchain system can be Figure 1-Figure 2 The blockchain system 100 of the embodiment may also be the Figure 3-Figure 5 Blockchain system 302 of the embodiment. Figure 8 The device includes: a receiving module 801, an installation module 802, and an instantiation module 803.

[0166] The receiving module 801 is used to receive a chain code installation request carrying a chain code package sent by each device among multiple devices, each device corresponds to an organization in the blockchain system, each device is logged in with a user ID, and the organization corresponding to each device is the organization associated with the logged in user ID in the blockchain system;

[0167] The installation module 802 is used to install the chain code on the computing node of the corresponding organization according to the chain code package carried in the received chain code installation request every time a chain code installation request sent by a device is received;

[0168] The receiving module 801 is further used to receive a chain code instantiation request, where the chain code instantiation request is used to request to instantiate a chain code;

[0169] The instantiation module 803 is used to instantiate the chain code when it is determined that the chain code meets the chain code deployment policy according to the organization to which the computing node that has successfully installed the chain code belongs. The chain code deployment policy is used to indicate the organization that needs to approve the chain code when the chain code is deployed.

[0170] Optionally, the device further includes: a generating module and a sending module;

[0171] The receiving module 801 is further used to receive a chain code packaging request carrying chain code information, where the chain code packaging request is used to request the target organization to package the chain code;

[0172] The generation module is used to generate a chain code package on the computing node of the target organization according to the chain code information;

[0173] The sending module is used to send the chain code package to the target device corresponding to the target organization.

[0174] Optionally, the chaincode instantiation request is used to request the chaincode to be instantiated on the target channel, and the chaincode deployment policy is used to indicate any of the following:

[0175] Deploying a chaincode on a target channel requires approval from all organizations that join the target channel.

[0176] Deploying a chaincode on a target channel requires approval from any organization that joins the target channel.

[0177] Deploying a chaincode on a target channel requires approval from more than half of all organizations joining the target channel.

[0178] In an embodiment of the present application, multiple devices logged with user identifiers associated with each of the multiple organizations send chain code installation requests to the blockchain system. Each time the blockchain system receives a chain code installation request sent by a device, it installs the chain code on the computing node of the corresponding organization according to the chain code package carried in the received chain code installation request. In this way, when deploying the chain code, each of the multiple organizations recognizes the chain code when installing the chain code, thereby distributing the chain code deployment authority to the multiple related organizations, and realizing the equality of organizational authority when the chain code is deployed. Afterwards, after the blockchain system receives the chain code instantiation request, if it is determined that the chain code meets the chain code deployment policy based on the organization to which the computing node that has successfully installed the chain code belongs, the chain code is instantiated to complete the deployment of the chain code. In this way, the operations of chain code installation, approval, and instantiation are separated, which improves the flexibility of the system.

[0179] It should be noted that: the chain code deployment device provided in the above embodiment only uses the division of the above functional modules as an example when deploying the chain code. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0180] The functional units and modules in the above embodiments may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit, and the above integrated units may be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present application.

[0181] The chain code deployment device and the chain code deployment method provided in the above embodiments belong to the same concept. The specific working process and technical effects brought about by the units and modules in the above embodiments can be found in the method embodiment part, which will not be repeated here.

[0182] Fig. 9 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. Fig. 9 As shown, the computer device 9 includes: a processor 90, a memory 91, and a computer program 92 stored in the memory 91 and executable on the processor 90. When the processor 90 executes the computer program 92, the above Figure 7 Steps in the chaincode deployment method in the embodiment.

[0183] The computer device 9 may be a general-purpose computer device or a special-purpose computer device. In a specific implementation, the computer device 9 may be a server set consisting of multiple servers. Those skilled in the art will appreciate that Fig. 9 It is only an example of the computer device 9 and does not constitute a limitation on the computer device 9. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components, such as input and output devices, network access devices, etc.

[0184] The processor 90 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0185] In some embodiments, the memory 91 may be an internal storage unit of the computer device 9, such as a hard disk or memory of the computer device 9. In other embodiments, the memory 91 may also be an external storage device of the computer device 9, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device 9. Further, the memory 91 may also include both an internal storage unit of the computer device 9 and an external storage device. The memory 91 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as program codes of computer programs, etc. The memory 91 may also be used to temporarily store data that has been output or is to be output.

[0186] An embodiment of the present application also provides a computer device, which includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, and when the processor executes the computer program, the steps in any of the above-mentioned method embodiments are implemented.

[0187] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0188] An embodiment of the present application provides a computer program product, which, when executed on a computer, enables the computer to execute the steps in the above-mentioned method embodiments.

[0189] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above method embodiments, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above method embodiments can be implemented. Among them, the computer program includes computer program code, which can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the camera / terminal device, recording medium, computer memory, ROM (Read-Only Memory), RAM (Random Access Memory), CD-ROM (Compact Disc Read-Only Memory), magnetic tape, floppy disk and optical data storage device. The computer-readable storage medium mentioned in the present application can be a non-volatile storage medium, in other words, it can be a non-transient storage medium.

[0190] It should be understood that all or part of the steps to implement the above embodiments can be implemented by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The computer instructions can be stored in the above-mentioned computer readable storage medium.

[0191] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0192] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0193] In the embodiments provided in the present application, it should be understood that the disclosed devices / computer equipment and methods can be implemented in other ways. For example, the device / computer equipment embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0194] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0195] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A chain code deployment method, characterized in that: The method comprises: Each of the multiple devices sends a chain code installation request carrying a chain code package to the blockchain system, each of the devices corresponds to an organization in the blockchain system, each of the devices is logged in with a user ID, and the organization corresponding to each device is the organization associated with the logged in user ID in the blockchain system; Each time the blockchain system receives a chain code installation request sent by a device, the chain code is installed on the computing node of the corresponding organization according to the chain code package carried in the received chain code installation request; A target device among the multiple devices sends a chain code instantiation request to the blockchain system, where the chain code instantiation request is used to request instantiation of the chain code; After receiving the chain code instantiation request, if the blockchain system determines that the chain code satisfies the chain code deployment policy according to the organization to which the computing node that has successfully installed the chain code belongs, the chain code is instantiated, and the chain code deployment policy is used to indicate the organization that needs to approve the chain code when the chain code is deployed; The blockchain system installs the chain code on the computing node of the corresponding organization according to the chain code package carried in the received chain code installation request, including: The computing node installs the chain code according to the chain code package, and sends a confirmation message carrying the chain code package identifier to the sorting node in the blockchain system after successfully installing the chain code; If the blockchain system determines that the chain code satisfies the chain code deployment policy according to the organization to which the computing node that has successfully installed the chain code belongs, then instantiating the chain code includes: The sorting node determines the organization that has approved the chain code based on all received confirmation messages carrying the chain code package identifier, and instantiates the chain code if the organization that has approved the chain code is consistent with the organization indicated by the chain code deployment policy.

2. The method according to claim 1, characterized in that The chaincode instantiation request is used to request to instantiate the chaincode on the target channel, and the chaincode deployment strategy is used to indicate any of the following: Deploying the chaincode on the target channel requires approval from all organizations that join the target channel; Deploying a chaincode on the target channel requires approval from any organization that joins the target channel; Deploying the chaincode on the target channel requires approval from more than half of all organizations joining the target channel.

3. The method according to claim 1, characterized in that Before each of the multiple devices sends a chain code installation request carrying a chain code package to the blockchain system, the process further includes: The target device obtains chain code information; The target device sends a chain code packaging request carrying the chain code information to the blockchain system, where the chain code packaging request is used to request the target organization corresponding to the target device to package the chain code; After receiving the chain code packaging request, the blockchain system generates the chain code package on the computing node of the target organization according to the chain code information; The blockchain system sends the chain code package to the target device.

4. The method according to claim 3, characterized in that After the blockchain system sends the chain code package to the target device, it also includes: After receiving the chain code package, the target device sends the chain code package to other devices according to the organization indicated by the chain code deployment policy.

5. The method according to claim 3 or 4, characterized in that The target user identifier logged in by the target device is associated with multiple organizations in the blockchain system. Before the target device sends a chain code packaging request carrying the chain code information to the blockchain system, the method further includes: The target device displays a plurality of organization identifiers, wherein the plurality of organization identifiers include an identifier of each organization in the plurality of organizations associated with the target user identifier; When the target device detects a selection operation on one of the multiple organization identifiers, the target device uses the selected organization identifier as the target organization identifier, generates a chain code packaging request carrying the target organization identifier and the chain code information, and the chain code packaging request is used to request the target organization identified by the target organization identifier to package the chain code.

6. A chain code deployment method, characterized in that: Applied to a blockchain system, the method includes: Receiving a chain code installation request carrying a chain code package sent by each of a plurality of devices, wherein each device corresponds to an organization in the blockchain system, each device is logged in with a user identifier, and the organization corresponding to each device is an organization associated with the logged in user identifier in the blockchain system; Each time a chain code installation request is received from a device, the chain code is installed on the computing node of the corresponding organization according to the chain code package carried in the received chain code installation request; Receive a chain code instantiation request, where the chain code instantiation request is used to request instantiation of the chain code; If the chaincode satisfies the chaincode deployment policy according to the organization to which the computing node that has successfully installed the chaincode belongs, the chaincode is instantiated, and the chaincode deployment policy is used to indicate the organization that needs to approve the chaincode when the chaincode is deployed; The step of installing the chain code on the computing node of the corresponding organization according to the chain code package carried in the received chain code installation request includes: The computing node installs the chain code according to the chain code package, and sends a confirmation message carrying the chain code package identifier to the sorting node in the blockchain system after successfully installing the chain code; If it is determined that the chain code satisfies the chain code deployment policy according to the organization to which the computing node that has successfully installed the chain code belongs, then instantiating the chain code includes: The sorting node determines the organization that has approved the chain code based on all received confirmation messages carrying the chain code package identifier, and instantiates the chain code if the organization that has approved the chain code is consistent with the organization indicated by the chain code deployment policy.

7. The method according to claim 6, characterized in that Before receiving the chain code installation request carrying the chain code package sent by each device among the multiple devices, the method further includes: Receive a chain code packaging request carrying chain code information, where the chain code packaging request is used to request the target organization to package the chain code; Generate the chain code package at the computing node of the target organization according to the chain code information; The chain code package is sent to a target device corresponding to the target organization.

8. A chain code deployment system, characterized in that: The system includes: multiple devices and a blockchain system; Each of the multiple devices is used to send a chain code installation request carrying a chain code package to the blockchain system, each of the devices corresponds to an organization in the blockchain system, each of the devices is logged in with a user identifier, and the organization corresponding to each device is the organization associated with the logged in user identifier in the blockchain system; The blockchain system is configured to install the chain code on the computing node of the corresponding organization according to the chain code package carried in the received chain code installation request each time a chain code installation request is received from a device; A target device among the multiple devices is used to send a chain code instantiation request to the blockchain system, wherein the chain code instantiation request is used to request instantiation of the chain code; The blockchain system is configured to, upon receiving the chain code instantiation request, instantiate the chain code if it is determined that the chain code satisfies a chain code deployment policy according to the organization to which the computing node that has successfully installed the chain code belongs, wherein the chain code deployment policy is used to indicate the organization that needs to approve the chain code when the chain code is deployed; The step of installing the chain code on the computing node of the corresponding organization according to the chain code package carried in the received chain code installation request includes: The computing node installs the chain code according to the chain code package, and sends a confirmation message carrying the chain code package identifier to the sorting node in the blockchain system after successfully installing the chain code; If it is determined that the chain code satisfies the chain code deployment policy according to the organization to which the computing node that has successfully installed the chain code belongs, then instantiating the chain code includes: The sorting node determines the organization that has approved the chain code based on all received confirmation messages carrying the chain code package identifier, and instantiates the chain code if the organization that has approved the chain code is consistent with the organization indicated by the chain code deployment policy.

9. A computer device, characterized in that: The computer device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the method according to claim 6 or 7 when executed by the processor.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to claim 6 or 7 is implemented.

Citation Information

Patent Citations

  • Block chain network service platform and chain code installing method thereof, storage medium

    CN108965468A

  • Blockchain deployment method and platform and computer storage medium

    CN109194506A