Search code examples
dockerhyperledgerblockchainhyperledger-composer

Hyperledger Composer Playground local files


I'm a beginner with Hyperledger and I have some questions about Hyperledger Composer:

  • What's the difference between Hyperledger Composer and Composer Playground?
    From what I understand Playground is just a user interface for the configuration, deployment and testing of a business network. So, isn't there any differences between deploy a business network with Playground and with Hyperledger Composer using Yeoman? (as shown for example in this tutorial)

  • I installed Composer Playgroung locally with this official tutorial. After creating a new business network, where can I find the related files on my machine?

  • What are all the operation I need to run every time I start up my machine to continue developing?
    Sometimes just running ./startFabric.sh makes Playground return “Error trying to ping. Make sure chaincode has successfully instantiated and try again”

  • Do I have to export my business network card from Playground every time I want to test the RESTful API’s (using composer-rest-server)?


Solution

  • 1: Hyperledger composer is a project which helps us interact with Hyperledger fabric. It includes UI (composer-playgroud), CLI and NPM(SDK) package. Composer Playground is a testing & development tool. You can create a blockchain smart contract here and also deploy in local memory to test the code. For production deployment, I would suggest use composer-cli.

    2: Composer playground keeps all the cards in ".composer" folder. Most likely this folder sits on your user folder. In Ubuntu OS it is on path "/home/user/.composer". Regarding BNA, if it is connected to your fabric then it picks BNA from there. In browser only mode, it keeps in the browser cache.

    3: I would suggest first run ./stopFabric.sh and then run ./startFabric.sh. It will stop all the Docker containers. If you have installed your own BNA then just ping the network. Follow this link. In the end, you will find the ping command.

    4: Once you have imported cards to your composer rest server then, I think it should be okay. You do not need to import it again until unless the service is running. You can create composer rest server stateful by adding mongo in it. follow this. You can not import a card in two application i.e. if you have imported a card into composer playground then you can not import the same card into composer rest server.