hyperledger-labs / fablo

Fablo is a simple tool to generate the Hyperledger Fabric blockchain network and run it on Docker. It supports RAFT and solo consensus protocols, multiple organizations and channels, chaincode installation and upgrade.
Apache License 2.0
194 stars 72 forks source link

Fabric samples compatibility #285

Open dzikowski opened 2 years ago

dzikowski commented 2 years ago

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

@AbhishekBhargav99 in https://github.com/softwaremill/fablo-rest/issues/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 https://github.com/hyperledger-labs/fablo/issues/284#issuecomment-1033602704:

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:

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 commented 2 years ago

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