无法使用一个节点设置超级账本浏览器(如基本网络示例) [英] Unable to setup hyperledger explorer with one node (like basic network example)

查看:141
本文介绍了无法使用一个节点设置超级账本浏览器(如基本网络示例)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以通过基本的网络示例来设置超级账本浏览器(可以通过第一个网络对其进行设置).在这种情况下,它不会接我的同伴/频道.该配置适用于四个对等方和一个具有两个组织的订购者(第一个网络),但我似乎无法使其仅与一个对等方一起使用.任何帮助将不胜感激!

Has anyone managed to setup hyperledger explorer with the basic network example (managed to set it up with first network). It wont pick up my peer/channel in this case. The configuration works with four peers and an orderer with two orgs (first-network) but I cant seem to get it to work with just one peer. Any help would be appreciated !

结构版本:1.2 资源管理器版本:3.7.1

Fabric Version : 1.2 Explorer version : 3.7.1

config.json(实际文件格式正确):-

config.json (The actual file is well formatted) :-

    {
     "network-configs": {
       "network-1": {
         "version": "1.0",
          "clients": {
            "client-1": {
               "tlsEnable": true,
               "organization": "Org1MSP",
               "channel": "myc",
               "credentialStore": {
               "path": "./tmp/credentialStore_Org1/credential",
               "cryptoStore": {
                  "path": "./tmp/credentialStore_Org1/crypto"
                }
      }
    }
  },
  "channels": {
    "myc": {
      "peers": {
        "peer0.org1.example.com": {}
      },
      "connection": {
        "timeout": {
          "peer": {
            "endorser": "6000",
            "eventHub": "6000",
            "eventReg": "6000"
          }
        }
      }
    }
  },
  "organizations": {
    "Org1MSP": {
      "mspid": "Org1MSP",
      "fullpath": false,
      "adminPrivateKey": {
        "path":
          "/fabricsamples/basic-network/crypto-config/org1.example.com/users/Admin@org1.example.com/msp/keystore"
      },
      "signedCert": {
        "path":
          "/fabricsamples/basic-network/crypto-config/org1.example.com/users/Admin@org1.example.com/msp/signcerts"
      }
    },
    "OrdererMSP": {
      "mspid": "OrdererMSP",
      "adminPrivateKey": {
        "path":
          "/fabricsamples/basic-network/crypto-config/ordererOrganizations/example.com/users/Admin@example.com/msp/keystore"
      }
    }
  },
  "peers": {
    "peer0.org1.example.com": {
      "tlsCACerts": {
        "path":
          "/fabricsamples/basic-network/crypto-config/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt"
      },
      "url": "grpcs://peer0.org1.example.com:7051",
      "eventUrl": "grpcs://peer0.org1.example.com:7053",
      "grpcOptions": {
        "ssl-target-name-override": "peer0.org1.example.com"
      }
    }
  },
  "orderers": {
    "orderer.example.com": {
      "url": "grpcs://orderer.example.com:7050"
    }
  }
}
     },
    "configtxgenToolPath": "/home/ett/go/src/themeSCF/bin",
     "license": "Apache-2.0"
    }

推荐答案

首先,有关您的配置文件的一些建议:

Firstly, a few suggestions regarding your config file:

  • tlsEnable应该为false -基本网络示例不使用TLS.
  • 所有URL均应使用grpc -grpcs仅在启用TLS时使用.
  • 所有URL都应使用localhost -假设您的路径条目正确,则好像您在本地运行Explorer(即不在容器中)一样.在这种情况下,所有地址都应使用localhost.
  • tlsEnable should be false - the basic-network example does not use TLS.
  • All URLs should use grpc - grpcs is only used when TLS is enabled.
  • All URLs should use localhost - assuming your path entries are correct, it looks like you are running Explorer locally (i.e. not in a container). In this scenario, all addresses should use localhost.

您还需要编辑basic-network使用的docker-compose.yml文件以添加以下内容:

You also need to edit the docker-compose.yml file used by basic-network to add the following:

services: 
  peer0.org1.example.com: 
      environment:
        - CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.example.com:7051

否则,对等方将拒绝其组织外部的所有连接.

Without this, the peer will reject all connections from outside its own organisation.

将此更改应用于docker-compose.yml后,我能够按照

With this change applied to docker-compose.yml, I was able to successfully deploy Explorer 3.7 in a docker container by following the instructions here, using a configuration folder named basic-network and the following command:

./deploy_explorer.sh basic-network net_basic

以及blockchain-explorer/examples/basic-network中的以下config.json文件:

{
  "network-configs": {
    "network-1": {
      "version": "1.0",
      "clients": {
        "client-1": {
          "tlsEnable": false,
          "organization": "Org1MSP",
          "channel": "mychannel",
          "credentialStore": {
            "path": "./tmp/credentialStore_Org1/credential",
            "cryptoStore": {
              "path": "./tmp/credentialStore_Org1/crypto"
            }
          }
        }
      },
      "channels": {
        "mychannel": {
          "peers": {
            "peer0.org1.example.com": {}
          },
          "connection": {
            "timeout": {
              "peer": {
                "endorser": "6000",
                "eventHub": "6000",
                "eventReg": "6000"
              }
            }
          }
        }
      },
      "organizations": {
        "Org1MSP": {
          "mspid": "Org1MSP",
          "fullpath": false,
          "adminPrivateKey": {
            "path":
              "/tmp/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore"
          },
          "signedCert": {
            "path":
              "/tmp/crypto/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts"
          }
        },
        "OrdererMSP": {
          "mspid": "OrdererMSP",
          "adminPrivateKey": {
            "path":
              "/tmp/crypto/ordererOrganizations/example.com/users/Admin@example.com/msp/keystore"
          }
        }
      },
      "peers": {
        "peer0.org1.example.com": {
          "tlsCACerts": {
            "path":
              "/tmp/crypto/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt"
          },
          "url": "grpc://peer0.org1.example.com:7051",
          "eventUrl": "grpc://peer0.org1.example.com:7053",
          "grpcOptions": {
            "ssl-target-name-override": "peer0.org1.example.com"
          }
        }
      },
      "orderers": {
        "orderer.example.com": {
          "url": "grpc://orderer.example.com:7050"
        }
      }
    }
  },
  "configtxgenToolPath": "/home/fabric-path/workspace/fabric-samples/bin",
  "license": "Apache-2.0"
}

如果按照上述说明操作后仍然遇到问题,请发布Blockchain Explorer报告的任何错误的详细信息以及Blockchain Explorer日志文件(app.log).使用docker部署脚本时,可以使用以下命令查看这些信息:

If you're still having trouble after following the instructions above, please post details of any errors reported by Blockchain Explorer, as well as the Blockchain Explorer log file (app.log). These can be viewed using the following commands when using the docker deployment script:

docker logs blockchain-explorer
docker exec -t blockchain-explorer cat /opt/logs/app/app.log

这篇关于无法使用一个节点设置超级账本浏览器(如基本网络示例)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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