Welcome to the Linux Foundation Forum!

Chapter 9 - Cross Chaincode invokation

I am trying to invoke a chaincode from another chaincode. I am trying to figure out the command to be used to pass as an argument as per chaincode_interaction.zip in repository. I tried numerous combination, but i am not able to understand / parse the JSON format of the last parameter to be passed.

peer chaincode invoke ${orderer} -C mychannel -n chaincode_interaction ${peer_org1} ${peer_org2} -c '{"function":"interact","Args":["mychannel","balance_transfer","{"function":"initAccount","Args":["A1","100"]}"]}'

but above command errors out - invalid character 'f' after array element.


  • Bobbijn
    Bobbijn Posts: 75

    @sumitvedpathak, Lets try to get to the bottom of this. What combinations have you tried and what the results? Bobbi

  • I tried all combinations, with and without the initAccount function, only the JSON object to create an account parameters without initAccount function, etc... All sorts of permutations and combinations used. But sorry always throw an error of invalid character message.
    Not sure if anyone tried this.

  • Bobbijn
    Bobbijn Posts: 75

    Hello @SumitVedpathak , A great resource you might try to gain clarification is the Fabric Documentation, https://wiki.hyperledger.org/display/fabric/Design+Documents, or please take the issue to the Fabric mailing list [email protected] Hope this helps, Keep learning!


Upcoming Training