Use this guide to connect your decentralized application (Dapp) to an Alibaba Cloud BaaS network, manage private keys and certificates, and upgrade your Dapp.
Connection profile
A connection profile contains all the information the Fabric SDK needs to connect to your Hyperledger Fabric blockchain network. Download the SDK configuration file from the BaaS console and extract the ZIP archive to find the connection profile.
The profile is organized into six sections:
| Section | What it describes |
|---|---|
client | The Fabric client configuration, including MspID, BCCSP, and cryptoStore |
organizations | All organizations in the network — their MspID, peer nodes, and certificate authorities (CAs) |
channels | All channels in the network — the peer nodes in each channel, each peer's role, and orderer information |
peers | Details for each peer node: URL, TLS certificate, domain, and event hub URL |
orderers | Details for each orderer: URL, TLS certificate, and domain |
certificateAuthorities | CA details (URL, TLS certificate, and name) for the organization the client belongs to |
The certificateAuthorities section only includes the CA of the organization to which the client belongs. CAs from other organizations are not shown.Private key and certificate management
BaaS uses two user roles with different permissions:
| Role | Permissions | Private key management |
|---|---|---|
| ADMIN | Upload, upgrade, and instantiate chaincode; create channels | BaaS hosts the private key. Perform these operations directly from the BaaS console. |
| MEMBER | Invoke and query chaincode | You manage the private key on your server. Dapps typically run as MEMBER users. |
Generate a private key and enroll from a CA
To get a private key and certificate for a MEMBER user, use the Fabric SDK to enroll with a Fabric certificate authority (CA). After enrollment, the private key and certificate are stored on your server. The Fabric SDK writes the private key to the path specified by client.credentialsStore.crytoStore.path in the connection profile. The default path is /tmp/msp.
Keep your private key secure.
Upgrade your Dapp
Upgrading a Dapp involves two steps. Run a full code review and test the changes in a non-production environment before upgrading in production.
Upgrade the chaincode. Follow the chaincode upgrade procedure in the BaaS console.
Upgrade the Dapp. Deploy the new version of your application — for example, update the assets on your CDN.
What's next
Access a blockchain network — download the SDK configuration file and connection profile
Upgrade chaincode — step-by-step chaincode upgrade procedure