0

我在 server-1 中使用 Hyperledger Fabric 2.1 容器,在 server-2 中使用节点 SDK。我的connection-org.json文件如下:

{
    "name": "first-network-org2",
    "version": "1.0.0",
    "client": {
        "organization": "Org2",
        "connection": {
            "timeout": {
                "peer": {
                    "endorser": "300"
                }
            }
        }
    },
    "organizations": {
        "Org2": {
            "mspid": "Org2MSP",
            "peers": [
                "peer0.org2.example.com",
                "peer1.org2.example.com"
            ],
            "certificateAuthorities": [
                "ca.org2.example.com"
            ]
        }
    },
    "peers": {
        "peer0.org2.example.com": {
            "url": "grpcs://192.168.43.233:9051",
            "tlsCACerts": {
                "pem": "pen file here"
            },
            "grpcOptions": {
                "ssl-target-name-override": "peer0.org2.example.com",
                "hostnameOverride": "peer0.org2.example.com"
            }
        },
        "peer1.org2.example.com": {
            "url": "grpcs://192.168.43.233:10051",
            "tlsCACerts": {
                "pem": "pemfile here"
            },
            "grpcOptions": {
                "ssl-target-name-override": "peer1.org2.example.com",
                "hostnameOverride": "peer1.org2.example.com"
            }
        }
    },
    "certificateAuthorities": {
        "ca.org2.example.com": {
            "url": "https://192.168.43.233:8054",
            "caName": "ca.org2.example.com",
            "tlsCACerts": {
                "pem": "pem file here"
            },
            "httpOptions": {
                "verify": false
            }
        }
    }
}

当我尝试从 Fabric Node SDK 调用链代码时,出现以下错误:

2020-07-09T13:12:19.615Z - error: [ServiceEndpoint]: Error: Failed to connect before the deadline on Endorser- name: peer0.org2.example.com:9051, url:grpcs://peer0.org2.example.com:9051
2020-07-09T13:12:19.615Z - error: [ServiceEndpoint]: waitForReady - Failed to connect to remote gRPC server peer0.org2.example.com:9051 url:grpcs://peer0.org2.example.com:9051 timeout:3000
2020-07-09T13:12:19.615Z - error: [DiscoveryService]: _buildPeer[verificationchannel] - Unable to connect to the discovered peer peer0.org2.example.com:9051 due to Error: Failed to connect before the deadline on Endorser- name: peer0.org2.example.com:9051, url:grpcs://peer0.org2.example.com:9051

我该怎么做才能调用链码?docker-compose 配置中是否应该更改某些内容?

4

0 回答 0