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

Fabric samples compatibility #285

Open
dzikowski opened this issue Feb 10, 2022 · 1 comment
Open

Fabric samples compatibility #285

dzikowski opened this issue Feb 10, 2022 · 1 comment

Comments

@dzikowski
Copy link
Contributor

This is a general issue to address compatibility with Fabric samples (https://github.com/hyperledger/fabric-samples).

@AbhishekBhargav99 in fablo-io/fablo-rest#38:

I want to use wallet and gateway like described in asset-transfer-basic example can I do that in fablo setup and the directory structures are different. Can u point to some example if it is possible

@jerry-98 in #284 (comment):

I was using rest apis but want to use gateway and manage identities as described in basic-asset-transfer
I want to create my own apis and call various gateway and invocation features like in the assete-tranfer examples. The folder structures of fablo and the hf test-network are different. Can you help me with the same for creating wallet, paths, ccps, caclient etc as metioned in asset-transfer application-javascript so that I can create my own wallet and identities and utilise the fablo network beneath it to create my own apis.

TL;DR

Fablo does not support Fabric samples and has a different directory structure, and probably it will not change.

But why

Fablo is created with a slightly different philosophy. It offers an easy way to start a running network. But for now, in order to modify the network, you need to destroy it and recreate. If you want to update a running network, you need to make use of generated files in fablo-target. You can do it, but in this case you should probably stop using main fablo script since on recreate and prune Fablo erases that directory and may destroy your changes.

This approach might change in the future and we will eventually support updating the network, but this is not present in our current schedule. Too much work for now, to be honest. If you have an idea how to approach it and you have some time, feel free to contribute 🙂

Second thing is, we keep different directory structure than in Fabric samples. And this structure will change in future releases of Fablo. For instance we want to make a clear separation among organizations. This is why we don't want to "mimic" other conventions for directory structure. Because we know we will change it in near future.

What you can do

Fablo gives you all scripts, certs, some connection profiles and other files required to run the network in fablo-target directory. And it gives you a running network with cli containers started as well. I suggest you to have a look at those files and update them for your needs.

Some tips:

  • You can use generated connection profiles to use it with Node.js SDK (connection profiles will include proper certs as well)
  • You can look for instance at expect-invoke-cli.sh and expect-invoke-cli-tls.sh files to find out how to invoke chaincodes with cli
  • You can have a look at commands-generated.sh and related scripts to discover how to modify running network

Sorry, but we don't have a quick recipe how to be compatible with Fabric samples. You just need to make some research and find out, which files should be used by Node.js SDK and what changes are required. If you want to keep Fablo support, you might consider modifying files from fablo-target by a post-generate hook.

If you will manage it, feel free to post here your findings. Other people might find it useful 🙂 Thanks for your comments!

@jerry-98
Copy link

I am new to Hyperledger fabric and come from javascript background so will not be able to contribue much on that side. Thanks btw

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

2 participants