1

我正在按照本教程进行修改以从不同的主机添加组织。 https://medium.com/@mahoney_33893/hyperledger-composer-adding-another-organization-to-an-existing-running-multi-organization-fff5c8104a82

我正在尝试将新组织添加到来自不同主机(例如 Org3)的现有频道。我已经设法将来自 org3 的对等方加入到频道中。我有 org3 运行的 CA。

然后,我使用修改后的连接配置文件创建并导入了 PeerAdmin 卡。

但是,当我运行作曲家身份请求时,我收到错误消息错误:请求身份失败。尝试注册用户并返回证书时出错。错误:注册失败,出现错误 [[{"code":19,"message":"CA 'ca.org1.example.com' 不存在"}]]。请注意,为 org1 运行我的 ca 的端口是打开的。

然后,我尝试从我的 org3 中的 ca 获取日志,却发现(POST /api/v1/enroll 404 19 "CA 'ca.org1.example.com' 不存在)。为什么我的来自 org3 的 ca 需要与来自 org1 的 ca 通信?为什么它说我来自 org1 的 ca 实际上已启动并运行时不存在?非常感谢任何帮助

目前使用超级账本作曲家,超级账本结构 v 1.2.1。目前不使用 TLS。

{
"name": "hlfv1",
"x-type": "hlfv1",
"x-commitTimeout": 300,
"version": "1.0.0",
"client": {
    "organization": "Org3",
    "connection": {
        "timeout": {
            "peer": {
                "endorser": "300",
                "eventHub": "300",
                "eventReg": "300"
            },
            "orderer": "300"
        }
    }
},
"channels": {
    "composerchannel": {
        "orderers": [
            "orderer.example.com"
        ],
        "peers": {
            "peer0.org1.example.com": {},
            "peer0.org3.example.com":{}
        }
    }
},
"organizations": {
    "Org1": {
        "mspid": "Org1MSP",
        "peers": [
            "peer0.org1.example.com"
        ],
        "certificateAuthorities": [
            "ca.org1.example.com"
        ]
    },
    "Org3":{
        "mspid": "Org3MSP",
        "peers": [
            "peer0.org3.example.com"
        ],
        "certificateAuthorities": [
            "ca.org3.example.com"
        ]
    }
},
"orderers": {
    "orderer.example.com": {
        "url": "grpc://{{hostmachineurl}}:7050"
    }
},
"peers": {
    "peer0.org1.example.com": {
        "url": "grpc://{{hostmachineurl}}:7051"
    },
    "peer0.org3.example.com": {
        "url": "grpc://{{localmachineurl}}:11051"
    }
},
"certificateAuthorities": {
    "ca.org1.example.com": {
        "url": "http://{{hostmachineurl}}:7054",
        "caName": "ca.org1.example.com"
    },
    "ca.org3.example.com": {
        "url": "http://{{localmachineurl}}:9054",
        "caName": "ca.org1.example.com"
    }
}

}

我的 docker 创建 peer org3

version: '2'

volumes:
  peer0.org3.example.com:

networks:
  byfn:

services:

  peer0.org3.example.com:
    container_name: peer0.org3.example.com
    extends:
      file: peer-base.yaml
      service: peer-base
    environment:
      - CORE_PEER_ID=peer0.org3.example.com
      - CORE_PEER_ADDRESS=peer0.org3.example.com:7051
      - CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org3.example.com:7051
      - CORE_PEER_LOCALMSPID=Org3MSP
    volumes:
        - /var/run/:/host/var/run/
        - ~/fabric-samples/first-network/org3-artifacts/crypto-config/peerOrganizations/org3.example.com/users/Admin@org3.example.com/msp:/etc/hyperledger/fabric/msp
        - ~/fabric-samples/first-network/org3-artifacts/crypto-config/peerOrganizations/org3.example.com/users/Admin@org3.example.com/tls:/etc/hyperledger/fabric/tls
        - peer0.org3.example.com:/var/hyperledger/production
    ports:
      - 11051:7051
      - 11053:7053
    networks:
      - byfn
4

1 回答 1

0

查看您的connection.json上述内容-我可以看到为什么它会向 Org1 CA(而不是 Org 3 的 CA)请求:

“certificateAuthorities”下的此部分应为“ca.org3.example.com”(参见下面的 //):

"certificateAuthorities": {
    "ca.org1.example.com": {
        "url": "http://{{hostmachineurl}}:7054",
        "caName": "ca.org1.example.com"
    },
    "ca.org3.example.com": {
        "url": "http://{{localmachineurl}}:9054",
        "caName": "ca.org1.example.com" // change this line
    }
}

您可能还需要检查其他条目。

于 2018-10-22T09:16:02.257 回答