All Products
Search
Document Center

Add an external organization to an internal channel

Last Updated: Apr 14, 2021

All organizations in a channel of a consortium that is created in Alibaba Cloud BaaS can submit applications to add an external organization to the channel. This applies after you have installed a management chaincode in all organizations in the channel and bound the management chaincode with this channel.

Add an external organization

Prerequisites

  • The addresses of peer nodes in the external organization are combinations of domain names and port numbers. These addresses are accessible over the Internet.

  • The external organization uses the same type of state database as organizations in Alibaba Cloud BaaS. The default state database in Alibaba Cloud BaaS is CouchDB.

  • If the version of a consortium in BaaS is V1.4, the Hyperledger Fabric version of the external organization is V1.4.2 or higher and lower than V2.0. If the version of a consortium in BaaS is V2.2, the Hyperledger Fabric version of the external organization is V2.2.x.

  • A management chaincode is installed in all organizations in the channel and is bound with the channel. In this case, the channel is marked with the Hybrid Channel identifier. For more information, see Management chaincodes.

  • The interoperability tool is available for the external organization. Alibaba Cloud BaaS users can submit a ticket to the BaaS team to obtain the interoperability tool and send it to the external organization. To use the tool, the external organization must have access to the configtx.yaml file and crypto-config directory in the Hyperledger Fabric environment. If the file or directory is inaccessible, the tool is unavailable. In this case, the blockchain platform to which this organization belongs must provide the required interoperability feature.

  1. An organization can not join different channels with same name.

Procedure

  1. (External organization to be added) Run the ./cmt.amd64 req generate req.json command by using the interoperability tool to generate a request file for joining the channel. Then, send the request file to the administrator of an Alibaba Cloud BaaS organization in the channel in offline mode.Generate a request file for joining the channel

    Note: For more information about how to configure and use the interoperability tool, see the description file that is attached with the tool. If this tool is unavailable for the external organization, use the blockchain platform to which the external organization belongs or the Hyperledger Fabric command-line interface (CLI) to obtain the related information and generate a request file. For the content in the file, see Example for reference.

  2. (Administrator who receives the request file) Log on to the Alibaba Cloud BaaS console. In the My Organization section of the Overview page, click the name of an Alibaba Cloud BaaS organization that is in the target channel to initiate the process for adding the external organization.

  3. (Administrator who receives the request file) Click the Channels tab, find the target channel, confirm that it is marked with the Hybrid Channel identifier, and click Add External Organization.Add external organization

  4. (Administrator who receives the request file) In the Add External Organization pane, upload the request file. The key information of the external organization is displayed in the lower part of this pane. Confirm that the information is correct and click Add. An approval task is issued to all organizations in the channel. Signatures of more than half of the organizations are required.Upload request file

  5. (All Alibaba Cloud BaaS organizations in the target channel) Log on to the Alibaba Cloud BaaS console, find the task to be approved on the Tasks page, and click Handle in the Actions column. The Task Details pane appears. In most cases, the task issued to the initiator is automatically approved and the task state is Approved.Information of the approval task

    Note: When an organization that is not the operator that instantiated the management chaincode uses the management chaincode for the first time, it must create an environment to run the management chaincode. In this case, the Task Details pane may require a long period of time to respond, and the task for the initiator is not automatically approved.

  6. (All Alibaba Cloud BaaS organizations in the target channel) In the Task Details pane, view the details of the external organization. Confirm that the Membership Service Provider (MSP) ID and other information are correct. Click Approve. If you do not want to approve the task, click Close.Approve the task

  7. (Existing external organizations in the target channel) Run the ./cmt.amd64 list command in the interoperability tool to browse tasks. These organizations must use the tool because they cannot approve tasks in the Alibaba Cloud BaaS console.Use the interoperability tool to browse tasks

  8. (Existing external organizations in the target channel) Run the ./cmt.amd64 approve [Proposal ID] command by using the interoperability tool to approve the task. Replace Proposal ID in the command with the task ID, which is displayed in the Task Details pane of the Alibaba Cloud BaaS console.Use interoperability tool to approve the task

    Note: If the interoperability tool is unavailable for an existing external organization, use the blockchain platform to which it belongs or the Hyperledger Fabric CLI to sign the channel update and call the management chaincode to process the task.

  9. After the task is approved by more than half of the organizations, the task state becomes Applicable. In this case, the task for Alibaba Cloud BaaS organizations is automatically submitted. Then, the state becomes Applied. For existing external organizations, contact an Alibaba Cloud BaaS organization to click Submit in the Task Details pane to validate the channel update.

  10. (An Alibaba Cloud BaaS organization in the target channel) In the My Organizations section of the Overview page, click the name of your organization. On the organization details page, click the Channels tab and then click Get Join Response. In the pane that appears, download the response file or copy the content in the field. Send the file or the copied information to the external organization to be added.Obtain the response file

  11. (External organization to be added) Use the interoperability tool to process the response file and join the channel.Use the interoperability tool to process the response file

    Note: If the interoperability tool is unavailable for the external organization, use the blockchain platform to which it belongs or the Hyperledger Fabric CLI to connect to orderer nodes and obtain the latest blocks in the channel.

  12. (External organization to be added) Reconfigure the channel and orderer certificate and specify a management chaincode for the interoperability tool.Configure the interoperability tool

  13. (V1.4) (External organization to be added) Download and install the management chaincode to manage the channel with other organizations. You can run the ./cmt.amd64 install cmcc.1.4.cc command by using the interoperability tool to install the management chaincode.

  14. For the external organization, if the version of the BaaS consortium is V2.2, download and install the management chaincode, so that you can manage channels together with other organizations. You can also run the ./cmt.amd64 lifecycle install ./cmcc.1.5.tar.gz command in the interoperability tool to install the downloaded management chaincode.

  15. For the external organization, if the version of the BaaS consortium is V2.2, after you install the management chaincode, run the following command in the interoperability tool to submit the chaincode definition: ./cmt.amd64 lifecycle approve cmcc.1.5.tar.gz -n <Chaincode name in BaaS> -v <Version number in BaaS> -s <Serial number in BaaS> -e <Endorsement policy in BaaS>.

    Note: You can obtain the chaincode name in BaaS, version number in BaaS, and serial number in BaaS from an organization in BaaS.

  16. For the external organization, after the management chaincode is instantiated, run the ./cmt.amd64 list command in the interoperability tool to view tasks. You can view tasks if the management chaincode is bound to the channel that you are added to.View tasks in the interoperability tool