2

I write a chaincode in golang 1.19 and want to run on a fabric network, but when instantiate it error:

Error: could not assemble transaction, err proposal response was not successful, error code 500, msg error starting container: error starting container: Failed to generate platform-specific docker build: Error returned from build: 1 "chaincode/input/src/github.com/chaincode/lattice/vendor/golang.org/x/net/http2/transport.go:19:2: cannot find package "io/fs" in any of:
        /chaincode/input/src/github.com/chaincode/lattice/vendor/io/fs (vendor tree)
        /opt/go/src/io/fs (from $GOROOT)
        /chaincode/input/src/io/fs (from $GOPATH)
        /opt/gopath/src/io/fs
"

I try to mount folder of golang 1.19 to replace golang in cli container, but it error when byfn.sh up:

Error: error getting chaincode code mycc: error getting chaincode package bytes: Error obtaining imports: command <go list -f {{ join .Imports "\n"}} github.com/chaincode/chaincode_example02/go/>: failed with error: "exit status 1"
no required module provides package github.com/chaincode/chaincode_example02/go: go.mod file not found in current directory or any parent directory; see 'go help modules'

!!!!!!!!!!!!!!! Chaincode installation on peer0.org1 has failed !!!!!!!!!!!!!!!!
========= ERROR !!! FAILED to execute End-2-End Scenario ===========

ERROR !!!! Test failed

I want to know how to solve this problem. Do I have to rewrite chaincode in the same golang version?

npcxh
  • 19
  • 2

0 Answers0