无法从Hyperledger Composer Playground下载卡

时间:2018-02-25 11:19:48

标签: hyperledger hyperledger-composer

我正在尝试从Playground用户界面导出我的网络管理员卡,但导出图标已禁用。另外,我在Chrome控制台中看到以下错误:

错误:必须激活当前标识,名称为“admin”,标识符为“ddae16d6f23947e9349627051b8ca5933cef53d2918f52295352d7dd24cdabcb”。

如何从Playground导出网络管理员卡?

这是完整的Firefox日志:

Establishing admin connection ...
main.d12285adf00f2401cf60.bundle.js:1:346887
@JS : ModelManager            :addSystemModels()        [object Object] 
main.d12285adf00f2401cf60.bundle.js:1:848811
@JS : Resolver                :resolveRelationship()    Failed to resolve relationship [object Object]
main.d12285adf00f2401cf60.bundle.js:1:848759
@JS : IdentityManager         :<ResourceManager>()      Binding in the tx names and impl 
main.d12285adf00f2401cf60.bundle.js:1:848811
@JS : EngineTransactions      :createHistorianRecord()  created historian record 
main.d12285adf00f2401cf60.bundle.js:1:848811
@JS : Resolver                :resolveRelationship()    Failed to resolve relationship [object Object]
main.d12285adf00f2401cf60.bundle.js:1:848759
@JS : EngineTransactions      :createHistorianRecord()  created historian record 
main.d12285adf00f2401cf60.bundle.js:1:848811
@JS : Resolver                :resolveRelationship()    Failed to resolve relationship [object Object]
main.d12285adf00f2401cf60.bundle.js:1:848759
@JS : EngineTransactions      :createHistorianRecord()  created historian record 
main.d12285adf00f2401cf60.bundle.js:1:848811
@JS : ConnectionProfileManager:getConnectionManagerByTy Looking up a connection manager for type web
main.d12285adf00f2401cf60.bundle.js:1:848811
Establishing admin connection ...
main.d12285adf00f2401cf60.bundle.js:1:346887
@JS : ConnectionProfileManager:getConnectionManagerByTy Looking up a connection manager for type web
main.d12285adf00f2401cf60.bundle.js:1:848811
@JS : IdentityManager         :validateIdentity()       Error: The current identity, with the name 'admin' and the identifier 'ddae16d6f23947e9349627051b8ca5933cef53d2918f52295352d7dd24cdabcb', must be activated (ACTIVATION_REQUIRED) 
main.d12285adf00f2401cf60.bundle.js:1:848759
@JS : Engine                  :query()                  Caught error, rethrowing [object Object]
main.d12285adf00f2401cf60.bundle.js:1:848759
@JS : IdentityManager         :validateIdentity()       Error: The current identity, with the name 'admin' and the identifier 'ddae16d6f23947e9349627051b8ca5933cef53d2918f52295352d7dd24cdabcb', must be activated (ACTIVATION_REQUIRED) 
main.d12285adf00f2401cf60.bundle.js:1:848759
@JS : IdentityManager         :<ResourceManager>()      Binding in the tx names and impl 
main.d12285adf00f2401cf60.bundle.js:1:848811
@JS : EngineTransactions      :createHistorianRecord()  created historian record 
main.d12285adf00f2401cf60.bundle.js:1:848811
@JS : ConnectionProfileManager:getConnectionManagerByTy Looking up a connection manager for type web
main.d12285adf00f2401cf60.bundle.js:1:848811
@JS : ModelManager            :addSystemModels()        [object Object] 
main.d12285adf00f2401cf60.bundle.js:1:848811
connected
main.d12285adf00f2401cf60.bundle.js:1:61666

2 个答案:

答案 0 :(得分:2)

这是我在GitHub上得到的答案:

  

导出灰显的原因是因为您正在使用   bluemix staged Playall位于&#39; web-connector&#39;模式。在   为了有意义地导出商业网卡,您需要   创建与Hyperledger Fabric的连接。您在上面概述的步骤   不会在Hyperledger Fabric中创建业务网络,而是在   网络连接器。

     

如果您按照开发人员教程进行操作   (https://hyperledger.github.io/composer/tutorials/developer-tutorial)   您将完成创建(本地)Fabric的过程,   您可以从中连接Playground和出口业务网络   卡。

答案 1 :(得分:1)

您可以通过composer-cli创建管理卡。

composer card create 
-p connection.json 
-u PeerAdmin -c Admin@org1.example.com-cert.pem 
-k 114aab0e76bf0c78308f89efc4b8c9423e31568da0c340ca187a9b17aa9a4457_sk 
-r PeerAdmin -r ChannelAdmin

添加connection.json文件如下:

{
  "name": "fabric-network",
  "type": "hlfv1",
  "mspID": "Org1MSP",
  "peers": [
      {
          "requestURL": "grpc://localhost:7051",
          "eventURL": "grpc://localhost:7053"
      }
  ],
  "ca": {
      "url": "http://localhost:7054",
      "name": "ca.org1.example.com"
  },
  "orderers": [
      {
          "url" : "grpc://localhost:7050"
      }
  ],
  "channel": "composerchannel",
  "timeout": 300
}

证书文件可以在signcerts子目录(fabric-tools/fabric-scripts/hlfv1/composer/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp)中找到,名为Admin@org1.example.com-cert.pem

私钥文件可以在keystore子目录中找到。私钥文件的名称是长十六进制字符串,后缀为_sk,例如114aab0e76bf0c78308f89efc4b8c9423e31568da0c340ca187a9b17aa9a4457_sk

Hyperledger Composer中提供了分步教程 教程@ https://hyperledger.github.io/composer/tutorials/deploy-to-fabric-single-org