Hyperledger fabric 无法实例化余额转账应用程序的链码

Hyperledger fabric 无法实例化余额转账应用程序的链码,hyperledger-fabric,Hyperledger Fabric,我尝试按照这些步骤实例化链代码。请注意,我正在使用NodeJs(下面省略了我的实际令牌): 我已经贴满了日志。有人能帮我解决这个问题吗?我按照之前的所有步骤进行操作,没有遇到任何问题: 注册用户Jim 创建频道 将Org1中的对等方加入通道 在Org1中的对等机上安装链码 此外,我还可以看到一个名为dev-peer0.org1.example.com-mycc-v0的容器,它与调试日志一起表明链码是在peer0上实例化的,但为什么它没有在peer1上实例化呢 这些端口在中的含义是什么 我今天

我尝试按照这些步骤实例化链代码。请注意,我正在使用NodeJs(下面省略了我的实际令牌):

我已经贴满了日志。有人能帮我解决这个问题吗?我按照之前的所有步骤进行操作,没有遇到任何问题:

  • 注册用户Jim
  • 创建频道
  • 将Org1中的对等方加入通道
  • 在Org1中的对等机上安装链码
此外,我还可以看到一个名为
dev-peer0.org1.example.com-mycc-v0
的容器,它与调试日志一起表明链码是在peer0上实例化的,但为什么它没有在peer1上实例化呢

这些端口在中的含义是什么


我今天再次尝试了它,并对其进行了如下修改:

curl -s -X POST \
  http://localhost:4000/channels/mychannel/chaincodes \
  -H "authorization: Bearer <put JSON Web Token here>" \
  -H "content-type: application/json" \
  -d '{
    "peers": ["peer1.org1.example.com"],
    "chaincodeName":"mycc",
    "chaincodeVersion":"v0",
    "chaincodeType": "node",
    "args":["a","100","b","200"]
}'
节点内应用程序终端:

[2018-11-15 22:12:26.463] [INFO] instantiate-chaincode - The chaincode instantiate transaction has been committed on peer localhost:7051
[2018-11-15 22:12:26.463] [INFO] instantiate-chaincode - Transaction 979eeb030e6adf9689f39163192fbb9bcba00e6942ef4d1ea6de10d982d234fe has status of VALID in blocl 1
[2018-11-15 22:12:26.464] [INFO] instantiate-chaincode - The chaincode instantiate transaction was valid.
[2018-11-15 22:12:26.464] [DEBUG] instantiate-chaincode - ------->>> R E S P O N S E : ["The chaincode instantiate transaction was valid.",{"status":"SUCCESS","info":""}]
[2018-11-15 22:12:26.465] [INFO] instantiate-chaincode - Successfully sent transaction to the orderer.
[2018-11-15 22:12:26.467] [DEBUG] instantiate-chaincode - Event results for event hub :localhost:7051
[2018-11-15 22:12:26.468] [DEBUG] instantiate-chaincode - The chaincode instantiate transaction was valid.
[2018-11-15 22:12:26.468] [INFO] instantiate-chaincode - Successfully instantiate chaincode in organization Org1 to the channel 'mychannel'
我不知道为什么昨天失败了,今天成功了

另外,当我今天最初发出
curl
请求时,它失败了,因为JWT令牌已经过期。为了刷新令牌,我向
/users
端点发出了一个请求,就像我昨天注册用户一样(这次用户已经注册了除外)

以下显示了容器:

$ docker ps --format '{{.Names}}'
dev-peer1.org1.example.com-mycc-v0
dev-peer0.org1.example.com-mycc-v0
peer1.org2.example.com
peer0.org2.example.com
peer0.org1.example.com
peer1.org1.example.com
ca_peerOrg1
ca_peerOrg2
orderer.example.com
以及来自实例化链码的容器的日志: $docker日志-f dev-peer1.org1.example.com-mycc-v0

> example_cc@1.0.0 start /usr/local/src
> node example_cc.js "--peer.address" "peer1.org1.example.com:7052"

E1115 22:12:23.956612869      17 ssl_transport_security.cc:238] Could not get common name of subject from certificate.
========= example_cc Init =========
{ fcn: 'node', params: [ 'a', '100', 'b', '200' ] }

您是否移除了所有以前运行的容器?是的,我移除了……相关:
{"success":true,"message":"Successfully instantiate chaincode in organization Org1 to the channel 'mychannel'"}
[2018-11-15 22:12:26.463] [INFO] instantiate-chaincode - The chaincode instantiate transaction has been committed on peer localhost:7051
[2018-11-15 22:12:26.463] [INFO] instantiate-chaincode - Transaction 979eeb030e6adf9689f39163192fbb9bcba00e6942ef4d1ea6de10d982d234fe has status of VALID in blocl 1
[2018-11-15 22:12:26.464] [INFO] instantiate-chaincode - The chaincode instantiate transaction was valid.
[2018-11-15 22:12:26.464] [DEBUG] instantiate-chaincode - ------->>> R E S P O N S E : ["The chaincode instantiate transaction was valid.",{"status":"SUCCESS","info":""}]
[2018-11-15 22:12:26.465] [INFO] instantiate-chaincode - Successfully sent transaction to the orderer.
[2018-11-15 22:12:26.467] [DEBUG] instantiate-chaincode - Event results for event hub :localhost:7051
[2018-11-15 22:12:26.468] [DEBUG] instantiate-chaincode - The chaincode instantiate transaction was valid.
[2018-11-15 22:12:26.468] [INFO] instantiate-chaincode - Successfully instantiate chaincode in organization Org1 to the channel 'mychannel'
curl -s -X POST http://localhost:4000/users -H "content-type: application/x-www-form-urlencoded" -d 'username=Jim&orgName=Org1'
$ docker ps --format '{{.Names}}'
dev-peer1.org1.example.com-mycc-v0
dev-peer0.org1.example.com-mycc-v0
peer1.org2.example.com
peer0.org2.example.com
peer0.org1.example.com
peer1.org1.example.com
ca_peerOrg1
ca_peerOrg2
orderer.example.com
> example_cc@1.0.0 start /usr/local/src
> node example_cc.js "--peer.address" "peer1.org1.example.com:7052"

E1115 22:12:23.956612869      17 ssl_transport_security.cc:238] Could not get common name of subject from certificate.
========= example_cc Init =========
{ fcn: 'node', params: [ 'a', '100', 'b', '200' ] }