Failed to instantiate chaincodes: Error: "target" parameter not specified and no peers are set on this Channel instance or specfied for this channel in the network
info: [create-channel.js]: Sleeping 5s...
info: [join-channel.js]: Joining channels...
info: [install-chaincode.js]: installing all chaincodes......
info: [install-chaincode.js]: Installing chaincode simple...
info: [install-chaincode.js]: Installed chaincode simple successfully in all peers
info: [instantiate-chaincode.js]: Instantiating chaincodes...
error: [instantiate-chaincode.js]: Failed to instantiate chaincodes: Error: "target" parameter not specified and no peers are set on this Channel instance or specfied for this channel in the network
at Channel._getTargets (/home/js/go/src/github.com/hyperledger/caliper/node_modules/fabric-client/lib/Channel.js:3488:10)
at Channel._getFirstAvailableTarget (/home/js/go/src/github.com/hyperledger/caliper/node_modules/fabric-client/lib/Channel.js:3432:24)
at Channel._initialize (/home/js/go/src/github.com/hyperledger/caliper/node_modules/fabric-client/lib/Channel.js:350:23)
at Channel.initialize (/home/js/go/src/github.com/hyperledger/caliper/node_modules/fabric-client/lib/Channel.js:250:25)
at
{ "caliper": { "blockchain": "fabric", "command": { "start": "echo '启动'", "end": "echo '失败'" } }, "fabric": { "cryptodir": "/home/js/go/src/github.com/hyperledger/caliper/network/suyuan/crypto-config", "network": { "orderer": { "url": "grpc://localhost:7050", "mspid": "hf.chainhero.io", "msp": "/home/js/go/src/github.com/hyperledger/caliper/network/suyuan/crypto-config/ordererOrganizations/hf.chainhero.io/msp", "server-hostname": "orderer.hf.chainhero.io", "tls_cacerts": "/home/js/go/src/github.com/hyperledger/caliper/network/suyuan/crypto-config/ordererOrganizations/hf.chainhero.io/orderers/orderer.hf.chainhero.io/tls/ca.crt" }, "Org1ChainHero": { "name": "ChainHeroOrganization1", "mspid": "org1.hf.chainhero.io", "domain": "org1.hf.chainhero.io", "msp": "/home/js/go/src/github.com/hyperledger/caliper/network/suyuan/crypto-config/peerOrganizations/org1.hf.chainhero.io/msp", "peer1": { "requests": "grpcs://localhost:7051", "events": "grpcs://localhost:7053", "server-hostname": "peer0.org1.hf.chainhero.io", "tls_cacerts": "/home/js/go/src/github.com/hyperledger/caliper/network/suyuan/crypto-config/peerOrganizations/org1.hf.chainhero.io/peers/peer0.org1.hf.chainhero.io/tls/ca.crt" } } }, "channel": [{ "name": "chainhero", "deployed": true, "config": "/home/js/go/src/github.com/hyperledger/caliper/network/suyuan/artifacts/chainhero.channel.tx", "organizations": ["Org1ChainHero"] }, { "name": "token", "deployed": true, "config": "/home/js/go/src/github.com/hyperledger/caliper/network/suyuan/artifacts/token.channel.tx", "organizations": ["Org1ChainHero"] }], "chaincodes": [{ "id": "simple", "path": "contract/fabric/simple/go", "language": "golang", "version": "v0", "channel": "token", "installed":false, "instantiated":false }], "endorsement-policy": { "identities": [{ "role": { "name": "member", "mspId": "org1.hf.chainhero.io" } }, { "role": { "name": "admin", "mspId": "org1.hf.chainhero.io" } } ], "policy": { "2-of": [{ "signed-by": 0 }, { "signed-by": 1 }] }
},
"context": {
"open": "token",
"query": "token"
}
},
"info": {
"Version": "1.2.0",
"Size": "1 Orgs with 1 Peer",
"Orderer": "kafka",
"Distribution": "Single Host"
}
}
@skyhuihui You just use 1 org and 1peer, why do you use kafka?
For anyone else having issues with this, the solution is to NOT rename the orgs in the fabric network configuration file. I ran into the same issue because I had the following:
"fabric": {
...
"**player1**": {
"name": "Player1",
"mspid": "Player1MSP",
"domain": "player1.tfc.com",
"ca": {
"url": "https://localhost:7054",
"name": "ca-player1"
},
...
},
Renaming to the following worked:
"fabric": {
...
"**org1**": {
"name": "Player1",
"mspid": "Player1MSP",
"domain": "player1.tfc.com",
"ca": {
"url": "https://localhost:7054",
"name": "ca-player1"
},
...
},
As far as I can see, when the config is being processed it expects specifically all peers to start with peer and all organizations to start with org. See https://github.com/hyperledger/caliper/blob/252bb7395bda04d937f62afae4fd803b70d6cc50/packages/caliper-fabric/lib/e2eUtils.js#L328.
Hope this helps!