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

when using the tokengen CLI to try to generate chaincode package it fails #413

Open
davidkel opened this issue Oct 26, 2022 · 0 comments
Open

Comments

@davidkel
Copy link
Contributor

davidkel commented Oct 26, 2022

For developers who want to use the token-sdk they would want to install the tokengen cli and it installs fine using

go install github.com/hyperledger-labs/fabric-token-sdk/cmd/tokengen@latest

when attempting to generate the chaincode package containing public parameters using tokengen for example

tokengen gen dlog -a ~/testdata/token/crypto/default-testchannel-tns/auditor/auditors/peerOrganizations/Orgauditor.example.com/users/[email protected]/msp/ -i ~/testdata/token/crypto/default-testchannel-tns/idemix/ -o ./test --cc

it fails with the following error message

Error: failed creating chaincode package: error getting chaincode bytes: 'go list' failed with: no required module provides package github.com/hyperledger-labs/fabric-token-sdk/token/services/network/fabric/tcc/main: go.mod file not found in current directory or any parent directory; see 'go help modules': exit status 1

If I run it within my fabric-token-sdk repo then it creates a chaincode package with a name tcc.tar but on inspection of this package the params.go file has not been updated. The reason for this is due to what the replacer is looking for

outputting the names of the files sent to replacer we can see that
file.Path: /home/dave/github-mine/fabric-token-sdk/token/services/network/fabric/tcc/params.go
file.Name: src/github.com/hyperledger-labs/fabric-token-sdk/token/services/network/fabric/tcc/params.go

and the check in the code is looking for a suffix of "github.com/hyperledger-labs/fabric-token-sdk/token/tcc/params.go", but my repo doesn't follow that structure and if it had it might have worked but we don't want to impose the old GOPATH needs but then should it be using a source tree outside of the command ?

As the chaincode is specific to the token sdk (ie not provided by the developer of the token application), there needs to be someway a user (without having to checkout fabric-token-sdk) is able to generate a chaincode package without having to clone the token-sdk repo.

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

No branches or pull requests

1 participant