Welcome to the Linux Foundation Forum!

Lab 4.1: Chaincode Definition Approval fails

georgemac510
georgemac510 Posts: 9
edited June 2022 in LFD272 Class Forum

All steps until the Chaincode Definition Approval step have worked as intended until the following:

$ export CC_PACKAGE_ID=chaincode_1.0: aff18d7b27840787819bcee634c7a267cb0e246dd367cb048dc9c0210a23e5fa

$ peer lifecycle chaincode approveformyorg -o orderer.example.com:7050 --channelID mychannel --name chaincode --version 1.0 --package-id $CC_PACKAGE_ID --sequence 1

Error: failed to retrieve broadcast client: orderer client failed to connect to orderer.example.com:7050: failed to create new connection: connection error: desc = "transport: error while dialing: dial tcp: lookup orderer.example.com: no such host"

I even tried this with renaming the --name and PACKAGE_ID to simple_chaincode 1.0 with the same result.

Might I need to change something in the docker yaml files so that a connection can be made to orderer.example.com:7050?

Thanks in advance for any help. Have been stuck here for a few days.

Answers

  • georgemac510
    georgemac510 Posts: 9
    edited June 2022

    Also, it appears that all of the necessary Docker containers are up and running including the one for orderer.example.com:7050

  • Bobbijn
    Bobbijn Posts: 190

    @georgemac510, Hello, let's see if we can get to the bottom of this issue. One suggestion is to restart the blockchain. This shut down and restart the blockchain. This often resolves this issue. Please let me know if this helps or if more research is needed. Bobbi

  • Hi @Bobbijn Unfortunately this didn't help. I'm getting the same error message:

    Thanks very much for your suggestion and any other help you can offer.

  • It appears that I got it to work by using the command:

    peer lifecycle chaincode approveformyorg -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --channelID mychannel --name simple_chaincode --version 1.0 --package-id $CC_PACKAGE_ID --sequence 1 --tls --cafile "${PWD}/organizations/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem"

    which is using localhost:7050 rather than orderer.example.com:7050.

    Approval was made on Org2 first, then Org1.

    Now stuck at invocation, but that is a battle for another day.

  • Bobbijn
    Bobbijn Posts: 190

    @georgemac510, Just checking in to see if you were able to get past the chaincode invoke exercises? Bobbi

Categories

Upcoming Training