0

IBM Blockchain Platform V1 has(had) a nice API to interact with the blockchain itself. Here is the link to the swagger: https://ibp-sp.eu-gb.ibm-blockchain-5-prod.cloud.ibm.com/api-docs/

Among others, we could install and instantiate chaincodes (thus, we could have some kind of automation for chaincode deployment).

However, based on this documentation for IBM Blockchain Platform V2, there is not API to install/instantiate chaincode. We can only manage the network.

So my questions are:

  • Is it not possible to manage chaincodes via API with IBP2?
  • If it is possible, where is the documentation?
  • If it is not possible, why has it been removed and it it planed to be added in the future?
Itération 122442
  • 2,644
  • 2
  • 27
  • 73

1 Answers1

0

It is possible to manage chaincodes via API in IBP2.

According to the documentation that you posted above, there is a big yellow block that says Important: Also, you can use the Fabric Node SDK or peer CLI commands to install and instantiate smart contracts.

This means that you can use the Hyperledger Fabric APIs to install / instantiate your chaincode.

For example, one of my peers that is running in IBM Blockchain platform has the following URL, according to the connection profile:

grpcs://cd8945b468274f94b24b0dce0b0d6583-peer443d9f.horea-blockchainbean2-ap.sjc03.containers.appdomain.cloud:7051

Thus, to install a chaincode on this peer, we would do the following command:

CORE_PEER_ADDRESS=grpcs://cd8945b468274f94b24b0dce0b0d6583-peer443d9f.horea-blockchainbean2-ap.sjc03.containers.appdomain.cloud:7051 peer chaincode install -n mycc -p github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02 -v v0

Note that we have to do this command from inside the CLI container. So before we run this command we would have to do docker exec -it cli bash. You can see the documentation here

Horea Porutiu
  • 176
  • 1
  • 6