Problem in chaincode instantiation with distributed setup












1















I am working on Fabric version 1.2. Running a network with one orderer and one peer, both in same organisation, ORG1MSP. I followed this blog, but I am trying to run orderer and peer on different VMs.



Orderer IP: 192.168.1.5
Peer0 IP: 192.168.1.22


Orderer and CA containers were up on the first VM, and peer0, couchdb, cli on second VM. Peer0 was able to create channel, fetch channel configurations and join channel.



Now, I am trying to deploy the chaincode available in fabric/examples/chaincode/go/example02 path. I mounted the volume in all the containers as follows:



- /root/gopath/src/github.com/hyperledger/fabric/examples:/opt/gopath/src/github.com/hyperledger/fabric/examples


I run the commands from the CLI container. Install command:
CORE_PEER_ADDRESS=peer0.org1.example.com:7051 peer chaincode install -n example02 -p github.com/hyperledger/fabric/examples/chaincode/go/example02 -v v0



It shows the following log:



2018-11-13 11:13:34.112 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2018-11-13 11:13:34.112 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2018-11-13 11:13:34.336 UTC [chaincodeCmd] install -> INFO 003 Installed remotely response:<status:200 payload:"OK" >


Then, I try to instantiate the chaincode as follows:



root@fa36d48915d7:/opt/gopath/src/github.com/hyperledger/fabric# CORE_PEER_ADDRESS=peer0.org1.example.com:7051 peer chaincode instantiate -o 192.168.1.5:7050 -C mychannel -n example02 -v v0 -c '{"Args":["init","a","100","b","200"]}' -P "OR ('Org1MSP.member','Org2MSP.member')"
2018-11-13 11:21:46.383 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2018-11-13 11:21:46.383 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
Error: could not assemble transaction, err Proposal response was not successful, error code 500, msg failed to execute transaction 81b57fb4635092074d3585cec328e4c54f8f1d45028664795a56cfbc7f5a4c80: error starting container: error starting container: API error (400): OCI runtime create failed: container_linux.go:348: starting container process caused "exec: "chaincode": executable file not found in $PATH": unknown


Please provide the appropriate solution.










share|improve this question























  • where are you running this command in Peer container or in CLI

    – jaswanth
    Nov 15 '18 at 7:26











  • @jaswanth CLI container

    – Flair
    Nov 17 '18 at 5:33
















1















I am working on Fabric version 1.2. Running a network with one orderer and one peer, both in same organisation, ORG1MSP. I followed this blog, but I am trying to run orderer and peer on different VMs.



Orderer IP: 192.168.1.5
Peer0 IP: 192.168.1.22


Orderer and CA containers were up on the first VM, and peer0, couchdb, cli on second VM. Peer0 was able to create channel, fetch channel configurations and join channel.



Now, I am trying to deploy the chaincode available in fabric/examples/chaincode/go/example02 path. I mounted the volume in all the containers as follows:



- /root/gopath/src/github.com/hyperledger/fabric/examples:/opt/gopath/src/github.com/hyperledger/fabric/examples


I run the commands from the CLI container. Install command:
CORE_PEER_ADDRESS=peer0.org1.example.com:7051 peer chaincode install -n example02 -p github.com/hyperledger/fabric/examples/chaincode/go/example02 -v v0



It shows the following log:



2018-11-13 11:13:34.112 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2018-11-13 11:13:34.112 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2018-11-13 11:13:34.336 UTC [chaincodeCmd] install -> INFO 003 Installed remotely response:<status:200 payload:"OK" >


Then, I try to instantiate the chaincode as follows:



root@fa36d48915d7:/opt/gopath/src/github.com/hyperledger/fabric# CORE_PEER_ADDRESS=peer0.org1.example.com:7051 peer chaincode instantiate -o 192.168.1.5:7050 -C mychannel -n example02 -v v0 -c '{"Args":["init","a","100","b","200"]}' -P "OR ('Org1MSP.member','Org2MSP.member')"
2018-11-13 11:21:46.383 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2018-11-13 11:21:46.383 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
Error: could not assemble transaction, err Proposal response was not successful, error code 500, msg failed to execute transaction 81b57fb4635092074d3585cec328e4c54f8f1d45028664795a56cfbc7f5a4c80: error starting container: error starting container: API error (400): OCI runtime create failed: container_linux.go:348: starting container process caused "exec: "chaincode": executable file not found in $PATH": unknown


