Hyperledger Fabric 2.4 批准链码错误

问题描述 投票:0回答:1

我正在使用 docker compose 设置一个 hyperledger fabric 网络。 所有容器都已启动并正在运行,但我在使用 appprovemyorg 命令时遇到问题。 这些是节点加入频道后的日志:

    2022-05-24 07:41:54.316 UTC 0023 INFO [ledgermgmt] CreateLedger -> Creating ledger [mychannel] with genesis block
    2022-05-24 07:41:54.319 UTC 0024 INFO [blkstorage] newBlockfileMgr -> Getting block information from block storage
    2022-05-24 07:41:54.328 UTC 0025 INFO [kvledger] commit -> [mychannel] Committed block [0] with 1 transaction(s) in 6ms (state_validation=0ms block_and_pvtdata_commit=3ms state_commit=1ms) commitHash=[]
    2022-05-24 07:41:54.328 UTC 0026 INFO [kvledger] updateLedgerStatus -> Updating ledger [mychannel] status to [ACTIVE]
    2022-05-24 07:41:54.329 UTC 0027 INFO [ledgermgmt] CreateLedger -> Created ledger [mychannel] with genesis block
    2022-05-24 07:41:54.332 UTC 0028 INFO [gossip.gossip] JoinChan -> Joining gossip network of channel mychannel with 1 organizations
    2022-05-24 07:41:54.332 UTC 0029 INFO [gossip.gossip] learnAnchorPeers -> No configured anchor peers of org1MSP for channel mychannel to learn about
    2022-05-24 07:41:54.333 UTC 002a INFO [gateway] configUpdate -> Updating orderer config channel=mychannel
    2022-05-24 07:41:54.333 UTC 002b INFO [gossip.state] NewGossipStateProvider -> Updating metadata information for channel mychannel, current ledger sequence is at = 0, next expected block is = 1
    2022-05-24 07:41:54.333 UTC 002c INFO [endorser] callChaincode -> finished chaincode: cscc duration: 21ms channel= txID=a704dc84
    2022-05-24 07:41:54.333 UTC 002d INFO [comm.grpc.server] 1 -> unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=172.22.0.9:59204 grpc.code=OK grpc.call_duration=22.209824ms
    2022-05-24 07:42:00.335 UTC 002e INFO [gossip.election] beLeader -> 49ad88f230e73d14bb6f9b8a891c0f5bc47a35cd793ff62222e489f762864a33 : Becoming a leader
    2022-05-24 07:42:00.335 UTC 002f INFO [gossip.service] func1 -> Elected as a leader, starting delivery service for channel mychannel
    2022-05-24 07:42:00.335 UTC 0030 INFO [deliveryClient] StartDeliverForChannel -> This peer will retrieve blocks from ordering service and disseminate to other peers in the organization for channel mychannel
2022-05-24 07:30:08.206 UTC 0031 WARN [peer.blocksprovider] DeliverBlocks -> Could not connect to ordering service: could not dial endpoint 'orderer2:8050': failed to create new connection: connection error: desc = "transport: error while dialing: dial tcp 0.0.0.0:8050: connect: connection refused" channel=mychannel
    2022-05-24 07:30:08.307 UTC 0032 WARN [peer.blocksprovider] DeliverBlocks -> Could not connect to ordering service: could not dial endpoint 'orderer3:9050': failed to create new connection: connection error: desc = "transport: error while dialing: dial tcp 0.0.0.0:9050: connect: connection refused" channel=mychannel
    2022-05-24 07:30:08.428 UTC 0033 WARN [peer.blocksprovider] DeliverBlocks -> Could not connect to ordering service: could not dial endpoint 'orderer1:7050': failed to create new connection: connection error: desc = "transport: error while dialing: dial tcp 0.0.0.0:7050: connect: connection refused" channel=mychannel

如您所见,我有一些警告,但我可以安全地加入频道,并且在安装链代码时完全没有问题(警告也消失了)。 这些是安装链代码后对等点的日志:

