-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FAB-17140] update to use go chaincode #83
Conversation
492afce
to
2d01728
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a small error in the README but as noted below trying to run this exhibited the fact that this sample also needs to be updated (independently) to use the new cc lifecycle.
commercial-paper/README.md
Outdated
**For a Go Contract:** | ||
|
||
``` | ||
docker exec cliMagnetoCorp bash -c "cd /opt/gopath/src/github.com/hyperledger/fabric-samples/commercial-paper/organization/magnetocorp/contract-go GO111MODULE=on GOCACHE=on go mod vendor" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is missing a semi colon after the cd command, and GOCACHE=on didn't work for me - I got: build cache is required, but could not be located: GOCACHE is not an absolute path.
The following seems to work fine:
docker exec cliMagnetoCorp bash -c "cd /opt/gopath/src/github.com/hyperledger/fabric-samples/commercial-paper/organization/magnetocorp/contract-go; GO111MODULE=on go mod vendor"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing this out
``` | ||
docker exec cliMagnetoCorp bash -c "cd /opt/gopath/src/github.com/hyperledger/fabric-samples/commercial-paper/organization/magnetocorp/contract-go GO111MODULE=on GOCACHE=on go mod vendor" | ||
docker exec cliMagnetoCorp peer chaincode install -n papercontract -v 0 -p github.com/hyperledger/fabric-samples/commercial-paper/organization/magnetocorp/contract-go -l golang | ||
docker exec cliMagnetoCorp peer chaincode instantiate -n papercontract -v 0 -l golang -c '{"Args":["org.papernet.commercialpaper:instantiate"]}' -C mychannel -P "AND ('Org1MSP.member')" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This gave me:
Error: could not assemble transaction, err proposal response was not successful, error code 500, msg Channel 'mychannel' has been migrated to the new lifecycle, LSCC is now read-only
which made me realize that basic-network was upgraded to use the new cc lifecycle but commercial-paper (and maybe others) haven't. :-(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lehors how did you fixed this issue? I got the same issue when init my new chaincode on test-network
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@trnhgquan These instructions have changed. When I use the latest README with Fabric 2.1 everything works (modulo some simple doc error I'm going to fix).
@lehors FYI I was looking at the Commercial Paper example on friday PM to check it worked - and also to confirm updates to the new lifecycle. :-) |
@awjh-ibm if you rebase then the Javascript/Typescript tests will (should!) be ok. |
Signed-off-by: Andrew Hurt <andrew.hurt1@ibm.com>
2d01728
to
84a966c
Compare
@@ -26,8 +26,13 @@ echo " | |||
docker exec cliMagnetoCorp peer chaincode install -n papercontract -v 0 -p /opt/gopath/src/github.com/contract-java -l java | |||
docker exec cliMagnetoCorp peer chaincode instantiate -n papercontract -v 0 -l java -c '{\"Args\":[\"org.papernet.commercialpaper:instantiate\"]}' -C mychannel -P \"AND ('Org1MSP.member')\" | |||
|
|||
Go Contract: | |||
|
|||
docker exec cliMagnetoCorp bash -c \"cd /opt/gopath/src/github.com/hyperledger/fabric-samples/commercial-paper/organization/magnetocorp/contract-go GO111MODULE=on GOCACHE=on go mod vendor\" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to fix that comment to match the updated README...
Sorry, I don't understand this comment. What rebase are you talking about? |
oh! you're talking about the CI tests that kept failing, aren't you? Thank you!!!! :-) |
Replaced by #102 |
Introduces a Commercial Paper Go contract to the existing Java and Node examples.