Please provide the appropriate solution.










share|improve this question























  • where are you running this command in Peer container or in CLI

    – jaswanth
    Nov 15 '18 at 7:26











  • @jaswanth CLI container

    – Flair
    Nov 17 '18 at 5:33














1












1








1








I am working on Fabric version 1.2. Running a network with one orderer and one peer, both in same organisation, ORG1MSP. I followed this blog, but I am trying to run orderer and peer on different VMs.



Orderer IP: 192.168.1.5
Peer0 IP: 192.168.1.22


Orderer and CA containers were up on the first VM, and peer0, couchdb, cli on second VM. Peer0 was able to create channel, fetch channel configurations and join channel.



Now, I am trying to deploy the chaincode available in fabric/examples/chaincode/go/example02 path. I mounted the volume in all the containers as follows:



- /root/gopath/src/github.com/hyperledger/fabric/examples:/opt/gopath/src/github.com/hyperledger/fabric/examples


I run the commands from the CLI container. Install command:
CORE_PEER_ADDRESS=peer0.org1.example.com:7051 peer chaincode install -n example02 -p github.com/hyperledger/fabric/examples/chaincode/go/example02 -v v0



It shows the following log:



2018-11-13 11:13:34.112 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2018-11-13 11:13:34.112 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2018-11-13 11:13:34.336 UTC [chaincodeCmd] install -> INFO 003 Installed remotely response:<status:200 payload:"OK" >


Then, I try to instantiate the chaincode as follows:



root@fa36d48915d7:/opt/gopath/src/github.com/hyperledger/fabric# CORE_PEER_ADDRESS=peer0.org1.example.com:7051 peer chaincode instantiate -o 192.168.1.5:7050 -C mychannel -n example02 -v v0 -c '{"Args":["init","a","100","b","200"]}' -P "OR ('Org1MSP.member','Org2MSP.member')"
2018-11-13 11:21:46.383 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2018-11-13 11:21:46.383 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
Error: could not assemble transaction, err Proposal response was not successful, error code 500, msg failed to execute transaction 81b57fb4635092074d3585cec328e4c54f8f1d45028664795a56cfbc7f5a4c80: error starting container: error starting container: API error (400): OCI runtime create failed: container_linux.go:348: starting container process caused "exec: "chaincode": executable file not found in $PATH": unknown


Please provide the appropriate solution.










share|improve this question














I am working on Fabric version 1.2. Running a network with one orderer and one peer, both in same organisation, ORG1MSP. I followed this blog, but I am trying to run orderer and peer on different VMs.



Orderer IP: 192.168.1.5
Peer0 IP: 192.168.1.22


Orderer and CA containers were up on the first VM, and peer0, couchdb, cli on second VM. Peer0 was able to create channel, fetch channel configurations and join channel.



Now, I am trying to deploy the chaincode available in fabric/examples/chaincode/go/example02 path. I mounted the volume in all the containers as follows:



- /root/gopath/src/github.com/hyperledger/fabric/examples:/opt/gopath/src/github.com/hyperledger/fabric/examples


I run the commands from the CLI container. Install command:
CORE_PEER_ADDRESS=peer0.org1.example.com:7051 peer chaincode install -n example02 -p github.com/hyperledger/fabric/examples/chaincode/go/example02 -v v0



It shows the following log:



2018-11-13 11:13:34.112 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2018-11-13 11:13:34.112 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
2018-11-13 11:13:34.336 UTC [chaincodeCmd] install -> INFO 003 Installed remotely response:<status:200 payload:"OK" >


Then, I try to instantiate the chaincode as follows:



