Welcome to the Linux Foundation Forum!

Chaincode Development in Dev Mode - Chaincode compile and execution

Hi!

i compiled successfully the chaincode_example02 but when I execute, it gives me an error and I don't know why

Error starting Simple chaincode: error chaincode id not provided

Thank you in advance!

echo CORE_PEER_MSPCONFIGPATH

CORE_PEER_MSPCONFIGPATH

echo $CORE_PEER_MSPCONFIGPATH

/etc/hyperledger/msp

cd chaincode_example02/go

pwd

/opt/gopath/src/chaincode/chaincode_example02/go

go build -o chaincode_example02

ls

chaincode_example02 chaincode_example02.go

file chaincode_example02

chaincode_example02: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/l, for GNU/Linux 3.2.0, BuildID[sha1]=3700e8f2656b0f53a0d8654316290d0a517139f8, not stripped

file chaincode_example02.go

chaincode_example02.go: C source, ASCII text

CORE_PEER_ADDRESS=peer:7052 CORE_CHAINCODE_ID_NAME=mycc:0

# ./chaincode_example02
2021-04-07 02:58:59.721 UTC [shim] setupChaincodeLogging -> INFO 001 Chaincode log level not provided; defaulting to: INFO
2021-04-07 02:58:59.721 UTC [shim] setupChaincodeLogging -> INFO 002 Chaincode (build level: ) starting up ...
Error starting Simple chaincode: error chaincode id not provided#

Comments

  • Bobbijn
    Bobbijn Posts: 193

    @FabianChiera ,

    Hello , This forum is to assist learners with the LFD272 coursework. Is the example you are referring to in the user documentation? Bobbi

  • Hi, yes! if on LFD272 coursework: Chaincode Development in Dev Mode

  • Hi @FabianChiera,

    Make sure that the environmental variables are set in the same command as a binary execution:

    CORE_PEER_ADDRESS=peer:7052 CORE_CHAINCODE_ID_NAME=mycc:0 ./chaincode_example02
    

    If you'd like to utilize these variables through the whole terminal session, you can instead try to export them:

    export CORE_PEER_ADDRESS=peer:7052
    export CORE_CHAINCODE_ID_NAME=mycc:0
    ./chaincode_example02
    

    Best regards,
    Ilya

Categories

Upcoming Training