Share via

HLF on AKS: deploying chaincode via node

GSUser 1 Reputation point
2021-01-11T15:30:53.03+00:00

trying to deploy code that is via node template; looking at the example on https://learn.microsoft.com/en-us/azure/blockchain/templates/hyperledger-fabric-consortium-azure-kubernetes-service#chaincode-management-commands the code isn't package. Does azhlftool package the code during deployment; or do I need to access peer0 via docker exec? Some clarity here would be appreciated

Community Center | Not monitored

1 answer

Sort by: Most helpful
  1. Chintan Rajvir 426 Reputation points Microsoft Employee
    2021-01-15T05:23:39.443+00:00

    Hi @GSUser ,

    The azhlfTool client makes use of Fabric Node SDK to install chaincodes on peer nodes. While performing chaincode installation using Fabric Node SDK, you do not need to package the chaincode. While running the installation command, you must specify the details of the chaincode, including the absolute path of the chaincode source code directory.

    For example, we have shared 2 sample chaincodes, written in Golang, with azhlfTool, as found here.
    In this scenario, if you are installing, let's say, chaincode_example02 sample chaincode, then the install chaincode command would be:

    ./azhlf chaincode install -o $ORGNAME -u $USER_IDENTITY -n $CC_NAME -p $CC_PATH -l $CC_LANG -v $CC_VERSION

    where, the $CC_PATH environment variable corresponds to the absolute path to the chaincode project root directory, i.e. <absolutePathToAzhlfToolDirectory>/samples/chaincode/src/chaincode_example02/go and $CC_LANG being golang.

    Regards,
    Chintan Rajvir

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.