-1
  • I have created chain code package

  • Then I have installed ccpack.out
    peer chaincode install ccpack.out

  • when I instantiate that time I got

Error:could not assemble transaction, err proposal response was not successful, error code 500, msg chaincode registration failed: container exited with 1

CLI query:

peer chaincode instantiate -o orderer.example.com:7050 -C logistic -n tradecc -l node -v 0 -c '{"Args":[]}' -P 'AND('Org1MSP.member','Org2MSP.member')'

can any one please tell me packaged chaincode instantiate process

Mahesh Waghmare
  • 726
  • 9
  • 27
iamve7254
  • 11
  • 1
  • 5
  • You are giving to the script a name with the option -n, the name is tradecc. Do you have the contract tradecc and did you map the folder in which the contract is placed into the cli? – Riki95 Nov 25 '19 at 14:11
  • yes i have mapped . – iamve7254 Nov 25 '19 at 14:31
  • More logs would help. For instance, the chaincode container logs if the chaincode was launched and the logs from the peer (you can even set `FABRIC_LOGGING_SPEC=DEBUG`, `CORE_CHAINCODE_LOGGING_LEVEL=DEBUG` and/or `CORE_VM_DOCKER_ATTACHSTDOUT=true` in the peer). – kekomal Nov 25 '19 at 14:52
  • with out instantiate the chaincode how can i check the chaincode logs ?? @kekomal – iamve7254 Nov 26 '19 at 05:14
  • Sometimes the chaincode container dies just after being launched, so you can still inspect its logs. When the chaincode has not even been launched (probably your case) `CORE_VM_DOCKER_ATTACHSTDOUT=true` in the peer improves the related logs. Anyway, the client response is not enough to discern your problem. The peer and the orderer logs are useful, too. I experienced a similar problem once caused by the peer and the chaincode containers not seeing each other through the configured IP (the host was not able to address its own public IP), but that's not probably your case. – kekomal Nov 26 '19 at 07:54
  • thans @kekomal ,@RicNtt – iamve7254 Nov 27 '19 at 05:18

1 Answers1

0

finally i got solution from this doc

actually i have installed onely one peer and i have instantiate my all peers so i got Error:could not assemble transaction, err proposal response was not successful, error code 500, msg chaincode registration failed: container exited with 1

SOLUTON: ########## chaincode package command #########

 docker exec cli peer chaincode package -n tradecc -l node -p /opt/gopath/src/github.com/chaincode/`logistic`1 -v 0 -s -S ccpack.out

#### installing chaincode on peer0.org1.example.com #########

docker exec -e CORE_PEER_LOCALMSPID=Org1MSP -e CORE_PEER_ADDRESS=peer0.org1.example.com:7051 -e CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp -e CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt cli peer chaincode install ccpack.out -l node

###### installing chaincode on peer1.org1.example.com #######

docker exec -e CORE_PEER_LOCALMSPID=Org1MSP -e CORE_PEER_ADDRESS=peer1.org1.example.com:8051 -e CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp -e CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt cli peer chaincode install ccpack.out -l node

####### installing chaincode on peer0.org2.example.com ##########

docker exec -e CORE_PEER_LOCALMSPID=Org2MSP -e CORE_PEER_ADDRESS=peer0.org2.example.com:9051 -e CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp -e CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt cli peer chaincode install ccpack.out -l node

###### installing chaincode on peer1.org2.example.com #######

docker exec -e CORE_PEER_LOCALMSPID=Org2MSP -e CORE_PEER_ADDRESS=peer1.org2.example.com:10051 -e CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp -e CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt cli peer chaincode install ccpack.out -l node

#### Instantiating smart contract on mychannel' #####

docker exec -e CORE_PEER_LOCALMSPID=Org1MSP -e CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp cli peer chaincode instantiate -o orderer.example.com:7050 -C logistic -n tradecc -l node -v 0 -c '{"Args":[]}' -P 'AND('\''Org1MSP.member'\'','\''Org2MSP.member'\'')' --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem --peerAddresses peer0.org1.example.com:7051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
# invoke smart contract on mychannel
docker exec -e CORE_PEER_LOCALMSPID=Org1MSP -e CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp cli peer chaincode invoke -o orderer.example.com:7050 -C logistic -n tradecc -c '{"function":"invoke","Args":["{\"trade\":{\"Initledger\":{\"exporterName\":\"ex-raiii\",\"exportersBankName\":\"sbi\",\"exportersAccountBalance\":\"100000\",\"importerName\":\"im-ieekfvnor\",\"importersBankName\":\"kotak\",\"importersAccountBalance\":\"200000\",\"carrierName\":\"foredsty\",\"regulatorName\":\"typesgmdslcdd r-eg\"},\"flag\":\"initLedger\",\"tradeId\":\"000000100\"}}"]}' --waitForEvent --tls --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem --peerAddresses peer0.org1.example.com:7051 --peerAddresses peer1.org1.example.com:8051 --peerAddresses peer0.org2.example.com:9051 --peerAddresses peer1.org2.example.com:10051 --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt --tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/ca.crt
iamve7254
  • 11
  • 1
  • 5
  • i got solution from this doc https://hyperledger-fabric.readthedocs.io/en/release-1.4/chaincode4noah.html – iamve7254 Nov 27 '19 at 05:21
  • Of course, the chaincode must be installed in all the endorser peers belonging to organizations added to the channel in which the chaincode is going to be instantiated. Impossible to guess from the information provided, though. Many causes could have caused the chaincode container not being started and the client error message would have been exactly the same. – kekomal Nov 27 '19 at 07:45