我在Hyperledger Composer上创建了一个业务网络,并在Composer playground上进行了测试,效果很好。我可以添加参与者,添加资产,执行交易等。我尝试使用https://hyperledger.github.io/composer/latest/tutorials/developer-tutorial提供的指南为业务网络生成一个定制的休息API,它也很有效。
命令composer-rest-server --card admin@my-network
的输出是这样的:
Discovering types from business network definition ...
Discovering the Returning Transactions..
Discovered types from business network definition
Generating schemas for all types in business network definition ...
Generated schemas for all types in business network definition
Adding schemas for all types to Loopback ...
Added schemas for all types to Loopback
Web server listening at: http://localhost:3000
Browse your REST API at http://localhost:3000/explorer
这是一个很好的输出但是当我导航到http://localhost:3000
时它失败了,错误This site can’t be reached localhost refused to connect.
我还使用相同的指南生成了一个骨架Angular应用程序,当我运行npm start
时,它返回一个正NG Live Development Server is running on http://0.0.0.0:4200
,它也失败了localhost refused to connect.
我正在使用Azure Ubuntu 18.04来构建和运行网络。任何帮助将不胜感激。
禁用防火墙等端口阻止服务,然后重试。希望它有用