root@fa36d48915d7:/opt/gopath/src/github.com/hyperledger/fabric# CORE_PEER_ADDRESS=peer0.org1.example.com:7051 peer chaincode instantiate -o 192.168.1.5:7050 -C mychannel -n example02 -v v0 -c '{"Args":["init","a","100","b","200"]}' -P "OR ('Org1MSP.member','Org2MSP.member')"
2018-11-13 11:21:46.383 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 001 Using default escc
2018-11-13 11:21:46.383 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 002 Using default vscc
Error: could not assemble transaction, err Proposal response was not successful, error code 500, msg failed to execute transaction 81b57fb4635092074d3585cec328e4c54f8f1d45028664795a56cfbc7f5a4c80: error starting container: error starting container: API error (400): OCI runtime create failed: container_linux.go:348: starting container process caused "exec: "chaincode": executable file not found in $PATH": unknown


Please provide the appropriate solution.







hyperledger-fabric hyperledger-fabric-ca






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 13 '18 at 13:53









FlairFlair

154




154













  • where are you running this command in Peer container or in CLI

    – jaswanth
    Nov 15 '18 at 7:26











  • @jaswanth CLI container

    – Flair
    Nov 17 '18 at 5:33



















  • where are you running this command in Peer container or in CLI

    – jaswanth
    Nov 15 '18 at 7:26











  • @jaswanth CLI container

    – Flair
    Nov 17 '18 at 5:33

















where are you running this command in Peer container or in CLI

– jaswanth
Nov 15 '18 at 7:26





where are you running this command in Peer container or in CLI

– jaswanth
Nov 15 '18 at 7:26













@jaswanth CLI container

– Flair
Nov 17 '18 at 5:33





@jaswanth CLI container

– Flair
Nov 17 '18 at 5:33












1 Answer
1






active

oldest

votes


















2














I had a similar issue. I found that if the name of the package is not main, in that case, this error was generated.



Check the example02.go file, first line is the package name.
Replace the package name to main, if it is something else, and try install again.



Install and initiate with -v v1



CORE_PEER_ADDRESS=peer0.org1.example.com:7051 peer chaincode install -n example02 -p github.com/hyperledger/fabric/examples/chaincode/go/example02 -v v1



CORE_PEER_ADDRESS=peer0.org1.example.com:7051 peer chaincode instantiate -o 192.168.1.5:7050 -C mychannel -n example02 -v v1 -c '{"Args":["init","a","100","b","200"]}' -P "OR ('Org1MSP.member','Org2MSP.member')"






share|improve this answer
























  • You are right, it did work out for me in other scenario. But when orderer and peer are on different VMs, it continued to give me same error..

    – Flair
    Nov 17 '18 at 5:31











  • In my case too the orderer and peer are on different VMs, and the problem was solved by the above solution. Perhaps it is some other issue in your case.

    – viki
    Dec 3 '18 at 7:59











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53282568%2fproblem-in-chaincode-instantiation-with-distributed-setup%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














I had a similar issue. I found that if the name of the package is not main, in that case, this error was generated.



Check the example02.go file, first line is the package name.
Replace the package name to main, if it is something else, and try install again.



Install and initiate with -v v1



CORE_PEER_ADDRESS=peer0.org1.example.com:7051 peer chaincode install -n example02 -p github.com/hyperledger/fabric/examples/chaincode/go/example02 -v v1



CORE_PEER_ADDRESS=peer0.org1.example.com:7051 peer chaincode instantiate -o 192.168.1.5:7050 -C mychannel -n example02 -v v1 -c '{"Args":["init","a","100","b","200"]}' -P "OR ('Org1MSP.member','Org2MSP.member')"






share|improve this answer
























  • You are right, it did work out for me in other scenario. But when orderer and peer are on different VMs, it continued to give me same error..

    – Flair
    Nov 17 '18 at 5:31











  • In my case too the orderer and peer are on different VMs, and the problem was solved by the above solution. Perhaps it is some other issue in your case.

    – viki
    Dec 3 '18 at 7:59
















2














