【问题标题】:Hyperledger Composer multi-host setup - Error when executing pingHyperledger Composer 多主机设置 - 执行 ping 时出错
【发布时间】:2018-10-03 11:48:14
【问题描述】:

我一直在使用 Hyperledger Fabric 和 Composer,试图将其部署在两个虚拟机上。我的工作是基于Composer multi-org tutorial,只是扩展了两台机器。

网络设置:

Host1:Orderer、Peer1.Org1、Peer2.Org1、CLI

主机2:Peer1.Org2、Peer2.Org2

面料 - 工作原理:

  • 对等点已启动并正在运行;
  • 他们可以加入频道;
  • 锚节点已更新;
  • 作为测试,我已将弹珠链代码安装到所有对等节点上,并且能够成功查询;

作曲家 - 工作原理:

  • 我有两个组织的 2 个连接配置文件;

  • 我能够在两台主机上安装 .bna 且没有任何错误;

  • 我可以启动网络了;

  • 我可以创建卡片并在两台主机上导入它们;

当我尝试 ping 任何主机时出现问题:

当我在 主机 1 上 ping 网络时:

Error: Error trying invoke business network. Error: Peer localhost:8051 has rejected transaction '1ff21ebc89a5d19c2c377f13b10b934168c1dd23d723446b6f51c0bfd79ff346' with code ENDORSEMENT_POLICY_FAILURE

当我在 主机 2 上 ping 网络时:

Error: Error trying to ping. Error: transaction returned with failure: Error: The current identity, with the name 'admin' and the identifier '74d166962b282e9f04b17f6d7a8856a1565a257b310aceed5845831b15a710a4', has not been registered

这些是 host 1 - peer0 的日志:

2018-10-03 11:18:46.704 UTC [lscc] executeInstall -> INFO 03c Installed Chaincode [proa-network] Version [0.0.1] to peer
2018-10-03 11:19:31.081 UTC [couchdb] CreateDatabaseIfNotExist -> INFO 03d Created state database mychannel_proa-network
2018-10-03 11:19:34.521 UTC [cceventmgmt] HandleStateUpdates -> INFO 03e Channel [mychannel]: Handling LSCC state update for chaincode [proa-network]
2018-10-03 11:19:34.546 UTC [couchdb] CreateIndex -> INFO 03f Created CouchDB index [selectClaimsByService] in state database [mychannel_proa-network] using design document [_design/selectClaimsByServiceDoc]
2018-10-03 11:19:34.549 UTC [couchdb] CreateIndex -> INFO 040 Created CouchDB index [selectInvoicesByPolicy] in state database [mychannel_proa-network] using design document [_design/selectInvoicesByPolicyDoc]
2018-10-03 11:19:34.551 UTC [couchdb] CreateIndex -> INFO 041 Created CouchDB index [selectPoliciesByEvaluator] in state database [mychannel_proa-network] using design document [_design/selectPoliciesByEvaluatorDoc]
2018-10-03 11:19:34.554 UTC [couchdb] CreateIndex -> INFO 042 Created CouchDB index [selectPoliciesByInsurer] in state database [mychannel_proa-network] using design document [_design/selectPoliciesByInsurerDoc]
2018-10-03 11:19:34.557 UTC [couchdb] CreateIndex -> INFO 043 Created CouchDB index [selectPoliciesBySponsor] in state database [mychannel_proa-network] using design document [_design/selectPoliciesBySponsorDoc]
2018-10-03 11:19:34.560 UTC [couchdb] CreateIndex -> INFO 044 Created CouchDB index [selectProductsByEvaluator] in state database [mychannel_proa-network] using design document [_design/selectProductsByEvaluatorDoc]
2018-10-03 11:19:34.564 UTC [couchdb] CreateIndex -> INFO 045 Created CouchDB index [selectProductsByInsurer] in state database [mychannel_proa-network] using design document [_design/selectProductsByInsurerDoc]
2018-10-03 11:19:34.565 UTC [couchdb] CreateIndex -> INFO 046 Created CouchDB index [selectProductsBySponsor] in state database [mychannel_proa-network] using design document [_design/selectProductsBySponsorDoc]
2018-10-03 11:19:34.576 UTC [kvledger] CommitWithPvtData -> INFO 047 Channel [mychannel]: Committed block [3] with 1 transaction(s)
2018-10-03 11:19:36.964 UTC [endorser] SimulateProposal -> ERRO 048 [mychannel][d2dade2d] failed to invoke chaincode name:"proa-network" , error: transaction returned with failure: Error: The current identity, with the name 'admin' and the identifier '09a1e3cfc2f2d4d297653b30151c9bf0fd8356b324199780fda49c10536551d2', must be activated (ACTIVATION_REQUIRED)
github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).Execute
    /opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:202
