本文介绍了Hyperledger Composer:未为此连接指定业务网络的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在本地安装了hyperledger composer.但是在本地主机上,它会给出错误:

I have installed hyperledger composer locally. But on localhost it gives error :

错误:尚未建立任何业务网络为此连接指定

Error: No business network has beenspecified for this connection.

我也无法添加模型和脚本文件.

I am not able to add model and script file as well.

这是终端中显示的错误

error: [Hyperledger-Composer] undefined:HLFConnection            :ping()                    Error: Error trying to ping. Error: No business network has been specified for this connection
at _checkRuntimeVersions.then.catch (/usr/local/lib/node_modules/composer-playground/node_modules/composer-connector-hlfv1/lib/hlfconnection.js:787:34)
at <anonymous>
at runMicrotasksCallback (internal/process/next_tick.js:121:5)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9) error: [Hyperledger-Composer] undefined:ConnectorServer          :Error: Error trying to pi

推荐答案

我想我解决了这个问题.

I think I solved this problem.

错误原因是No business network has been specified for this connection.,当您第一次运行composer-playground时不会发生这种情况,因为那一次,您确实没有网络,也没有也是如此,因此有一个模式弹出Let's blockchain.

The error reason is No business network has been specified for this connection., this does not happen when you first time to run composer-playground, because that time, you truly do not have a network and you either do not have card too, so there is a modal pop up Let's blockchain.

这仅在您停止/删除您的业务网络网时发生,或者没有业务网络在运行,但是您还拥有与该网络链接的名片.

This only happened when you stop/delete your business network net, or there is no business network running but you also have the business card linked to the network.

  1. 按照该教程在本地创建一个新的business network
  2. 通过stopFabric.shstartFabric.sh重新启动Farbric工具,(*这不是启动业务网络,而是启动结构)
  3. 再次运行您的游乐场composer-playground
  4. 可能您还会再次看到该错误(error trying to ping),但不用担心
  5. 在右上角找到一个折叠的按钮My Business Networks
  6. delete the card without connectiondeploy a new network
  1. Follow the tutorial to create a new business network locally
  2. restart your farbric tool by stopFabric.sh and startFabric.sh, (* this is not to start your business network but your fabric)
  3. run your playground again composer-playground
  4. probably you will also see the error again (error trying to ping), but no worry
  5. find a button at top right corner which is folded My Business Networks
  6. delete the card without connection or deploy a new network

这对我有用,希望它也对您有用.这种过程设计的局限性,即使您删除网络,或者即使您没有启动网络,也要尝试启动游乐场,该卡仍然存在.这就是我认为发生此错误的原因.

This worked for me, hope it will work for you too. This kind of process design limitation, the card is still there even you delete your network or your are trying to start your playground even you did not start your network. This is why this error happened I think.

使用仅浏览器模式,您可以对业务网络进行建模和测试 使用驻留在浏览器本地的模拟区块链分类帐 存储.

Using browser-only mode, you can model and test the business network using a mock blockchain ledger that resides in your browser's local storage.

如何在浏览器Chrome中删除缓存

这可能可以解决许多错误.

How to delete cache in browser Chrome

This probably can solve many errors.

参考文献

  • 一个非常不错的IBM区块链/作曲家教程,它已经很旧了,需要注意的是,某些命令在新版作曲家中不能以相同的方式工作
  • References

    • A very good IBM blockchain/ composer tutorial, just old, need to be pay attention to that some commands not working in the same way on new version of composer
    • 这篇关于Hyperledger Composer:未为此连接指定业务网络的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-13 23:51