如何解决如何使用Java SDK向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 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,orderer,hfClient.getUpdateChannelConfigurationSignature(updateChannelConfiguration,org1Admin),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;
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。