错误:[Channel.js]:频道:mychannel收到发现错误:访问被拒绝

时间:2019-08-03 08:52:39

标签: hyperledger-fabric

在hypeledger-samples fabcar示例中运行命令节点query.js时出现错误。

root @ ubcourt:/ home / fabric-samples / fabcar / javascript#节点query.js

钱包路径:/ home / fabric-samples / fabcar / javascript / wallet 2019-08-03T08:45:31.027Z-错误:[Channel.js]:频道:mychannel收到发现错误:访问被拒绝

2019-08-03T08:45:31.028Z-错误:[Channel.js]:错误:频道:我的频道发现错误:访问被拒绝

2019-08-03T08:45:31.040Z-错误:[Channel.js]:频道:mychannel收到发现错误:访问被拒绝

2019-08-03T08:45:31.040Z-错误:[Channel.js]:错误:频道:我的频道发现错误:访问被拒绝

2019-08-03T08:45:31.042Z-错误:[网络]:_initializeInternalChannel:无法初始化频道。尝试联系2个对等方。最后一个错误是错误:频道:mychannel发现错误:访问被拒绝     在Channel._discover(/home/fabric-samples/fabcar/javascript/node_modules/fabric-client/lib/Channel.js:1272:11)     在异步Channel._initialize(/home/fabric-samples/fabcar/javascript/node_modules/fabric-client/lib/Channel.js:291:32)     在异步Channel.initialize(/home/fabric-samples/fabcar/javascript/node_modules/fabric-client/lib/Channel.js:244:14)     在异步Network._initializeInternalChannel(/home/fabric-samples/fabcar/javascript/node_modules/fabric-network/lib/network.js:105:5)     在异步Network._initialize(/home/fabric-samples/fabcar/javascript/node_modules/fabric-network/lib/network.js:130:3)     在异步Gateway.getNetwork(/home/fabric-samples/fabcar/javascript/node_modules/fabric-network/lib/gateway.js:287:3)     在异步主目录(/home/fabric-samples/fabcar/javascript/query.js:33:25) 无法评估事务:错误:无法初始化通道。尝试联系2个对等方。最后一个错误是错误:频道:mychannel发现错误:访问被拒绝     在Channel._discover(/home/fabric-samples/fabcar/javascript/node_modules/fabric-client/lib/Channel.js:1272:11)     在异步Channel._initialize(/home/fabric-samples/fabcar/javascript/node_modules/fabric-client/lib/Channel.js:291:32)     在异步Channel.initialize(/home/fabric-samples/fabcar/javascript/node_modules/fabric-client/lib/Channel.js:244:14)     在异步Network._initializeInternalChannel(/home/fabric-samples/fabcar/javascript/node_modules/fabric-network/lib/network.js:105:5)     在异步Network._initialize(/home/fabric-samples/fabcar/javascript/node_modules/fabric-network/lib/network.js:130:3)     在异步Gateway.getNetwork(/home/fabric-samples/fabcar/javascript/node_modules/fabric-network/lib/gateway.js:287:3)     在异步主服务器上(/home/fabric-samples/fabcar/javascript/query.js:33:25)

2 个答案:

答案 0 :(得分:2)

尝试取出钱包,然后重新注册管理员和用户。在/ fabcar / javascript目录中:

rm -r ./wallet
node enrollAdmin.js
node registerUser.js
node query.js

如果这不起作用,您可以尝试以下说明: https://hyperledger-fabric.readthedocs.io/en/release-1.4/write_first_app.html 并停止网络(在/ first-network目录中):

./byfn.sh down 
docker rm -f $(docker ps -aq)
docker rmi -f $(docker images | grep fabcar | awk '{print $3}')

答案 1 :(得分:0)

这可能是由于对等方离开频道或与其相关的一些错误而发生的。

尝试列出频道中的同行,看看您是否在那里

peer channel list

如果没有再添加

peer join channel -b <my-channel-name>.block