Hyperledger fabric 如何使用JavaSDK向fabric添加新组织?

Hyperledger fabric 如何使用JavaSDK向fabric添加新组织?,hyperledger-fabric,Hyperledger Fabric,我正在使用Java SDK添加新组织org3,但客户端显示错误: Channel mychannel orderer orderer.example.com:7050 status returned failure code 400 (BAD_REQUEST) during orderer next 订购方的docker日志如下所示: 2020-10-26 02:18:46.034 UTC [orderer.common.broadcast] ProcessMessage -> WARN

我正在使用Java SDK添加新组织org3,但客户端显示错误:

Channel mychannel orderer orderer.example.com:7050 status returned failure code 400 (BAD_REQUEST) during orderer next
订购方的docker日志如下所示:

2020-10-26 02:18:46.034 UTC [orderer.common.broadcast] ProcessMessage -> WARN 0d7 [channel: mychannel] Rejecting broadcast of config message from 218.2.115.178:33464 because of error: error applying config update to existing channel 'mychannel': error authorizing update: error validating DeltaSet: policy for [Group]  /Channel/Application not satisfied: implicit policy evaluation failed - 0 sub-policies were satisfied, but this policy requires 2 of the 'Admins' sub-policies to be satisfied
2020-10-26 02:18:46.034 UTC [comm.grpc.server] 1 -> INFO 0d8 streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Broadcast grpc.peer_address=218.2.115.178:33464 grpc.code=OK grpc.call_duration=6.128592ms
更新通道的代码如下所示:

2020-10-26 02:18:46.034 UTC [orderer.common.broadcast] ProcessMessage -> WARN 0d7 [channel: mychannel] Rejecting broadcast of config message from 218.2.115.178:33464 because of error: error applying config update to existing channel 'mychannel': error authorizing update: error validating DeltaSet: policy for [Group]  /Channel/Application not satisfied: implicit policy evaluation failed - 0 sub-policies were satisfied, but this policy requires 2 of the 'Admins' sub-policies to be satisfied
2020-10-26 02:18:46.034 UTC [comm.grpc.server] 1 -> INFO 0d8 streaming call completed grpc.service=orderer.AtomicBroadcast grpc.method=Broadcast grpc.peer_address=218.2.115.178:33464 grpc.code=OK grpc.call_duration=6.128592ms
hfClient.setUserContext(orderAdmin);
// 更新通道配置提交
channel.updateChannelConfiguration(updateChannelConfiguration、Order、,
hfClient.GetUpdateChannelConfiguration签名(updateChannelConfiguration,org1Admin),
hfClient.getUpdateChannelConfiguration签名(updateChannelConfiguration,org2Admin));
这样创建了三个管理员,FabricUser继承了User类,我直接用私钥复制了证书并设置了Enrollment属性

  private User getAdmin(String name, byte[] pk, byte[] cert, String mspId) throws IOException {
        String certificate = new String(cert);
        PrivateKey privateKey = MyUtil.getPrivateKeyFromBytes(pk);
        FabricUser user = new FabricUser(name, privateKey, certificate);
        user.setMspId(mspId);
        return user;
    }

您可以点击此链接,链接: