2017-08-15 32 views
0

我使用搬运工群试图安装第一网络例如在多主机环境下方配置以开始:Hyperledger织物多主机设置为第一网络例如

HOST1

  • 订货人
  • ORG1-pee0
  • ORG1-等方
  • CLI

HOST2

  • ORG2-pee0
  • ORG2-pee1

我只是改变了搬运工,撰写-cli.yaml,使其与群(如下代码)不兼容。 我无法将Host2/Org2对等方添加到频道

执行,以便在下面的步骤:

  • byfn -m生成
  • 搬运工堆栈部署--compose文件搬运工-撰写-cli.yaml overnet
  • 进入CLI码头工人和执行。 /scripts/script.sh mychannel

我不断收到以下错误

2017-08-15 02:42:49.512 UTC [msp] GetDefaultSigningIdentity -> DEBU 006 Obtaining default signing identity
Error: Error getting endorser client channel: PER:404 - Error trying to connect to local peer
/opt/gopath/src/github.com/hyperledger/fabric/peer/common/common.go:116 github.com/hyperledger/fabric/peer/common.GetEndorserClient
/opt/gopath/src/github.com/hyperledger/fabric/peer/channel/channel.go:149 github.com/hyperledger/fabric/peer/channel.InitCmdFactory
/opt/gopath/src/github.com/hyperledger/fabric/peer/channel/join.go:138 github.com/hyperledger/fabric/peer/channel.join
/opt/gopath/src/github.com/hyperledger/fabric/peer/channel/join.go:42 github.com/hyperledger/fabric/peer/channel.joinCmd.func1
/opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/spf13/cobra/command.go:599
github.com/hyperledger/fabric/vendor/github.com/spf13/cobra.(*Command).execute
/opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/spf13/cobra/command.go:689
github.com/hyperledger/fabric/vendor/github.com/spf13/cobra.(*Command).ExecuteC
/opt/gopath/src/github.com/hyperledger/fabric/vendor/github.com/spf13/cobra/command.go:648
github.com/hyperledger/fabric/vendor/github.com/spf13/cobra.(*Command).Execute
/opt/gopath/src/github.com/hyperledger/fabric/peer/main.go:118 main.main
/opt/go/src/runtime/proc.go:192 runtime.main
/opt/go/src/runtime/asm_amd64.s:2087 runtime.goexit
Caused by: x509: certificate is valid for peer0.org1.example.com, peer0, not peer0.org2.example.com

搬运工-构成-cli.yaml

订货人

version: '3' 
networks: 
    overnet: 

services: 

    orderer_example_com: 
    image: hyperledger/fabric-orderer 
    environment: 
     - ORDERER_GENERAL_LOGLEVEL=debug 
     - ORDERER_GENERAL_LISTENADDRESS=0.0.0.0 
     - ORDERER_GENERAL_GENESISMETHOD=file 
     - ORDERER_GENERAL_GENESISFILE=/var/hyperledger/orderer/orderer.genesis.block 
     - ORDERER_GENERAL_LOCALMSPID=OrdererMSP 
     - ORDERER_GENERAL_LOCALMSPDIR=/var/hyperledger/orderer/msp 
     # enabled TLS 
     - ORDERER_GENERAL_TLS_ENABLED=true 
     - ORDERER_GENERAL_TLS_PRIVATEKEY=/var/hyperledger/orderer/tls/server.key 
     - ORDERER_GENERAL_TLS_CERTIFICATE=/var/hyperledger/orderer/tls/server.crt 
     - ORDERER_GENERAL_TLS_ROOTCAS=[/var/hyperledger/orderer/tls/ca.crt] 
    working_dir: /opt/gopath/src/github.com/hyperledger/fabric 
    command: orderer 
    volumes: 
    - ./channel-artifacts/genesis.block:/var/hyperledger/orderer/orderer.genesis.block 
    - ./crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/msp:/var/hyperledger/orderer/msp 
    - ./crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/:/var/hyperledger/orderer/tls 
    ports: 
     - 7050:7050 
#  - 7049:7049 
    networks: 
     - overnet 
    deploy: 
     replicas: 1 
     placement: 
      constraints: [node.role == manager] 

