Search code examples
node.jshyperledgerhyperledger-composer

How to write console statement in hyperledger composer


I have the transaction code in Hyperledger composer. How to print all the console statements when the transaction called from the nodejs application.


Solution

  • Runtime Log:

    If you run docker ps -a you should see basic running docker containers. One of the docker containers will be a chaincode container (your running business network). You will see a particular container id of container.

    Then look forward using docker logs <container id> you will see your console.log() information in your terminal. You can follow the logs using docker logs -f

    Developer Log:

    you can see the output in the Developer console. In Firefox and Chrome browsers for example - hit CTRL-SHIFT-I and it pops up - then goes to Console and you can see what your console log information.

    Hope it will help you :)