0

有没有人设法使用基本网络示例设置超级账本资源管理器(设法使用第一个网络进行设置)。在这种情况下,它不会接听我的同伴/频道。该配置适用于四个对等方和一个具有两个组织(第一网络)的订购者,但我似乎无法让它只与一个对等方一起使用。任何帮助,将不胜感激 !

Fabric 版本:1.2 Explorer 版本:3.7.1

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

    {
     "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"
    }
4

1 回答 1

3

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

  • tlsEnable 应该为 false - 基本网络示例不使用 TLS。
  • 所有 URL 都应使用 grpc - grpcs 仅在启用 TLS 时使用。
  • 所有 URL 都应该使用 localhost - 假设您的路径条目是正确的,看起来您正在本地运行 Explorer(即不在容器中)。在这种情况下,所有地址都应使用 localhost。

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

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

没有这个,对等点将拒绝来自其自身组织外部的所有连接。

应用此更改后docker-compose.yml,我能够按照此处的说明,使用名为的配置文件夹basic-network和以下命令,在 docker 容器中成功部署 Explorer 3.7:

./deploy_explorer.sh basic-network net_basic

并在以下config.json文件中blockchain-explorer/examples/basic-network

{
  "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 部署脚本时,可以使用以下命令查看这些内容:

docker logs blockchain-explorer
docker exec -t blockchain-explorer cat /opt/logs/app/app.log
于 2018-12-05T13:51:09.993 回答