对于每个this链接,我们正在尝试从docker容器内部使用以下命令在dev模式下运行nodejs链代码
CORE_PEER_TLS_ENABLED=false CORE_CHAINCODE_LOGLEVEL=debug CORE_CHAINCODE_ID_NAME="mycc:1.0" /usr/local/bin/node --inspect chaincode.js --peer.address peer1-jnj:7052
但出现此错误:
2018-12-31T21:32:51.807Z INFO [lib/chaincode.js] Registering with peer peer1-jnj:7052 as chaincode "mycc:1.0"
2018-12-31T21:32:51.814Z ERROR [lib/handler.js] Chat stream with peer - on error: "Error: 14 UNAVAILABLE: EOF\n at createStatusError (/usr/local/src/node_modules/grpc/src/client.js:64:15)\n at ClientDuplexStream._emitStatusIfDone (/usr/local/src/node_modules/grpc/src/client.js:270:19)\n at ClientDuplexStream._receiveStatus (/usr/local/src/node_modules/grpc/src/client.js:248:8)\n at /usr/local/src/node_modules/grpc/src/client.js:804:12"
这是怎么了?我们该如何解决?
答案 0 :(得分:0)
这里的问题是我们在同级上启用了TLS。对等节点上的CORE_PEER_TLS_ENABLED=true
。只有当我们完全禁用TLS后,它才能起作用。
##### 2019-01-03 23:34:35 CORE_PEER_TLS_ENABLED=false CORE_CHAINCODE_LOGLEVEL=debug CORE_CHAINCODE_ID_NAME="mycc:1.0" /usr/local/bin/node --inspect chaincode.js --peer.address peer1-jnj:7052
Debugger listening on ws://127.0.0.1:9229/5e03e0d1-08c4-48f5-b08f-7fb62e76bf70
For help see https://nodejs.org/en/docs/inspector
2019-01-03T23:34:35.796Z INFO [lib/chaincode.js] Registering with peer peer1-jnj:7052 as chaincode "mycc:1.0"
2019-01-03T23:34:35.804Z INFO [lib/handler.js] Successfully registered with peer node. State transferred to "established"
2019-01-03T23:34:35.805Z INFO [lib/handler.js] Successfully established communication with peer node. State transferred to "ready"