3

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

Paul O'Mahony
  • 6,740
  • 1
  • 10
  • 15
Riccardo
  • 1,083
  • 2
  • 15
  • 25

1 Answers1

1

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.

  • I have found the .composer folder but inside I haven't find any .cto or .js file and I need them since I would like to set up a git repository. Every time I start up my Ubuntu machine, even running `./stopFabric.sh` and `./startFabric.sh` doesn’t seem working. With the ping command and with composer-playground I still get `Error: Error trying to ping. Error: make sure the chaincode test-bank has been successfully instantiated and try again: getccdata composerchannel/test-bank responded with error: could not find chaincode with name 'test-bank' ` – Riccardo Apr 06 '19 at 08:07
  • 1
    .composer folder does not contain code. It only contains cards as I mentioned earlier. If your purpose is to build the code from scratch then I would suggest you to create a folder with "yo hyperledger-composer:businessnetwork" cmd and using vscode develop the code and create the BNA with "composer archive create -t dir -n ." and finally upload the bna to composer-playground to test the code. – Gaurang Singh Apr 07 '19 at 06:38