I had a similar issue. I found that if the name of the package is not main, in that case, this error was generated.



Check the example02.go file, first line is the package name.
Replace the package name to main, if it is something else, and try install again.



Install and initiate with -v v1



CORE_PEER_ADDRESS=peer0.org1.example.com:7051 peer chaincode install -n example02 -p github.com/hyperledger/fabric/examples/chaincode/go/example02 -v v1



CORE_PEER_ADDRESS=peer0.org1.example.com:7051 peer chaincode instantiate -o 192.168.1.5:7050 -C mychannel -n example02 -v v1 -c '{"Args":["init","a","100","b","200"]}' -P "OR ('Org1MSP.member','Org2MSP.member')"






share|improve this answer
























  • You are right, it did work out for me in other scenario. But when orderer and peer are on different VMs, it continued to give me same error..

    – Flair
    Nov 17 '18 at 5:31











  • In my case too the orderer and peer are on different VMs, and the problem was solved by the above solution. Perhaps it is some other issue in your case.

    – viki
    Dec 3 '18 at 7:59














2












2








2







I had a similar issue. I found that if the name of the package is not main, in that case, this error was generated.



Check the example02.go file, first line is the package name.
Replace the package name to main, if it is something else, and try install again.



Install and initiate with -v v1



CORE_PEER_ADDRESS=peer0.org1.example.com:7051 peer chaincode install -n example02 -p github.com/hyperledger/fabric/examples/chaincode/go/example02 -v v1



CORE_PEER_ADDRESS=peer0.org1.example.com:7051 peer chaincode instantiate -o 192.168.1.5:7050 -C mychannel -n example02 -v v1 -c '{"Args":["init","a","100","b","200"]}' -P "OR ('Org1MSP.member','Org2MSP.member')"






share|improve this answer













I had a similar issue. I found that if the name of the package is not main, in that case, this error was generated.



Check the example02.go file, first line is the package name.
Replace the package name to main, if it is something else, and try install again.



Install and initiate with -v v1



CORE_PEER_ADDRESS=peer0.org1.example.com:7051 peer chaincode install -n example02 -p github.com/hyperledger/fabric/examples/chaincode/go/example02 -v v1



CORE_PEER_ADDRESS=peer0.org1.example.com:7051 peer chaincode instantiate -o 192.168.1.5:7050 -C mychannel -n example02 -v v1 -c '{"Args":["init","a","100","b","200"]}' -P "OR ('Org1MSP.member','Org2MSP.member')"







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 15 '18 at 2:18









vikiviki

58116




58116













  • You are right, it did work out for me in other scenario. But when orderer and peer are on different VMs, it continued to give me same error..

    – Flair
    Nov 17 '18 at 5:31











  • In my case too the orderer and peer are on different VMs, and the problem was solved by the above solution. Perhaps it is some other issue in your case.

    – viki
    Dec 3 '18 at 7:59



















  • You are right, it did work out for me in other scenario. But when orderer and peer are on different VMs, it continued to give me same error..

    – Flair
    Nov 17 '18 at 5:31











  • In my case too the orderer and peer are on different VMs, and the problem was solved by the above solution. Perhaps it is some other issue in your case.

    – viki
    Dec 3 '18 at 7:59

















You are right, it did work out for me in other scenario. But when orderer and peer are on different VMs, it continued to give me same error..

– Flair
Nov 17 '18 at 5:31





You are right, it did work out for me in other scenario. But when orderer and peer are on different VMs, it continued to give me same error..

– Flair
Nov 17 '18 at 5:31













In my case too the orderer and peer are on different VMs, and the problem was solved by the above solution. Perhaps it is some other issue in your case.

– viki
Dec 3 '18 at 7:59





In my case too the orderer and peer are on different VMs, and the problem was solved by the above solution. Perhaps it is some other issue in your case.

– viki
Dec 3 '18 at 7:59


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53282568%2fproblem-in-chaincode-instantiation-with-distributed-setup%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Full-time equivalent

Bicuculline

What is this shape that looks like a rectangle with rounded ends called?