{"action":"created","issue":{"url":"https://api.github.com/repos/securekey/fabric-examples/issues/18","repository_url":"https://api.github.com/repos/securekey/fabric-examples","labels_url":"https://api.github.com/repos/securekey/fabric-examples/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/securekey/fabric-examples/issues/18/comments","events_url":"https://api.github.com/repos/securekey/fabric-examples/issues/18/events","html_url":"https://github.com/securekey/fabric-examples/issues/18","id":395948159,"node_id":"MDU6SXNzdWUzOTU5NDgxNTk=","number":18,"title":"Error when attempting to instantiate chaincode: cannot find package","user":{"login":"Shirikatsu","id":4716816,"node_id":"MDQ6VXNlcjQ3MTY4MTY=","avatar_url":"https://avatars2.githubusercontent.com/u/4716816?v=4","gravatar_id":"","url":"https://api.github.com/users/Shirikatsu","html_url":"https://github.com/Shirikatsu","followers_url":"https://api.github.com/users/Shirikatsu/followers","following_url":"https://api.github.com/users/Shirikatsu/following{/other_user}","gists_url":"https://api.github.com/users/Shirikatsu/gists{/gist_id}","starred_url":"https://api.github.com/users/Shirikatsu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shirikatsu/subscriptions","organizations_url":"https://api.github.com/users/Shirikatsu/orgs","repos_url":"https://api.github.com/users/Shirikatsu/repos","events_url":"https://api.github.com/users/Shirikatsu/events{/privacy}","received_events_url":"https://api.github.com/users/Shirikatsu/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2019-01-04T14:40:35Z","updated_at":"2019-01-04T16:53:57Z","closed_at":"2019-01-04T16:53:57Z","author_association":"NONE","body":"I am using the example network to attempt to deploy custom chaincode:\r\n\r\n```bash\r\n$ make example-network\r\n```\r\n\r\nand installing, in this instance, EVM chaincode:\r\n\r\n```bash\r\n$ go run fabric-cli.go chaincode install --ccp=github.com/hyperledger/fabric-chaincode-evm/evmcc --ccid=EvmCC --v v0 --gopath /home/me/go --config ../../test/fixtures/config/config_test_local.yaml\r\nInstalling chaincode EvmCC on org[org1] peers:\r\n-- localhost:7051\r\n-- localhost:7151\r\n...successfuly installed chaincode EvmCC.v0 on peer localhost:7151.\r\n...successfuly installed chaincode EvmCC.v0 on peer localhost:7051.\r\nInstalling chaincode EvmCC on org[org2] peers:\r\n-- localhost:8051\r\n-- localhost:9051\r\n...successfuly installed chaincode EvmCC.v0 on peer localhost:9051.\r\n...successfuly installed chaincode EvmCC.v0 on peer localhost:8051.\r\n```\r\n\r\nthen instantiating results in an error that references unrecognised imports:\r\n```bash\r\ngo run fabric-cli.go chaincode instantiate --cid orgchannel --ccp=github.com/hyperledger/fabric-chaincode-evm/evmcc --ccid=EvmCC --v v0 --args '{\"Args\":[]}' --policy \"AND('Org1MSP.member','Org2MSP.member')\" --config ../../test/fixtures/config/config_test_local.yaml\r\n[fabriccli] 2019/01/04 11:04:20 UTC - chaincode.glob..func4 -> ERRO Error while running instantiateAction: error instantiating chaincode: sending deploy transaction proposal failed: Transaction processing for endorser [localhost:7051]: Chaincode status Code: (500) UNKNOWN. Description: error starting container: error starting container: Failed to generate platform-specific docker build: Error returned from build: 1 \"chaincode/input/src/github.com/hyperledger/fabric-chaincode-evm/evmcc/evmcc.go:15:2: cannot find package \"github.com/golang/protobuf/proto\" in any of:\r\n\t/opt/go/src/github.com/golang/protobuf/proto (from $GOROOT)\r\n\t/chaincode/input/src/github.com/golang/protobuf/proto (from $GOPATH)\r\n\t/opt/gopath/src/github.com/golang/protobuf/proto\r\nchaincode/input/src/github.com/hyperledger/fabric-chaincode-evm/evmcc/evmcc.go:16:2: cannot find package \"github.com/hyperledger/burrow/account\" in any of:\r\n\t/opt/go/src/github.com/hyperledger/burrow/account (from $GOROOT)\r\n\t/chaincode/input/src/github.com/hyperledger/burrow/account (from $GOPATH)\r\n\t/opt/gopath/src/github.com/hyperledger/burrow/account\r\nchaincode/input/src/github.com/hyperledger/fabric-chaincode-evm/evmcc/evmcc.go:17:2: cannot find package \"github.com/hyperledger/burrow/binary\" in any of:\r\n\t/opt/go/src/github.com/hyperledger/burrow/binary (from $GOROOT)\r\n\t/chaincode/input/src/github.com/hyperledger/burrow/binary (from $GOPATH)\r\n\t/opt/gopath/src/github.com/hyperledger/burrow/binary\r\nchaincode/input/src/github.com/hyperledger/fabric-chaincode-evm/evmcc/evmcc.go:18:2: cannot find package \"github.com/hyperledger/burrow/execution/evm\" in any of:\r\n\t/opt/go/src/github.com/hyperledger/burrow/execution/evm (from $GOROOT)\r\n\t/chaincode/input/src/github.com/hyperledger/burrow/execution/evm (from $GOPATH)\r\n\t/opt/gopath/src/github.com/hyperledger/burrow/execution/evm\r\nchaincode/input/src/github.com/hyperledger/fabric-chaincode-evm/evmcc/evmcc.go:19:2: cannot find package \"github.com/hyperledger/burrow/logging\" in any of:\r\n\t/opt/go/src/github.com/hyperledger/burrow/logging (from $GOROOT)\r\n\t/chaincode/input/src/github.com/hyperledger/burrow/logging (from $GOPATH)\r\n\t/opt/gopath/src/github.com/hyperledger/burrow/logging\r\nchaincode/input/src/github.com/hyperledger/fabric-chaincode-evm/evmcc/evmcc.go:20:2: cannot find package \"github.com/hyperledger/fabric-chaincode-evm/event\" in any of:\r\n\t/opt/go/src/github.com/hyperledger/fabric-chaincode-evm/event (from $GOROOT)\r\n\t/chaincode/input/src/github.com/hyperledger/fabric-chaincode-evm/event (from $GOPATH)\r\n\t/opt/gopath/src/github.com/hyperledger/fabric-chaincode-evm/event\r\nchaincode/input/src/github.com/hyperledger/fabric-chaincode-evm/evmcc/evmcc.go:21:2: cannot find package \"github.com/hyperledger/fabric-chaincode-evm/statemanager\" in any of:\r\n\t/opt/go/src/github.com/hyperledger/fabric-chaincode-evm/statemanager (from $GOROOT)\r\n\t/chaincode/input/src/github.com/hyperledger/fabric-chaincode-evm/statemanager (from $GOPATH)\r\n\t/opt/gopath/src/github.com/hyperledger/fabric-chaincode-evm/statemanager\r\nchaincode/input/src/github.com/hyperledger/fabric-chaincode-evm/evmcc/evmcc.go:26:2: cannot find package \"golang.org/x/crypto/sha3\" in any of:\r\n\t/opt/go/src/golang.org/x/crypto/sha3 (from $GOROOT)\r\n\t/chaincode/input/src/golang.org/x/crypto/sha3 (from $GOPATH)\r\n\t/opt/gopath/src/golang.org/x/crypto/sha3\r\n\"\r\n```\r\n\r\nAs a test I included an extra import to the successfully instantiating `example_cc.go` code (and an extra omitted line to silence the unused import error):\r\n\r\n```golang\r\n...\r\nimport (\r\n\t\"fmt\"\r\n\t\"strconv\"\r\n\r\n\t\"github.com/hyperledger/fabric/core/chaincode/shim\"\r\n\tpb \"github.com/hyperledger/fabric/protos/peer\"\r\n\t\"github.com/golang/protobuf/proto\" // The added import\r\n)\r\n...\r\n```\r\n\r\nand instantiating this failed with:\r\n```bash\r\n$ go run fabric-cli.go chaincode instantiate --cid orgchannel --ccp=github.com/securekey/example_cc --ccid ExampleCC --v v0 --args '{\"Args\":[\"A\",\"1\",\"B\",\"2\"]}' --policy \"AND('Org1MSP.member','Org2MSP.member')\" --config ../../test/fixtures/config/config_test_local.yaml\r\n [fabriccli] 2019/01/04 14:20:43 UTC - chaincode.glob..func4 -> ERRO Error while running instantiateAction: error instantiating chaincode: sending deploy transaction proposal failed: Transaction processing for endorser [localhost:7051]: Chaincode status Code: (500) UNKNOWN. Description: error starting container: error starting container: Failed to generate platform-specific docker build: Error returned from build: 2 \"# github.com/securekey/example_cc\r\nchaincode/input/src/github.com/securekey/example_cc/example_cc.go:38:2: undefined: proto\r\n\"\r\n```\r\n\r\n\r\nIt seems as though other external imports are somehow not found. Is this due to the fact that they are not installed on the peer and as such only Hyperledger libraries are usable without manual installation? How would one install dependencies of chaincode like this?"},"comment":{"url":"https://api.github.com/repos/securekey/fabric-examples/issues/comments/451501169","html_url":"https://github.com/securekey/fabric-examples/issues/18#issuecomment-451501169","issue_url":"https://api.github.com/repos/securekey/fabric-examples/issues/18","id":451501169,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MTUwMTE2OQ==","user":{"login":"Shirikatsu","id":4716816,"node_id":"MDQ6VXNlcjQ3MTY4MTY=","avatar_url":"https://avatars2.githubusercontent.com/u/4716816?v=4","gravatar_id":"","url":"https://api.github.com/users/Shirikatsu","html_url":"https://github.com/Shirikatsu","followers_url":"https://api.github.com/users/Shirikatsu/followers","following_url":"https://api.github.com/users/Shirikatsu/following{/other_user}","gists_url":"https://api.github.com/users/Shirikatsu/gists{/gist_id}","starred_url":"https://api.github.com/users/Shirikatsu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shirikatsu/subscriptions","organizations_url":"https://api.github.com/users/Shirikatsu/orgs","repos_url":"https://api.github.com/users/Shirikatsu/repos","events_url":"https://api.github.com/users/Shirikatsu/events{/privacy}","received_events_url":"https://api.github.com/users/Shirikatsu/received_events","type":"User","site_admin":false},"created_at":"2019-01-04T16:53:57Z","updated_at":"2019-01-04T16:53:57Z","author_association":"NONE","body":"Thanks for educating me on some go dependency stuff and troubleshooting my issue :) It works, much appreciated."}}
{"actor":{"display_login":"Shirikatsu"}}