Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

awjh-ibm
Copy link
Contributor

Introduces a Commercial Paper Go contract to the existing Java and Node examples.

Copy link
Contributor

@lehors lehors left a 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.

**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"
Copy link
Contributor

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"

Copy link
Contributor Author

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')"
Copy link
Contributor

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. :-(

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

Copy link
Contributor

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).

@mbwhite
Copy link
Member

mbwhite commented Dec 16, 2019

@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. :-)

@mbwhite
Copy link
Member

mbwhite commented Dec 16, 2019

@awjh-ibm if you rebase then the Javascript/Typescript tests will (should!) be ok.

Signed-off-by: Andrew Hurt <andrew.hurt1@ibm.com>
@@ -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\"
Copy link
Contributor

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...

@lehors
Copy link
Contributor

lehors commented Dec 16, 2019

@awjh-ibm if you rebase then the Javascript/Typescript tests will (should!) be ok.

Sorry, I don't understand this comment. What rebase are you talking about?

@lehors
Copy link
Contributor

lehors commented Dec 16, 2019

@awjh-ibm if you rebase then the Javascript/Typescript tests will (should!) be ok.

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!!!! :-)

@awjh-ibm
Copy link
Contributor Author

Replaced by #102

@awjh-ibm awjh-ibm closed this Jan 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants