首页 > 解决方案 > 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.

标签: node.jshyperledgerhyperledger-composer

解决方案


运行时日志:

如果你运行docker ps -a,你应该看到基本运行的 docker 容器。其中一个 docker 容器将是一个链码容器(您正在运行的业务网络)。您将看到容器的特定容器 ID。

然后期待使用您将在您的终端中docker logs <container id>看到您的信息。console.log()您可以使用以下方式跟踪日志docker logs -f

开发者日志:

您可以在开发者控制台中看到输出。例如,在 Firefox 和 Chrome 浏览器中——点击CTRL-SHIFT-I它会弹出——然后进入控制台,你可以看到你的控制台日志信息。

希望它会帮助你:)


推荐阅读