daml-on-fabric chaincode deployment fails if attempting to deploy to a fabric network running 2.0 or 2.0.0-beta
With Fabric main github repo moving to 2.0.0-beta, a number of go dependencies for chaincode that previously could be pulled from master are no longer in the github repo, leading to errors uploading that chaincode to new 2.0 versions. Namely, these are the shim, proto/peer and logging dependencies noted below in the release notes.
FAB-5177: The ccenv build image no longer includes the shim
The shim package and dependencies for go chaincode are no longer included in
the chaincode build environment. Chaincode packages that do not include their
own dependencies will no longer successfully build on the peer. We strongly
recommend that existing go chaincode be updated to vendor the
github.com/hyperledger/fabric-chaincode-go/shim package and its dependencies.
While there are many tools for managing vendored dependencies, we recommend
moving directly to go modules and vendoring with go mod vendor.
FAB-15366: Logger removed from chaincode shim
Chaincode that used the shim's NewLogger() will need to shift to a new
logging mechanism. Chaincode logging is intended to be the responsibility
of the application developer. As such it should be handled using tools and
libraries that make the most sense to the chaincode developer and the
application in general. Chaincode developers can forward STDOUT and STDERR
from the chaincode container to the peer container by setting
CORE_VM_DOCKER_ATTACHSTDOUT=true. While not recommended for production,
once enabled, each chaincode will receive its own logging channel and
STDOUT and STDERR will be integrated in the peers log on a per-line basis.
A production grade approach would be to run a log aggregation service and
forward your logs to the aggregation service.
Problem
daml-on-fabric chaincode deployment fails if attempting to deploy to a fabric network running
2.0
or2.0.0-beta
With Fabric main github repo moving to 2.0.0-beta, a number of go dependencies for chaincode that previously could be pulled from master are no longer in the github repo, leading to errors uploading that chaincode to new 2.0 versions. Namely, these are the shim, proto/peer and logging dependencies noted below in the release notes.
https://github.com/hyperledger/fabric/releases/tag/v2.0.0-beta
Steps to reproduce
(in one terminal window) 1) go to root of directory where you have daml-on-fabric repo checked out 2) Open file
.env
in vim or your text edit of choice and change these two lines to version:2.0.0-beta
https://github.com/hacera/daml-on-fabric/blob/6750ef7ca53b663ca4b030b38f657a2cf78e4d1b/.env#L1-L2 3)cd /src/test/fixture
4) Open filefabric.sh
in vim or your text edit of choice and change these two lines to version:2.0.0-beta
https://github.com/hacera/daml-on-fabric/blob/6750ef7ca53b663ca4b030b38f657a2cf78e4d1b/src/test/fixture/fabric.sh#L23-L24 5) ./restart_fabric.sh(in another terminal window - this provisions the chaincode to the network) 6) sbt "run --port 6865 --role provision"
Error