使用CouchDB启动第一个网络时出错

时间:2018-10-02 07:59:35

标签: hyperledger-fabric

在将对等方加入频道时出现以下错误:-

  

错误:获取渠道认可者客户端的错误:认可者客户端无法连接到peer0.org1.example.com:7051:创建新连接失败:超出了上下文期限

请注意:-

我已经使用了CouchDb。编写以下命令:-

  

docker-compose -f docker-compose-cli.yaml -f docker-compose-couch.yaml up -d

1 个答案:

答案 0 :(得分:0)

也许您可以对 docker-compose-couch.yaml 和您的旧文件进行一些验证,我假设您替换了它,但该文件仍然存在。

验证所有服务都指向现在使用CouchDB,也许 docker-compose-cli.yaml 指向其他数据库类型。

  peer0.org1.example.com:
container_name: peer0.org1.example.com
image: hyperledger/fabric-peer
environment:
  - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock
  - CORE_PEER_ID=peer0.org1.example.com
  - CORE_LOGGING_PEER=info
  - CORE_CHAINCODE_LOGGING_LEVEL=info
  - CORE_PEER_LOCALMSPID=Org1MSP
  - CORE_PEER_MSPCONFIGPATH=/etc/hyperledger/msp/peer/
  - CORE_PEER_ADDRESS=peer0.org1.example.com:7051
  # # the following setting starts chaincode containers on the same
  # # bridge network as the peers
  # # https://docs.docker.com/compose/networking/
  - CORE_VM_DOCKER_HOSTCONFIG_NETWORKMODE=${COMPOSE_PROJECT_NAME}_basic
  - CORE_LEDGER_STATE_STATEDATABASE=CouchDB
  - CORE_LEDGER_STATE_COUCHDBCONFIG_COUCHDBADDRESS=couchdb:5984
  # The CORE_LEDGER_STATE_COUCHDBCONFIG_USERNAME and CORE_LEDGER_STATE_COUCHDBCONFIG_PASSWORD
  # provide the credentials for ledger to connect to CouchDB.  The username and password must
  # match the username and password set for the associated CouchDB.
  - CORE_LEDGER_STATE_COUCHDBCONFIG_USERNAME=
  - CORE_LEDGER_STATE_COUCHDBCONFIG_PASSWORD=
working_dir: /opt/gopath/src/github.com/hyperledger/fabric
command: peer node start
# command: peer node start --peer-chaincodedev=true
ports:
  - 7051:7051
  - 7053:7053
volumes:
    - /var/run/:/host/var/run/
    - ./crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp:/etc/hyperledger/msp/peer
    - ./crypto-config/peerOrganizations/org1.example.com/users:/etc/hyperledger/msp/users
    - ./config:/etc/hyperledger/configtx
extra_hosts:
- "peer1.org1.example.com:209.97.128.176"
depends_on:
  - orderer.example.com
  - couchdb
networks:
  - basic

  couchdb:
    container_name: couchdb
    image: hyperledger/fabric-couchdb
    # Populate the COUCHDB_USER and COUCHDB_PASSWORD to set an admin user and password
    # for CouchDB.  This will prevent CouchDB from operating in an "Admin Party" mode.
    environment:
      - COUCHDB_USER=
      - COUCHDB_PASSWORD=
    ports:
      - 5984:5984
    networks:
      - basic

在该示例中,您具有一个对等服务和couchDB服务,您可以将其作为示例。

此外,我还有一个基于Fabric Samples的Basic Network示例的教程,介绍如何在多个主机中设置Hyperledger Fabric。也许您可以作为参考。

https://medium.com/1950labs/setup-hyperledger-fabric-in-multiple-physical-machines-d8f3710ed9b4

致谢!