github.com/hyperledger/fabric/core/endorser.(*SupportImpl).Execute
    /opt/gopath/src/github.com/hyperledger/fabric/core/endorser/support.go:141
github.com/hyperledger/fabric/core/endorser.(*Endorser).callChaincode
    /opt/gopath/src/github.com/hyperledger/fabric/core/endorser/endorser.go:136
github.com/hyperledger/fabric/core/endorser.(*Endorser).SimulateProposal
    /opt/gopath/src/github.com/hyperledger/fabric/core/endorser/endorser.go:287
github.com/hyperledger/fabric/core/endorser.(*Endorser).ProcessProposal
    /opt/gopath/src/github.com/hyperledger/fabric/core/endorser/endorser.go:501
github.com/hyperledger/fabric/core/handlers/auth/filter.(*expirationCheckFilter).ProcessProposal
    /opt/gopath/src/github.com/hyperledger/fabric/core/handlers/auth/filter/expiration.go:61
github.com/hyperledger/fabric/core/handlers/auth/filter.(*filter).ProcessProposal
    /opt/gopath/src/github.com/hyperledger/fabric/core/handlers/auth/filter/filter.go:31
github.com/hyperledger/fabric/protos/peer._Endorser_ProcessProposal_Handler
    /opt/gopath/src/github.com/hyperledger/fabric/protos/peer/peer.pb.go:112
github.com/hyperledger/fabric/vendor/google.golang.org/grpc.(*Server).processUnaryRPC
    /opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:923
github.com/hyperledger/fabric/vendor/google.golang.org/grpc.(*Server).handleStream
    /opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:1148
github.com/hyperledger/fabric/vendor/google.golang.org/grpc.(*Server).serveStreams.func1.1
    /opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:637
runtime.goexit
    /opt/go/src/runtime/asm_amd64.s:2361
2018-10-03 11:19:42.026 UTC [vscc] Validate -> WARN 049 Endorsement policy failure for transaction txid=1ff21ebc89a5d19c2c377f13b10b934168c1dd23d723446b6f51c0bfd79ff346, err: signature set did not satisfy policy
2018-10-03 11:19:42.026 UTC [committer/txvalidator] validateTx -> ERRO 04a VSCCValidateTx for transaction txId = 1ff21ebc89a5d19c2c377f13b10b934168c1dd23d723446b6f51c0bfd79ff346 returned error: VSCC error: endorsement policy failure, err: signature set did not satisfy policy
2018-10-03 11:19:42.026 UTC [valimpl] preprocessProtoBlock -> WARN 04b Channel [mychannel]: Block [4] Transaction index [0] TxId [1ff21ebc89a5d19c2c377f13b10b934168c1dd23d723446b6f51c0bfd79ff346] marked as invalid by committer. Reason code [ENDORSEMENT_POLICY_FAILURE]
2018-10-03 11:19:42.067 UTC [kvledger] CommitWithPvtData -> INFO 04c Channel [mychannel]: Committed block [4] with 1 transaction(s)

更新:endorsement-policy.json

{
    "identities": [
        {
            "role": {
                "name": "member",
                "mspId": "ManagerMSP"
            }
        },
        {
            "role": {
                "name": "member",
                "mspId": "SponsorMSP"
            }
        }
    ],
    "policy": {
        "2-of": [
            {
                "signed-by": 0
            },
            {
                "signed-by": 1
            }
        ]
    }
}

composer network install --card PeerAdmin@exManager --archiveFile ex-network@0.0.1.bna
cp endorsement-policy.json  /tmp/composer/endorsement-policy.json

    echo "Retrieving business network administrator certificates for Manager"
    composer identity request -c PeerAdmin@exManager -u admin -s adminpw -d andreim

    #-------------------
    #-- START NETWORK
    #-------------------

    echo "Starting the business network"
    composer network start -c PeerAdmin@exManager -n ex-network -V 0.0.1 -o endorsementPolicyFile=/tmp/composer/endorsement-policy.json -A andreim -C andreim/admin-pub.pem

