我正在使用Java sdk并在初始化频道时收到错误消息。
Channel mychannel = fabClient.getInstance().newChannel(Config.CHANNEL_NAME);
Orderer orderer = fabClient.getInstance().newOrderer(Config.ORDERER_NAME, Config.ORDERER_URL);
Peer peer0_org1 = fabClient.getInstance().newPeer(Config.ORG1_PEER_0, Config.ORG1_PEER_0_URL);
Peer peer1_org1 = fabClient.getInstance().newPeer(Config.ORG1_PEER_1, Config.ORG1_PEER_1_URL);
mychannel.addOrderer(orderer);
mychannel.addPeer(peer0_org1);
mychannel.addPeer(peer1_org1);
mychannel.initialize();
我收到以下错误。
ERROR Channel - Sending proposal to peer0.org1.example.com failed because of: gRPC failure=Status{code=UNKNOWN, description=access denied: channel [mychannel] creator org [Org1MSP], cause=null}
java.lang.Exception: io.grpc.StatusRuntimeException: UNKNOWN: access denied: channel [mychannel] creator org [Org1MSP]
Caused by: org.hyperledger.fabric.sdk.exception.TransactionException: org.hyperledger.fabric.sdk.exception.ProposalException: getConfigBlock for channel mychannel failed with peer peer1.org1.example.com. Status FAILURE, details: Sending proposal to peer1.org1.example.com failed because of: gRPC failure=Status{code=UNKNOWN, description=access denied: channel [mychannel] creator org [Org1MSP], cause=null}
答案 0 :(得分:0)
这表明Fabric CA Server用于颁发证书的签名CA证书与用于进行授权检查的MSP的cacerts或middlecerts文件夹中的证书不匹配。
用于进行授权检查的MSP取决于发生错误时要执行的操作。例如,如果您尝试在对等方上安装链码,则使用对等方文件系统上的本地MSP;否则,将使用对等方的本地MSP。否则,如果您要执行某些特定于通道的操作,例如在特定通道上实例化链码,则使用该通道的创始块或最新配置块中的MSP。
发生这种情况有多种原因,包括: