将 Hyperledger Fabric 本地 BYFN 网络连接到 IBM Blockchain Platform VS 代码扩展时出错
Error connecting Hyperledger Fabric local BYFN network to IBM Blockchain Platform VS Code Extension
我是 运行 来自 fabric-samples 存储库的 BYFN 网络的本地实例,使用以下命令:
git checkout tags/v1.4.6
cd first-network
./byfn.sh up -a -n -i 1.4.6
然后我尝试使用我根据创建的网络创建的以下节点文件连接 IBP VS 代码扩展:
[
{
"name": "peer0.org1.example.com",
"api_url": "grpcs://localhost:7051",
"type": "fabric-peer",
"msp_id": "Org1MSP",
"pem": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNWekNDQWY2Z0F3SUJBZ0lSQU10NWtsWVhDbFJYaVYvVTJ6d0pvSEl3Q2dZSUtvWkl6ajBFQXdJd2RqRUwKTUFrR0ExVUVCaE1DVlZNeEV6QVJCZ05WQkFnVENrTmhiR2xtYjNKdWFXRXhGakFVQmdOVkJBY1REVk5oYmlCRwpjbUZ1WTJselkyOHhHVEFYQmdOVkJBb1RFRzl5WnpFdVpYaGhiWEJzWlM1amIyMHhIekFkQmdOVkJBTVRGblJzCmMyTmhMbTl5WnpFdVpYaGhiWEJzWlM1amIyMHdIaGNOTWpBeE1qSXpNVFkxTmpBd1doY05NekF4TWpJeE1UWTEKTmpBd1dqQjJNUXN3Q1FZRFZRUUdFd0pWVXpFVE1CRUdBMVVFQ0JNS1EyRnNhV1p2Y201cFlURVdNQlFHQTFVRQpCeE1OVTJGdUlFWnlZVzVqYVhOamJ6RVpNQmNHQTFVRUNoTVFiM0puTVM1bGVHRnRjR3hsTG1OdmJURWZNQjBHCkExVUVBeE1XZEd4elkyRXViM0puTVM1bGVHRnRjR3hsTG1OdmJUQlpNQk1HQnlxR1NNNDlBZ0VHQ0NxR1NNNDkKQXdFSEEwSUFCQ1dRVDM4aHlFL1pseDdxU0tMS0pRcnpJNTZSYUp6cnZLY1B6Tm1xc2k5dmRJNmFuRE9QekRzMgpOWHVHeGJTY3drLzR5a3R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cVB3d2VMU2ZCU3k4dHp3dnZYSU9xWGlWQ2UyVwpzbFlneDFXMVprTG9aYXNzNkU3cnNRYWpiVEJyTUE0R0ExVWREd0VCL3dRRUF3SUJwakFkQmdOVkhTVUVGakFVCkJnZ3JCZ0VGQlFjREFnWUlLd1lCQlFVSEF3RXdEd1lEVlIwVEFRSC9CQVV3QXdFQi96QXBCZ05WSFE0RUlnUWcKUXJXTllISDV0VWhHUkFneDI1aWsxdXJQSUNKRkxjVGg4YnJMcjdXTy83c3dDZ1lJS29aSXpqMEVBd0lEUndBdwpSQUlnTGJSc3EvaEcveG9pMjc4eFZDdmQxQXpXY0JWNUdsTG51TjlzZmlSdW5Ka0NJRFAxSksxOTIwaXFTZlBKCmQ4TnBDb1VJME5MQmtZNnNrYkQ2T3FvbUs5TjQKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=",
"enroll_id": "admin",
"enroll_secret": "adminpw"
}
]
peer*.org*.example.com
的 pem
是
中证书的 base64 编码版本
first-network/crypto-config/peerOrganizations/org*.example.com/tlsca/tlsca.org*.example.com-cert.pem
orderer.example.com
的 pem
是
中证书的 base64 编码版本
first-network/crypto-config/ordererOrganizations/example.com/tlsca/tlsca.example.com-cert.pem
ca.org*.example.com
的 pem
是
中证书的 base64 编码版本
first-network/crypto-config/peerOrganizations/org*.example.com/ca/ca.org*.example.com-cert.pem
接下来,我通过在
中提供 signcerts
和 keystore
文件来为 Org1、Org2 和 Orderer 创建钱包
first-network/crypto-config/(peer|orderer)Organizations/org*.example.com/users/Admin@org*.example.com/msp
对于 CA,我选择了选项 use ID and secret to enroll a new identity
以在 Org1 和 Org2 钱包中创建新身份。现在,当我尝试连接到环境时,扩展给出了以下错误:
Error connecting to environment Byfn: Error querying channels: 14 UNAVAILABLE: failed to connect to all addresses
顺便说一句,我可以导入 connection-org*.json
文件来创建新网关并在扩展中查看通道,但无法为 install/instantiate 新创建新环境链码。
扩展版本:v1.0.40
如何解决此问题并将 VS Code 扩展连接到我的本地 BYFN 网络?
下面@david_k提到的解决方案有效。为了完整起见,这是我更新的文件:
nodes.json
[
{
"name": "peer0.org1.example.com",
"api_url": "grpcs://peer0.org1.example.com:7051",
"type": "fabric-peer",
"msp_id": "Org1MSP",
"pem": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNWakNDQWYyZ0F3SUJBZ0lRVHk2dUNOTW9Xclc5VHMzdW55dDVHekFLQmdncWhrak9QUVFEQWpCMk1Rc3cKQ1FZRFZRUUdFd0pWVXpFVE1CRUdBMVVFQ0JNS1EyRnNhV1p2Y201cFlURVdNQlFHQTFVRUJ4TU5VMkZ1SUVaeQpZVzVqYVhOamJ6RVpNQmNHQTFVRUNoTVFiM0puTVM1bGVHRnRjR3hsTG1OdmJURWZNQjBHQTFVRUF4TVdkR3h6ClkyRXViM0puTVM1bGVHRnRjR3hsTG1OdmJUQWVGdzB5TURFeU1qUXhOVEl6TURCYUZ3MHpNREV5TWpJeE5USXoKTURCYU1IWXhDekFKQmdOVkJBWVRBbFZUTVJNd0VRWURWUVFJRXdwRFlXeHBabTl5Ym1saE1SWXdGQVlEVlFRSApFdzFUWVc0Z1JuSmhibU5wYzJOdk1Sa3dGd1lEVlFRS0V4QnZjbWN4TG1WNFlXMXdiR1V1WTI5dE1SOHdIUVlEClZRUURFeFowYkhOallTNXZjbWN4TG1WNFlXMXdiR1V1WTI5dE1Ga3dFd1lIS29aSXpqMENBUVlJS29aSXpqMEQKQVFjRFFnQUVxOHJNenpNeVhDVHlXU3RMaXcxNVEzTTE1RWdHbzFpSmdMQVgvR3ZOdUxxMTlKQ1NuMkpmZnkrcAo3cUpIWWN4WGMwUGVjdlFQaHhVa0VHOUkzS2UzaDZOdE1Hc3dEZ1lEVlIwUEFRSC9CQVFEQWdHbU1CMEdBMVVkCkpRUVdNQlFHQ0NzR0FRVUZCd01DQmdnckJnRUZCUWNEQVRBUEJnTlZIUk1CQWY4RUJUQURBUUgvTUNrR0ExVWQKRGdRaUJD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xd2JHVXVZMjl0TVJ3d0dnWURWUVFECkV4TmpZUzV2Y21jeExtVjRZVzF3YkdVdVkyOXRNRmt3RXdZSEtvWkl6ajBDQVFZSUtvWkl6ajBEQVFjRFFnQUUKWms4ZC9rRElyemxhWVY0cVdCL3V4Y1hiNDRhSzE5dUdXcWk1UEpsZjY3b0p3SHNidEF6REhuR0dlaVkvcWNMaApQVEQwZUhqOHQ1YkVCK24rVFhoOFNhTnRNR3N3RGdZRFZSMFBBUUgvQkFRREFnR21NQjBHQTFVZEpRUVdNQlFHCkNDc0dBUVVGQndNQ0JnZ3JCZ0VGQlFjREFUQVBCZ05WSFJNQkFmOEVCVEFEQVFIL01Da0dBMVVkRGdRaUJDQ0MKTHQ1dUFlWmZMQ1dRZi9HbjQxdTZaR3BnS0ZUaGNOd1NHbllraWF4OWN6QUtCZ2dxaGtqT1BRUURBZ05IQURCRQpBaUFsYUhoSVh0VFhHY2k0RjBsVTVtR1BEb3VqbWZwbm5USEFOVXoyRGUvSzRnSWdFZnMrRWE0eG9IR1pOUE45ClcyYzVwTjFhU3g1Mm5CTGFRQUhjWEkrME00bz0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=",
"enroll_id": "admin",
"enroll_secret": "adminpw"
},
{
"name": "orderer.example.com",
"api_url": "grpcs://orderer.example.com:7050",
"type": "fabric-orderer",
"msp_id": "OrdererMSP",
"pem": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNRekNDQWVxZ0F3SUJBZ0lSQUtNSmd3dkloS1IxamtndXhIYlE1eHd3Q2dZSUtvWkl6ajBFQXdJd2JERUwKTUFrR0ExVUVCaE1DVlZNeEV6QVJCZ05WQkFnVENrTmhiR2xtYjNKdWFXRXhGakFVQmdOVkJBY1REVk5oYmlCRwpjbUZ1WTJselkyOHhGREFTQmdOVkJBb1RDMlY0WVcxd2JHVXVZMjl0TVJvd0dBWURWUVFERXhGMGJITmpZUzVsCmVHRnRjR3hsTG1OdmJU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khTVUVGakFVCkJnZ3JCZ0VGQlFjREFnWUlLd1lCQlFVSEF3RXdEd1lEVlIwVEFRSC9CQVV3QXdFQi96QXBCZ05WSFE0RUlnUWcKazNkZUppd1cwZzl5SXU1eXVTVFR0YzN3bHdadlJyMEFJWHAwU0xycHd1TXdDZ1lJS29aSXpqMEVBd0lEUndBdwpSQUlnRmpGUXJjODk1UFN2TFZBcHhacGV6RUVpSzJsZjJuaC9PRWNoQVlUVWFZd0NJQ2FadmI4eDhhU2l0Qmx2Cmk3SEhyQlVBV0c5MUpCTXkyWTdWUjNRR0NmZ0YKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=",
"enroll_id": "admin",
"enroll_secret": "adminpw"
}
]
/etc/hosts
127.0.0.1 localhost peer0.org1.example.com peer1.org1.example.com peer0.org2.example.com peer1.org2.example.com orderer.example.com ca.org1.example.com ca.org2.example.com
...
问题是 TLS 证书将具有诸如“peer0.org1.example.com”之类的主机名,但您在节点文件中将远程主机声明为“localhost”,并且由于它们不匹配, TLS 连接将失败。它适用于连接配置文件的原因是它们可以选择指定主机名覆盖。
据我所知,您在区块链扩展节点文件中没有该选项。但是您可以通过更新主机 (/etc/hosts) 文件以将诸如 peer0.org1.example.com、peer1.org1.example.com 等名称映射到本地主机来轻松解决问题。然后您可以更改您的节点文件以使用预期的主机名而不是本地主机。
我是 运行 来自 fabric-samples 存储库的 BYFN 网络的本地实例,使用以下命令:
git checkout tags/v1.4.6
cd first-network
./byfn.sh up -a -n -i 1.4.6
然后我尝试使用我根据创建的网络创建的以下节点文件连接 IBP VS 代码扩展:
[
{
"name": "peer0.org1.example.com",
"api_url": "grpcs://localhost:7051",
"type": "fabric-peer",
"msp_id": "Org1MSP",
"pem": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNWekNDQWY2Z0F3SUJBZ0lSQU10NWtsWVhDbFJYaVYvVTJ6d0pvSEl3Q2dZSUtvWkl6ajBFQXdJd2RqRUwKTUFrR0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UVGakFVCkJnZ3JCZ0VGQlFjREFnWUlLd1lCQlFVSEF3RXdEd1lEVlIwVEFRSC9CQVV3QXdFQi96QXBCZ05WSFE0RUlnUWcKeUROYmovNk5rL3NSNmpmR1FFeFpnajY2S3VtUTQzR0hBL1NLZUtGUCt0Y3dDZ1lJS29aSXpqMEVBd0lEUndBdwpSQUlnQ2QyMnNMME90SDNtZnRDTmFPZzJNZlpQVHRjdEVqbkcwblRUdUlFMW1oUUNJRFdMSURhUmg2UmFhekhwCk9vWjRjVENpc3hiaU8xclI5eVUrMUg5aUdWL2IKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=",
"enroll_id": "admin",
"enroll_secret": "adminpw"
},
{
"name": "orderer.example.com",
"api_url": "grpcs://localhost:7050",
"type": "fabric-orderer",
"msp_id": "OrdererMSP",
"pem": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNRekNDQWVtZ0F3SUJBZ0lRUFp6Wld0L0pkT1BRZG9Sdjgwem5NekFLQmdncWhrak9QUVFEQWpCc01Rc3cKQ1FZRFZRUUdFd0pWVXpFVE1CRUdBMVVFQ0JNS1EyRnNhV1p2Y201cFlURVdNQlFHQTFVRUJ4TU5VMkZ1SUVaeQpZVzVqYVhOamJ6RVVNQklHQTFVRUNoTUxaWGhoYlhCc1pTNWpiMjB4R2pBWUJnTlZCQU1URVhSc2MyTmhMbVY0CllXMXdiR1V1WTI5dE1CNFhEVEl3TVRJeU16RTJOVFl3TUZvWERUTXdNVEl5TVRFMk5UWXdNRm93YkRFTE1Ba0cKQTFVRUJoTUNWVk14RXpBUkJnTlZCQWdUQ2tOaGJHbG1iM0p1YVdFeEZqQVVCZ05WQkFjVERWTmhiaUJHY21GdQpZMmx6WTI4eEZEQVNCZ05WQkFvVEMyVjRZVzF3YkdVdVkyOXRNUm93R0FZRFZRUURFeEYwYkhOallTNWxlR0Z0CmNHeGxMbU52YlRCWk1CTUdCeXFHU000OUFnRUdDQ3FHU000OU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tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=",
"enroll_id": "admin",
"enroll_secret": "adminpw"
}
]
peer*.org*.example.com
的 pem
是
first-network/crypto-config/peerOrganizations/org*.example.com/tlsca/tlsca.org*.example.com-cert.pem
orderer.example.com
的 pem
是
first-network/crypto-config/ordererOrganizations/example.com/tlsca/tlsca.example.com-cert.pem
ca.org*.example.com
的 pem
是
first-network/crypto-config/peerOrganizations/org*.example.com/ca/ca.org*.example.com-cert.pem
接下来,我通过在
中提供signcerts
和 keystore
文件来为 Org1、Org2 和 Orderer 创建钱包
first-network/crypto-config/(peer|orderer)Organizations/org*.example.com/users/Admin@org*.example.com/msp
对于 CA,我选择了选项 use ID and secret to enroll a new identity
以在 Org1 和 Org2 钱包中创建新身份。现在,当我尝试连接到环境时,扩展给出了以下错误:
Error connecting to environment Byfn: Error querying channels: 14 UNAVAILABLE: failed to connect to all addresses
顺便说一句,我可以导入 connection-org*.json
文件来创建新网关并在扩展中查看通道,但无法为 install/instantiate 新创建新环境链码。
扩展版本:v1.0.40
如何解决此问题并将 VS Code 扩展连接到我的本地 BYFN 网络?
下面@david_k提到的解决方案有效。为了完整起见,这是我更新的文件:
nodes.json
[
{
"name": "peer0.org1.example.com",
"api_url": "grpcs://peer0.org1.example.com:7051",
"type": "fabric-peer",
"msp_id": "Org1MSP",
"pem": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNWakNDQWYyZ0F3SUJBZ0lRVHk2dUNOTW9Xclc5VHMzdW55dDVHekFLQmdncWhrak9QUVFEQWpCMk1Rc3cKQ1FZRFZRUUdFd0pWVXpFVE1CRUdBMVVFQ0JNS1EyRnNhV1p2Y201cFlURVdNQlFHQTFVRUJ4TU5VMkZ1SUVaeQpZVzVqYVhOamJ6RVpNQmNHQTFVRUNoTVFiM0puTVM1bGVHRnRjR3hsTG1OdmJURWZNQjBHQTFVRUF4TVdkR3h6ClkyRXViM0puTVM1bGVHRnRjR3hsTG1OdmJUQ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aUFsYUhoSVh0VFhHY2k0RjBsVTVtR1BEb3VqbWZwbm5USEFOVXoyRGUvSzRnSWdFZnMrRWE0eG9IR1pOUE45ClcyYzVwTjFhU3g1Mm5CTGFRQUhjWEkrME00bz0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=",
"enroll_id": "admin",
"enroll_secret": "adminpw"
},
{
"name": "orderer.example.com",
"api_url": "grpcs://orderer.example.com:7050",
"type": "fabric-orderer",
"msp_id": "OrdererMSP",
"pem": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNRekNDQWVxZ0F3SUJBZ0lSQUtNSmd3dkloS1IxamtndXhIYlE1eHd3Q2dZSUtvWkl6ajBFQXdJd2JERUwKTUFrR0ExVUVCaE1DVlZNeEV6QVJCZ05WQkFnVENrTmhiR2xtYjNKdWFXRXhGakFVQmdOVkJBY1REVk5oYmlCRwpjbUZ1WTJselkyOHhGREFTQmdOVkJBb1RDMlY0WVcxd2JHVXVZMjl0TVJvd0dBWURWUVFERXhGMGJITmpZUzVsCmVHRnRjR3hsTG1OdmJUQWVGdzB5TURFeU1qUXhOVEl6TURCYUZ3MHpNREV5TWpJeE5USXpNREJhTUd3eEN6QUoKQmdOVkJBWVRBbFZUTVJNd0VRWURWUVFJRXdwRFlXeHBabTl5Ym1saE1SWXdGQVlEVlFRSEV3MVRZVzRnUm5KaApibU5wYzJOdk1SUXdFZ1lEVlFRS0V3dGxlR0Z0Y0d4bExtTnZiVEVhTUJnR0ExVUVBeE1SZEd4elkyRXVaWGhoCmJYQnNaUzVqYjIwd1dUQVRCZ2NxaGtqT1BRSUJCZ2dxaGtqT1BRTUJCd05DQUFSVHY4TEFreldqelp0V3N3THcKNERiNnhZa3MrNlhEa2JmWE9jdEVmWTcwVUZDdmJFUEk3MmwvRGlwdnVQR29kL1VkWjF4Q3Freitoc1hBMGhqYwo2Y0JybzIwd2F6QU9CZ05WSFE4QkFmOEVCQU1DQWFZd0hRWURWUjBsQkJZ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HhHVEFYQmdOVkJBb1RFRzl5WnpJdVpYaGhiWEJzWlM1amIyMHhIREFhQmdOVkJBTVRFMk5oCkxtOXlaekl1WlhoaGJYQnNaUzVqYjIwd0hoY05NakF4TWpJME1UVXlNekF3V2hjTk16QXhNakl5TVRVeU16QXcKV2pCek1Rc3dDUVlEVlFRR0V3SlZVekVUTUJFR0ExVUVDQk1LUTJGc2FXWnZjbTVwWVRFV01CUUdBMVVFQnhNTgpVMkZ1SUVaeVlXNWphWE5qYnpFWk1CY0dBMVVFQ2hNUWIzSm5NaTVsZUdGdGNHeGxMbU52YlRFY01Cb0dBMVVFCkF4TVRZMkV1YjNKbk1pNWxlR0Z0Y0d4bExtTnZiVEJaTUJNR0J5cUdTTTQ5QWdFR0NDcUdTTTQ5QXdFSEEwSUEKQkVoMExpTTZjS1ZkK1I4K0krNHRSbk1hK3owT1JRbFQ2V2VyS2szaU1RNTgzc0J5WlBDQ2kreWRWZkQ3RFhoOQoyLzArSlhFNld3clVCMW9ZUHVWeDNBZWpiVEJyTUE0R0ExVWREd0VCL3dRRUF3SUJwakFkQmdOVkhTVUVGakFVCkJnZ3JCZ0VGQlFjREFnWUlLd1lCQlFVSEF3RXdEd1lEVlIwVEFRSC9CQVV3QXdFQi96QXBCZ05WSFE0RUlnUWcKazNkZUppd1cwZzl5SXU1eXVTVFR0YzN3bHdadlJyMEFJWHAwU0xycHd1TXdDZ1lJS29aSXpqMEVBd0lEUndBdwpSQUlnRmpGUXJjODk1UFN2TFZBcHhacGV6RUVpSzJsZjJuaC9PRWNoQVlUVWFZd0NJQ2FadmI4eDhhU2l0Qmx2Cmk3SEhyQlVBV0c5MUpCTXkyWTdWUjNRR0NmZ0YKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=",
"enroll_id": "admin",
"enroll_secret": "adminpw"
}
]
/etc/hosts
127.0.0.1 localhost peer0.org1.example.com peer1.org1.example.com peer0.org2.example.com peer1.org2.example.com orderer.example.com ca.org1.example.com ca.org2.example.com
...
问题是 TLS 证书将具有诸如“peer0.org1.example.com”之类的主机名,但您在节点文件中将远程主机声明为“localhost”,并且由于它们不匹配, TLS 连接将失败。它适用于连接配置文件的原因是它们可以选择指定主机名覆盖。
据我所知,您在区块链扩展节点文件中没有该选项。但是您可以通过更新主机 (/etc/hosts) 文件以将诸如 peer0.org1.example.com、peer1.org1.example.com 等名称映射到本地主机来轻松解决问题。然后您可以更改您的节点文件以使用预期的主机名而不是本地主机。