Hyperledger fabric Hyperledger结构中的共享基础结构

Hyperledger fabric Hyperledger结构中的共享基础结构,hyperledger-fabric,hyperledger,hyperledger-chaincode,hyperledger-fabric-ca,Hyperledger Fabric,Hyperledger,Hyperledger Chaincode,Hyperledger Fabric Ca,我正在检查一个用例,看它是否可以共享对等点、调用链码函数以及使用不同的MSP执行事务。这是一个使用案例,其中一些不愿意在基础设施上投资但可能希望使用网络运营商运行的区块链网络的组织需要共享环境 例如,具有MSPorg1的网络运营商创建Hyperledger结构网络org4想要加入网络,但没有任何对等方。CA容器将用于此org4。org4identity是否可以在org1对等方上调用事务? 实际上我试过这个。检查以下rest客户端的日志: [Service Discovery Turned On]

我正在检查一个用例,看它是否可以共享对等点、调用链码函数以及使用不同的MSP执行事务。这是一个使用案例,其中一些不愿意在基础设施上投资但可能希望使用网络运营商运行的区块链网络的组织需要共享环境

例如,具有MSP
org1
的网络运营商创建Hyperledger结构网络
org4
想要加入网络,但没有任何对等方。CA容器将用于此
org4
org4
identity是否可以在
org1
对等方上调用事务? 实际上我试过这个。检查以下rest客户端的日志:

[Service Discovery Turned On]
2021-04-02T04:19:27.643Z - debug: [Channel]: _getServiceEndpoints - start - org4
2021-04-02T04:19:27.643Z - debug: [Channel]: _getServiceEndpoints - Endorser mspid not matched, not added peer0.org1.com:7051 - org1
2021-04-02T04:19:27.643Z - debug: [Channel]: _getServiceEndpoints - Endorser mspid not matched, not added peer1.org1.com:7051 - org1
2021-04-02T04:19:27.643Z - debug: [Channel]: _getServiceEndpoints - Endorser mspid not matched, not added peer1.networkoperator.com:7051 - networkoperator
2021-04-02T04:19:27.643Z - debug: [Channel]: _getServiceEndpoints - Endorser mspid not matched, not added peer0.networkoperator.com:7051 - networkoperator
2021-04-02T04:19:27.643Z - debug: [Channel]: _getServiceEndpoints - Endorser mspid not matched, not added peer0.org2.com:7051 - org2
2021-04-02T04:19:27.643Z - debug: [Channel]: _getServiceEndpoints - Endorser mspid not matched, not added peer1.org2.com:7051 - org2
2021-04-02T04:19:27.643Z - debug: [Channel]: _getServiceEndpoints - Endorser mspid not matched, not added peer0.org3.com:7051 - org3
2021-04-02T04:19:27.643Z - debug: [Channel]: _getServiceEndpoints - Endorser mspid not matched, not added peer1.org3.com:7051 - org3
2021-04-02T04:19:27.643Z - debug: [RoundRobinQueryHandler]: constructor: peers=[]
上面的日志显示rest客户端试图将MSP id与对等方匹配

没有服务发现的日志:

[Service Discovery Turned Off]
2021-04-02T04:39:11.091Z - debug: [Channel]: _getServiceEndpoints - start - org4
2021-04-02T04:39:11.091Z - debug: [Channel]: _getServiceEndpoints - Endorser mspid not matched, not added peer0.org1.com - org1
2021-04-02T04:39:11.091Z - debug: [Channel]: _getServiceEndpoints - Endorser mspid not matched, not added peer1.org1.com - org1
2021-04-02T04:39:11.091Z - debug: [RoundRobinQueryHandler]: constructor: peers=[]

通常,这些组织将加入共享基础架构,当它们准备好使用自己的基础架构时,它们将迁移到该基础架构。同时,他们将通过自己的身份调用链码函数。在这种情况下,org4将仅使用网络运营商提供给它的加密材料连接到网络并调用链码。下面的内容对我来说没有意义

org4标识是否可以在org1对等方上调用事务

据我所知,只要您有cyrpto资料连接到HLF,并且您有正确的连接配置文件,org4运行的HLF客户端将最终向所有对等方发布事务,在HLF客户端检查模拟结果,然后将事务发送给订购方,以便将其提交到对等方


因此,在您的例子中,我们将创建一个新用户供org4使用,然后org4将使用该加密材料来调用链码。任何组织提交的事务最终都会被所有参与组织的基础设施执行,因此有人不想贡献infra,他们将只使用加密材料连接到HLF网络,而不添加和重用对等方上的现有链码。

fabric sdk试图将调用方的MSP ID与可用的背书方的MSP ID进行匹配,但由于没有与调用方的MSP ID匹配的对等方,整个事务失败。我必须禁用服务发现,将特定对等点添加到目标对等点列表中,以使其正常工作

一些代码:

const endorsingPeers = channel.getEndorsers('org1');

if (endorsingPeers.length > 0) transaction = transaction.setEndorsingPeers(endorsingPeers);
    
const response_payloads = await  transaction.evaluate(JSON.stringify(args))

没有对等方的组织肯定可以调用事务,只要它们已添加到适当的通道中。您是否将
org4
添加到所有相关频道?是的,@GariSingh。我已将该组织添加到频道中。我正在使用HLF 2.3.1您可以发布更多的客户端代码吗?不确定您具体使用了哪些功能calling@GariSingh我检查了对等日志
2021-04-04 15:24:10.447 UTC[policies]SignatureSetToValidEntities->WARN 65875无效标识:证书主体=CN=管理员,OU=客户端序列号=5293412609816492803525273063095564239165763549342错误=“提供的标识无效:x509:由未知授权机构签署的证书”
org4标识正在向org1的对等方发送事务,而这些对等方正在抛出上述警告