2022-05-24 07:45:17.017 UTC 0052 INFO [chaincode.externalbuilder.ccaas_builder] waitForExit -> ::Detect command=detect
2022-05-24 07:45:17.017 UTC 0053 INFO [chaincode.externalbuilder.ccaas_builder] waitForExit -> ::Error: chaincode type not supported: java command=detect
2022-05-24 07:45:17.023 UTC 0054 INFO [lifecycle] InstallChaincode -> Successfully installed chaincode with package ID 'testchaincode_1:de8cddcb2deda13a7a3c1e9f6e37764e6d2c1bb6f89bac1f0d2c6396587b35f7'
2022-05-24 07:45:17.023 UTC 0055 INFO [endorser] callChaincode -> finished chaincode: _lifecycle duration: 14ms channel= txID=694acf7b
2022-05-24 07:45:17.023 UTC 0056 INFO [comm.grpc.server] 1 -> unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=172.22.0.9:59206 grpc.code=OK grpc.call_duration=15.8101ms

当我尝试使用此命令批准链码时:

peer lifecycle chaincode approveformyorg --tls --cafile /tmp/hyperledger/org1/peer1/tls-msp/tlscacerts/tls-tls-ca-7052.pem -o orderer1:7050 --ordererTLSHostnameOverride orderer1 --channelID mychannel --name mycc --version 1 --sequence 1 --waitForEvent --init-required --package-id testchaincode_1:de8cddcb2deda13a7a3c1e9f6e37764e6d2c1bb6f89bac1f0d2c6396587b35f7

我有这个错误:

Error: timed out waiting for txid on all peers

在对等点上有这些日志:

    2022-05-24 07:46:54.303 UTC 0059 INFO [lifecycle] ApproveChaincodeDefinitionForOrg -> Successfully endorsed chaincode approval with name 'mycc', package ID 'testchaincode_1:de8cddcb2deda13a7a3c1e9f6e37764e6d2c1bb6f89bac1f0d2c6396587b35f7', on channel 'mychannel' with definition {sequence: 1, endorsement info: (version: '1', plugin: 'escc', init required: true), validation info: (plugin: 'vscc', policy: '12202f4368616e6e656c2f4170706c69636174696f6e2f456e646f7273656d656e74'), collections: ()}
    2022-05-24 07:46:54.303 UTC 005a INFO [endorser] callChaincode -> finished chaincode: _lifecycle duration: 0ms channel=mychannel txID=d56b21b6
    2022-05-24 07:46:54.308 UTC 005b INFO [comm.grpc.server] 1 -> unary call completed grpc.service=protos.Endorser grpc.method=ProcessProposal grpc.peer_address=172.22.0.9:59210 grpc.code=OK grpc.call_duration=6.78249ms
    2022-05-24 07:46:55.194 UTC 005c WARN [peer.blocksprovider] DeliverBlocks -> Could not connect to ordering service: could not dial endpoint 'orderer1:7050': failed to create new connection: connection error: desc = "transport: error while dialing: dial tcp 0.0.0.0:7050: connect: connection refused" channel=mychannel
    2022-05-24 07:47:24.311 UTC 005d INFO [comm.grpc.server] 1 -> streaming call completed grpc.service=protos.Deliver grpc.method=DeliverFiltered grpc.request_deadline=2022-05-24T07:47:24.31Z grpc.peer_address=172.22.0.9:59212 error="context finished before block retrieved: context deadline exceeded" grpc.code=Unknown grpc.call_duration=30.0006887s
2022-05-24 07:47:54.260 UTC 005e WARN [peer.blocksprovider] DeliverBlocks -> Could not connect to ordering service: could not dial endpoint 'orderer2:8050': failed to create new connection: connection error: desc = "transport: error while dialing: dial tcp 0.0.0.0:8050: connect: connection refused" channel=mychannel

所以我无法批准链码并推进流程。 谁能帮我解决这个问题? 谢谢

hyperledger-fabric hyperledger
1个回答
0
投票

请问这个问题是怎么解决的,因为我也遇到了同样的问题

© www.soinside.com 2019 - 2024. All rights reserved.