我要说明的另一点是,网络启动后,主机 1 上出现了 2 个容器(可能用于链代码),但 主机 2 上没有出现。 (有一次例外,peer0 的容器出现在 主机 2 上,几乎是随机出现的,没有任何代码更改)。

更新 2:来自主机 2 的 peer0 的日志

.....
2018-10-03 11:15:21.109 UTC [lscc] executeInstall -> INFO 03c Installed Chaincode [proa-network] Version [0.0.1] to peer
2018-10-03 11:18:24.190 UTC [endorser] ProcessProposal -> ERRO 03d [][1bec8b15] simulateProposal() resulted in chaincode name:"lscc"  response status 500 for txid: 1bec8b15b953df0f5e00213916cb092219f949800a0f249ea5f8ef90fcc7eb06
2018-10-03 11:19:34.545 UTC [couchdb] CreateDatabaseIfNotExist -> INFO 03e Created state database mychannel_proa-network
2018-10-03 11:19:34.556 UTC [cceventmgmt] HandleStateUpdates -> INFO 03f Channel [mychannel]: Handling LSCC state update for chaincode [proa-network]
2018-10-03 11:19:34.587 UTC [couchdb] CreateIndex -> INFO 040 Created CouchDB index [selectClaimsByService] in state database [mychannel_proa-network] using design document [_design/selectClaimsByServiceDoc]
2018-10-03 11:19:34.589 UTC [couchdb] CreateIndex -> INFO 041 Created CouchDB index [selectInvoicesByPolicy] in state database [mychannel_proa-network] using design document [_design/selectInvoicesByPolicyDoc]
2018-10-03 11:19:34.593 UTC [couchdb] CreateIndex -> INFO 042 Created CouchDB index [selectPoliciesByEvaluator] in state database [mychannel_proa-network] using design document [_design/selectPoliciesByEvaluatorDoc]
2018-10-03 11:19:34.595 UTC [couchdb] CreateIndex -> INFO 043 Created CouchDB index [selectPoliciesByInsurer] in state database [mychannel_proa-network] using design document [_design/selectPoliciesByInsurerDoc]
2018-10-03 11:19:34.598 UTC [couchdb] CreateIndex -> INFO 044 Created CouchDB index [selectPoliciesBySponsor] in state database [mychannel_proa-network] using design document [_design/selectPoliciesBySponsorDoc]
2018-10-03 11:19:34.600 UTC [couchdb] CreateIndex -> INFO 045 Created CouchDB index [selectProductsByEvaluator] in state database [mychannel_proa-network] using design document [_design/selectProductsByEvaluatorDoc]
2018-10-03 11:19:34.602 UTC [couchdb] CreateIndex -> INFO 046 Created CouchDB index [selectProductsByInsurer] in state database [mychannel_proa-network] using design document [_design/selectProductsByInsurerDoc]
2018-10-03 11:19:34.606 UTC [couchdb] CreateIndex -> INFO 047 Created CouchDB index [selectProductsBySponsor] in state database [mychannel_proa-network] using design document [_design/selectProductsBySponsorDoc]
2018-10-03 11:19:34.618 UTC [kvledger] CommitWithPvtData -> INFO 048 Channel [mychannel]: Committed block [3] with 1 transaction(s)
2018-10-03 11:19:42.027 UTC [vscc] Validate -> WARN 049 Endorsement policy failure for transaction txid=1ff21ebc89a5d19c2c377f13b10b934168c1dd23d723446b6f51c0bfd79ff346, err: signature set did not satisfy policy
2018-10-03 11:19:42.027 UTC [committer/txvalidator] validateTx -> ERRO 04a VSCCValidateTx for transaction txId = 1ff21ebc89a5d19c2c377f13b10b934168c1dd23d723446b6f51c0bfd79ff346 returned error: VSCC error: endorsement policy failure, err: signature set did not satisfy policy
2018-10-03 11:19:42.028 UTC [valimpl] preprocessProtoBlock -> WARN 04b Channel [mychannel]: Block [4] Transaction index [0] TxId [1ff21ebc89a5d19c2c377f13b10b934168c1dd23d723446b6f51c0bfd79ff346] marked as invalid by committer. Reason code [ENDORSEMENT_POLICY_FAILURE]
2018-10-03 11:19:42.053 UTC [kvledger] CommitWithPvtData -> INFO 04c Channel [mychannel]: Committed block [4] with 1 transaction(s)
2018-10-03 11:42:02.836 UTC [endorser] SimulateProposal -> ERRO 04d [mychannel][f750d0c4] failed to invoke chaincode name:"proa-network" , error: transaction returned with failure: Error: The current identity, with the name 'admin' and the identifier '74d166962b282e9f04b17f6d7a8856a1565a257b310aceed5845831b15a710a4', has not been registered
github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).Execute
    /opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:202