ORG1同辈

peer0_org1_example_com: 
    image: hyperledger/fabric-peer 
    volumes: 
     - /var/run/:/host/var/run/ 
     - ./crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/msp:/etc/hyperledger/fabric/msp 
     - ./crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls:/etc/hyperledger/fabric/tls 
    ports: 
     - 7051:7051 
     - 7053:7053 
    environment: 
     - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock 
     # 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=overnet 
     - CORE_LOGGING_LEVEL=DEBUG 
     - CORE_PEER_TLS_ENABLED=true 
     - CORE_PEER_GOSSIP_USELEADERELECTION=true 
     - CORE_PEER_GOSSIP_ORGLEADER=false 
     - CORE_PEER_PROFILE_ENABLED=true 
     - CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/tls/server.crt 
     - CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/tls/server.key 
     - CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/tls/ca.crt 
     - CORE_PEER_ID=peer0.org1.example.com 
     - CORE_PEER_ADDRESS=peer0.org1.example.com:7051 
     - CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.example.com:7051 
     - CORE_PEER_LOCALMSPID=Org1MSP 
    working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer 
    command: peer node start 
    networks: 
     - overnet 
    deploy: 
     replicas: 1 
     placement: 
      constraints: [node.role == manager] 

ORG2同辈

peer0_org2_example_com: 
    image: hyperledger/fabric-peer 
    environment: 
     - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock 
     # 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=overnet 
     - CORE_LOGGING_LEVEL=DEBUG 
     - CORE_PEER_TLS_ENABLED=true 
     - CORE_PEER_GOSSIP_USELEADERELECTION=true 
     - CORE_PEER_GOSSIP_ORGLEADER=false 
     - CORE_PEER_PROFILE_ENABLED=true 
     - CORE_PEER_TLS_CERT_FILE=/etc/hyperledger/fabric/tls/server.crt 
     - CORE_PEER_TLS_KEY_FILE=/etc/hyperledger/fabric/tls/server.key 
     - CORE_PEER_TLS_ROOTCERT_FILE=/etc/hyperledger/fabric/tls/ca.crt 
     - CORE_PEER_ID=peer0.org2.example.com 
     - CORE_PEER_ADDRESS=peer0.org2.example.com:7051 
     - CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org2.example.com:7051 
     - CORE_PEER_LOCALMSPID=Org2MSP 
    volumes: 
     - /var/run/:/host/var/run/ 
     - ./crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/msp:/etc/hyperledger/fabric/msp 
     - ./crypto-config/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls:/etc/hyperledger/fabric/tls 
    ports: 
     - 9051:7051 
     - 9053:7053 
    working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer 
    command: peer node start 
    networks: 
     - overnet 
    deploy: 
     mode: replicated 
     replicas: 1 
     placement: 
      constraints: [node.role == worker] 

CLI

cli: 
    image: hyperledger/fabric-tools 
    tty: true 
    environment: 
     - GOPATH=/opt/gopath 
     - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock 
     - CORE_LOGGING_LEVEL=DEBUG 
     - CORE_PEER_ID=cli 
     - CORE_PEER_ADDRESS=peer0.org2.example.com:7051 
     - CORE_PEER_LOCALMSPID=Org1MSP 
     - CORE_PEER_TLS_ENABLED=true 
     - CORE_PEER_TLS_CERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/server.crt 
     - CORE_PEER_TLS_KEY_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org2.example.com/tls/server.key 
     - CORE_PEER_TLS_ROOTCERT_FILE=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/peers/peer0.org4.example.com/tls/ca.crt 
     - CORE_PEER_MSPCONFIGPATH=/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/org2.example.com/users/[email protected]/msp 
    working_dir: /opt/gopath/src/github.com/hyperledger/fabric/peer 
