fabsOu
fabsOu

Reputation: 1

Instantiate the fabcar and return the Failed to get policy manager for channel

I have started the chaincode-docker-devmode. and the changed the sacc to fabcar Compiled the fabcar.go to fabcar success.

docker exec -it chaincode bash
CORE_PEER_ADDRESS=peer:7051 CORE_CHAINCODE_ID_NAME=fabcar:0 ./fabcar

docker exec -it cli bash
peer chaincode install -p chaincodedev/chaincode/fabcar -n fabcar -v 0

At this time all the process is success then i execute the

peer chaincode instantiate -n fabcar -v 0 -c '{"Args":["init"]}'  -C mycar

the console told me :

2017-10-18 10:59:50.945 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2017-10-18 10:59:50.945 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2017-10-18 10:59:50.945 UTC [msp/identity] Sign -> DEBU 003 Sign: plaintext: 0AA4080A5C08011A0C08A6E89CCF0510...6E666967426C6F636B0A056D79636172
2017-10-18 10:59:50.945 UTC [msp/identity] Sign -> DEBU 004 Sign: digest: 38FA755F94FA90784C50D77E8638EA42679C0F8216AA3DBE10A7D8D2F2215D80
Error: Error getting (mycar) orderer endpoint: Error endorsing GetConfigBlock: rpc error: code = Unknown desc = chaincode error (status: 500, message: "GetConfigBlock" request failed authorization check for channel [mycar]: [Failed to get policy manager for channel [mycar]])

How to fix it?

Upvotes: 0

Views: 1116

Answers (1)

Artem Barger
Artem Barger

Reputation: 41232

Chaincode instantiate in fact endorsement transaction which has to be eventually submitted to the ordering service, hence what you missed in the instantiate command is the ordering service endpoint, e.g.:

You did:

peer chaincode instantiate -n fabcar -v 0 -c '{"Args":["init"]}'  -C mycar

While needed:

peer chaincode instantiate -o orderer.example.com:7050 -n fabcar -v 0 -c '{"Args":["init"]}'  -C mycar 

Upvotes: 1

Related Questions