github.com/hyperledger/fabric/core/endorser.(*SupportImpl).Execute
    /opt/gopath/src/github.com/hyperledger/fabric/core/endorser/support.go:141
github.com/hyperledger/fabric/core/endorser.(*Endorser).callChaincode
    /opt/gopath/src/github.com/hyperledger/fabric/core/endorser/endorser.go:136
github.com/hyperledger/fabric/core/endorser.(*Endorser).SimulateProposal
    /opt/gopath/src/github.com/hyperledger/fabric/core/endorser/endorser.go:287
github.com/hyperledger/fabric/core/endorser.(*Endorser).ProcessProposal
    /opt/gopath/src/github.com/hyperledger/fabric/core/endorser/endorser.go:501
github.com/hyperledger/fabric/core/handlers/auth/filter.(*expirationCheckFilter).ProcessProposal
    /opt/gopath/src/github.com/hyperledger/fabric/core/handlers/auth/filter/expiration.go:61
github.com/hyperledger/fabric/core/handlers/auth/filter.(*filter).ProcessProposal
    /opt/gopath/src/github.com/hyperledger/fabric/core/handlers/auth/filter/filter.go:31
github.com/hyperledger/fabric/protos/peer._Endorser_ProcessProposal_Handler
    /opt/gopath/src/github.com/hyperledger/fabric/protos/peer/peer.pb.go:112
github.com/hyperledger/fabric/vendor/google.golang.org/grpc.(*Server).processUnaryRPC
    /opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:923
github.com/hyperledger/fabric/vendor/google.golang.org/grpc.(*Server).handleStream
    /opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:1148
github.com/hyperledger/fabric/vendor/google.golang.org/grpc.(*Server).serveStreams.func1.1
    /opt/gopath/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:637
runtime.goexit
    /opt/go/src/runtime/asm_amd64.s:2361

【问题讨论】:

  • 尝试调用业务网络时出错。错误:Peer localhost:8051 has denied transaction '1ff21ebc89a5d19c2c377f13b10b934168c1dd23d723446b6f51c0bfd79ff346' with code ENDORSEMENT_POLICY_FAILURE” 当我的一个链码容器没有启动时,我遇到了这个错误。然后,我尝试了所有可能的方法,但仍然没有工作。但是,在大约 30 分钟,那个链码容器确实启动了。意思是,它花了一些时间。你是否仍然面临这个错误:stackoverflow.com/questions/52051487/…
  • 我想我不是唯一一个有这个问题的人......
  • 对于主机 2,检查管理员的连接配置文件。这是您启动网络时生成的卡。因此,请检查卡中的连接配置文件是否具有正确的详细信息。如果您需要,我仍然可以在最后一次聊天中使用。

标签: docker hyperledger-fabric docker-swarm hyperledger-composer


【解决方案1】:

您能出示您的背书政策文件吗?以及使用它的命令,可能与您的策略有关。至少这是错误所指向的。

【讨论】:

  • 我添加了背书政策。奇怪的是,主机 2 的链码容器不会启动,就像它们在主机 1 上那样。
  • 添加宿主机2个容器的日志,可能已经退出了,运行"docker ps -a"查看
  • 更新了主机 2 上 peer0 的日志问题。所有对等点都在主机上运行,​​但突然间我看到主机 2 上 peer0 的链码容器...
  • 你有这个错误。 ERRO 04d [mychannel][f750d0c4] 未能调用链代码名称:“proa-network”,错误:事务返回失败:错误:当前身份,名称为“admin”,标识符为“74d166962b282e9f04b17f6d7a8856a1565a257b310aceed5845831b15a710a4”,还没有注册也许你用不同的名字创建了管理员?
  • 主机 1 上的 peer0 正在获取:当前身份,名称为“admin”,标识符为“09a1e3cfc2f2d4d297653b30151c9bf0fd8356b324199780fda49c10536551d2”,必须激活 (ACTIVATION_REQUIRED)。我查看了代码,fabric yamls 中没有 admin 的其他名称。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-05-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多