# command: /bin/bash -c './scripts/script.sh ${CHANNEL_NAME}; sleep $TIMEOUT' 
    volumes: 
     - /var/run/:/host/var/run/ 
     - ./chaincode/:/opt/gopath/src/github.com/hyperledger/fabric/examples/chaincode/go 
     - ./crypto-config:/opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ 
     - ./scripts:/opt/gopath/src/github.com/hyperledger/fabric/peer/scripts/ 
     - ./channel-artifacts:/opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifacts 
    depends_on: 
     - orderer_example_com 
     - peer0_org1_example_com 
     - peer1_org1_example_com 
     - peer0_org2_example_com 
     - peer1_org2_example_com 
    networks: 
     - overnet 
    deploy: 
     replicas: 1 
     placement: 
      constraints: [node.role == manager] 

加密config.yaml(没有进行任何更改这个文件,但附加在这里供参考)

OrdererOrgs: 
    # ------------------------------------------------------------------ 
    # Orderer 
    # ------------------------------------------------------------------ 

    - Name: Orderer 
    Domain: example.com 
    # ---------------------------------------------------------------- 
    # "Specs" - See PeerOrgs below for complete description 
    # ---------------------------------------------------------------- 
    Specs: 
     - Hostname: orderer 
# -------------------------------------------------------------------- 
# "PeerOrgs" - Definition of organizations managing peer nodes 
# -------------------------------------------------------------------- 
PeerOrgs: 
# ------------------------------------------------------------------ 
    # Org1 
    # ------------------------------------------------------------------ 
    - Name: Org1 
    Domain: org1.example.com 
    # ---------------------------------------------------------------- 
    # "Specs" 
    # ---------------------------------------------------------------- 
    # Uncomment this section to enable the explicit definition of hosts in your 
# configuration. Most users will want to use Template, below 
# 
# Specs is an array of Spec entries. Each Spec entry consists of two fields: 
# - Hostname: (Required) The desired hostname, sans the domain. 
# - CommonName: (Optional) Specifies the template or explicit override for 
#     the CN. By default, this is the template: 
# 
#        "{{.Hostname}}.{{.Domain}}" 
# 
#     which obtains its values from the Spec.Hostname and 
#     Org.Domain, respectively. 
# --------------------------------------------------------------------------- 
# Specs: 
# - Hostname: foo # implicitly "foo.org2.example.com" 
#  CommonName: foo27.org5.example.com # overrides Hostname-based FQDN set above 
# - Hostname: bar 
# - Hostname: baz 
# --------------------------------------------------------------------------- 
# "Template" 
# --------------------------------------------------------------------------- 
# Allows for the definition of 1 or more hosts that are created sequentially 
# from a template. By default, this looks like "peer%d" from 0 to Count-1. 
# You may override the number of nodes (Count), the starting index (Start) 
# or the template used to construct the name (Hostname). 
# 
# Note: Template and Specs are not mutually exclusive. You may define both 
# sections and the aggregate nodes will be created for you. Take care with 
# name collisions 
# --------------------------------------------------------------------------- 
Template: 
    Count: 2 
    # Start: 5 
    # Hostname: {{.Prefix}}{{.Index}} # default 
# --------------------------------------------------------------------------- 
# "Users" 
# --------------------------------------------------------------------------- 
# Count: The number of user accounts _in addition_ to Admin 
# --------------------------------------------------------------------------- 
Users: 
    Count: 1 
    # ------------------------------------------------------------------ 
    # Org2: See "Org1" for full specification 
    # ------------------------------------------------------------------ 
    - Name: Org2 
    Domain: org2.example.com 
    Template: 
     Count: 2 
    Users: 
     Count: 1 
+0

你能否粘贴一个用于使用cryptogen生成证书的crypto-config.yaml的要点或pastebin? – christo4ferris

+0

@ christo4ferris我在这里添加了crypto-config.yaml文件,但是我没有对该文件进行任何更改,我使用的是第一个网络 –

+0

的示例代码库中提供的原始文件,并且您没有更改脚本。什么? – christo4ferris

回答

0

首先,我认为你不必

Enter the CLI docker and execute ./scripts/script.sh mychannel

或者您是否像在“Start the network”步骤中描述的那样评论了泊坞窗撰写文件?

另一方面,我告诉你,我已经实现了使用docker设置Multihost环境。但是,我没有定义网络覆盖,而是为我要启动的所有码头集装箱定义了network_mode: host

您能否显示出现在Peer和Orderer中的日志?

相关问题