背景: 我已经修改了第一个网络文件(到一个网络,其中每个都有 2 个组织和 1 个对等点)并在其上安装了我自己的链代码。此外,我制作了一个 connection.yaml 文件来与网络进行交互。
问题: 但是当我尝试从nodeSDK获取网络通道并建立网关时,我遇到了这个错误:
错误:[网络]:_initializeInternalChannel:无法初始化通道。尝试联系 2 个 Peers。最后一个错误是错误:2 未知:流已删除
无法评估交易:错误:无法初始化通道。尝试联系 2 个 Peers。最后一个错误是错误:2 未知:流已删除
您可以在下面找到我的客户端的代码。gateway.getNetwork('mychannel')执行时可能会出现错误。
let connectionProfile = yaml.safeLoad(fs.readFileSync('./connection.yaml', 'utf8'));
// Create a new gateway for connecting to our peer node.
const gateway = new Gateway();
await gateway.connect(connectionProfile, { wallet, identity: 'user1', discovery: { enabled: false } });
// Get the network (channel) our contract is deployed to.
const network = await gateway.getNetwork('mychannel');
// Get the contract from the network.
const contract …Run Code Online (Sandbox Code Playgroud) blockchain hyperledger hyperledger-fabric hyperledger-fabric-sdk-js