docker-compose中的Hyperledger Explorer无法与Hyperledger区块链一起使用 [英] Hyperledger explorer in docker-compose is not working with the Hyperledger blockchain

查看:365
本文介绍了docker-compose中的Hyperledger Explorer无法与Hyperledger区块链一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试让Hyperledger Explorer与docker-compose一起使用,Hyperledger区块链资源管理器未连接到Hyperledger区块链网络.它显示无法连接客户端对等方,请检查配置和对等状态".但是我遵循了我发现的所有说明来进行连接.

Hyperledger资源管理器启动,我可以在 http://localhost:8090/中访问它,但它确实可以没有连接到区块链.

这是不起作用的github项目.

https://github.com/contractpendev/hyperledger-basic-network

Blockchain Explorer来自这里.

https://github.com/hyperledger/blockchain-explorer


最后,我认为我的问题不是一个好问题,因为没有其他人可能会再遇到这个问题.

解决方案

我会添加评论以询问更多信息,但是由于我没有足够的代表要评论,因此我想尝试一个答案!

以下所有内容均假定Blockchain Explorer使用提供的deploy_explorer.sh脚本在Docker容器中运行.以下所有示例均应与面料样品的第一个网络样品网络一起使用,假定面料样品已被克隆到〜/fabric/fabric-samples.

首先,在docker日志(docker日志{container-name})或容器中的日志文件(/opt/logs/app/app.log)中是否报告了更多详细的错误?

您已完成以下操作吗?

  • 确认您使用的Fabric版本是正确的Blockchain Explorer版本-例如布料1.2的资源管理器3.7.
  • 清理所有现有的Blockchain Explorer安装-如果您安装了以前的版本,则应首先使用提供的部署脚本将其删除,即

    cd ~/fabric/blockchain-explorer
    ./deploy_explorer.sh --clean

  • 克隆和/或签出区块链浏览器存储库的正确版本-例如

    cd ~/fabric
    git clone https://github.com/hyperledger/blockchain-explorer.git
    cd blockchain-explorer
    git checkout release-3.7

  • 在"blockchain-explorer/examples"下为您的网络创建一个文件夹-例如

    cd ~/fabric/blockchain-explorer/examples
    mkdir first-network

  • 为您的网络创建config.json文件(在上面创建的文件夹中).您可以从〜/fabric/blockchain-explorer/examples/net1/config.json获取示例文件的副本,然后进行相应的修改.
  • 创建指向crypto-config的符号链接(在同一文件夹中),例如

    cd ~/fabric/blockchain-explorer/examples/first-network
    ln -fs ~/fabric/fabric-samples/crypto-config crypto

  • 部署Blockchain Explorer -指定包含配置的文件夹的名称以及docker网络的名称,例如

    cd ~/fabric/blockchain-explorer
    ./deploy_explorer.sh first-network net_byfn

您现在应该可以通过 http://localhost:8080/连接到资源管理器.如果页面仍然无法加载,请检查docker日志中是否有错误(docker日志blockchain-explorer).

请参见 https://github.com/hyperledger/blockchain- Explorer/blob/master/README.md 了解更多详细信息(将"master"替换为您正在使用的发行版标签,例如"release-3.7").

另外,请注意,使用deploy_explorer.sh时暴露的端口已在版本3.7和版本3.8之间从8080更改为8090.这使我困扰了很长时间!

I am trying to get hyperledger explorer to work with docker-compose, hyperledger blockchain explorer did not connect to the hyperledger blockchain network. It says "Failed to connect client peer, please check the configuration and peer status". However I followed all instructions I could find to get it to connect.

The Hyperledger explorer starts up and I can access it at http://localhost:8090/ but it does not connect to the blockchain.

Here is the github project where it is not working.

https://github.com/contractpendev/hyperledger-basic-network

Blockchain Explorer comes from here.

https://github.com/hyperledger/blockchain-explorer


Finally I think my question is not a good question as no-one else is likely to have this problem anymore.

解决方案

I would add a comment asking for more info, but since I don´t have enough rep yet to comment, I guess I'll try an answer instead!

All of the following assume that Blockchain Explorer is run in a docker container, using the supplied deploy_explorer.sh script. All examples below should work with the first-network sample network from fabric-samples, assuming that fabric-samples has been cloned to ~/fabric/fabric-samples.

Firstly, are there any more detailed errors reported in either the docker logs (docker logs {container-name}) or the log file in the container (/opt/logs/app/app.log)?

Have you done the following?

  • Confirm that you are using the correct Blockchain Explorer version for your fabric version - e.g. explorer 3.7 for fabric 1.2.
  • Clean-up any existing Blockchain Explorer installation - if you had a previous version installed, you should remove it first using the supplied deployment script, i.e.

    cd ~/fabric/blockchain-explorer
    ./deploy_explorer.sh --clean

  • Clone and/or check-out the correct release of the blockchain explorer repository - e.g.

    cd ~/fabric
    git clone https://github.com/hyperledger/blockchain-explorer.git
    cd blockchain-explorer
    git checkout release-3.7

  • Create a folder under "blockchain-explorer/examples" for your network - e.g.

    cd ~/fabric/blockchain-explorer/examples
    mkdir first-network

  • Create a config.json file for your network (in the folder created above). You can take a copy of the sample file from ~/fabric/blockchain-explorer/examples/net1/config.json and modify it accordingly.
  • Create a symbolic link to crypto-config (in the same folder), e.g.

    cd ~/fabric/blockchain-explorer/examples/first-network
    ln -fs ~/fabric/fabric-samples/crypto-config crypto

  • Deploy Blockchain Explorer - specifying the name of the folder containing your config, and the name of your docker network, e.g.

    cd ~/fabric/blockchain-explorer
    ./deploy_explorer.sh first-network net_byfn

You should now be able to connect to explorer at http://localhost:8080/. If the page still doesn't load, check the docker logs for any errors (docker logs blockchain-explorer).

See https://github.com/hyperledger/blockchain-explorer/blob/master/README.md for more details (replacing "master" with the label for release you are using, e.g. "release-3.7").

Also, please note that the port exposed when using deploy_explorer.sh has changed between release-3.7 and release-3.8 from 8080 to 8090. This one caught me out for quite some time!

这篇关于docker-compose中的Hyperledger Explorer无法与Hyperledger区块链一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