无法注册管理员用户:错误:调用注册端点失败,错误 [错误:套接字挂断]

时间:2021-02-03 07:04:00

标签: hyperledger-fabric hyperledger

当我尝试在 Hyperledger Fabric 2.3 版本中运行应用程序时遇到问题。 参考链接:hyperledger-fabric.readthedocs/test-network/2.3

  • 命令
DELETE index-name

我成功地创建了频道,甚至在 javascript 中部署了链代码,每个组织下有 2 个组织和 2 个对等节点,以及 2 个用户:admin 和 user1。

Ubuntu 版本:18.04
织物版本:2.3.x

ErrorImage

有人可以回答这个问题吗?

1 个答案:

答案 0 :(得分:0)

看你的命令,在注册admin客户端的过程中出现了错误。
这个过程是一个从 Fabric-CA 请求 enroll 的命令,Fabric-CA 必须启动。

但是,在您输入的命令 ./network.sh up createChannel 的情况下,Fabric-CA 未启动。
您需要添加一个参数选项来启动 Fabric-CA。

查看 ./network.sh 的命令用法

Usage:
  network.sh <Mode> [Flags]
    Modes:
      up - Bring up Fabric orderer and peer nodes. No channel is created
      up createChannel - Bring up fabric network with one channel
      createChannel - Create and join a channel after the network is created
      deployCC - Deploy a chaincode to a channel (defaults to asset-transfer-basic)
      down - Bring down the network

    Flags:
    Used with network.sh up, network.sh createChannel:
    -ca <use CAs> -  Use Certificate Authorities to generate network crypto material
    -c <channel name> - Name of channel to create (defaults to "mychannel")
    -s <dbtype> - Peer state database to deploy: goleveldb (default) or couchdb
    -r <max retry> - CLI times out after certain number of attempts (defaults to 5)
    -d <delay> - CLI delays for a certain number of seconds (defaults to 3)
    -i <imagetag> - Docker image tag of Fabric to deploy (defaults to "latest")
    -cai <ca_imagetag> - Docker image tag of Fabric CA to deploy (defaults to "latest")
    -verbose - Verbose mode

    Used with network.sh deployCC
    -c <channel name> - Name of channel to deploy chaincode to
    -ccn <name> - Chaincode name.
    -ccl <language> - Programming language of the chaincode to deploy: go (default), java, javascript, typescript
    -ccv <version>  - Chaincode version. 1.0 (default), v2, version3.x, etc
    -ccs <sequence>  - Chaincode definition sequence. Must be an integer, 1 (default), 2, 3, etc
    -ccp <path>  - File path to the chaincode.
    -ccep <policy>  - (Optional) Chaincode endorsement policy using signature policy syntax. The default policy requires an endorsement from Org1 and Org2
    -cccg <collection-config>  - (Optional) File path to private data collections configuration file
    -cci <fcn name>  - (Optional) Name of chaincode initialization function. When a function is provided, the execution of init will be requested and the function will be invoked.

    -h - Print this message

 Possible Mode and flag combinations
   up -ca -r -d -s -i -cai -verbose
   up createChannel -ca -c -r -d -s -i -cai -verbose
   createChannel -c -r -d -verbose
   deployCC -ccn -ccl -ccv -ccs -ccp -cci -r -d -verbose

 Examples:
   network.sh up createChannel -ca -c mychannel -s couchdb -i 2.0.0
   network.sh createChannel -c channelName
   network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-javascript/ -ccl javascript
   network.sh deployCC -ccn mychaincode -ccp ./user/mychaincode -ccv 1 -ccl javascript

所以,尝试使用下面的命令构建一个测试网络

./network.sh up createChannel -ca