Chaincode 已安装、批准、提交,但仍无法调用
Chaincode has been installed, approved, committed, but still not able to invoke
我在 Oracle Linux 8.4
中使用 Hyperledger Fabric v2.2.3
我 运行 没有 docker。
我已成功安装、批准并将链码提交到我的频道(订购者频道)。
我正在使用 peer lifecycle chaincode xxx
命令进行安装、批准和提交。
但是,当我使用 peer chaincode list
命令时,它显示为空。
以下是命令及其调试输出。
[user@hyperledgerfabric ~]# /appl/hyperledger-fabric/bin/peer lifecycle chaincode install --peerAddresses localhost:7051 -o localhost:7050 \
/appl/chaincode/TestHLF/TestHLF.tar.gz
2021-09-06 16:07:07.506 +08 [cli.lifecycle.chaincode] submitInstallProposal -> INFO 001 Installed remotely: response:<status:200 payload:"\nHTestHLF:7544dc9a9c60359520cc16c4f2bbf0091c79a9aa7476e21c1a4cc76bd2f7e27b2[=10=]7TestHLF" >
2021-09-06 16:07:07.506 +08 [cli.lifecycle.chaincode] submitInstallProposal -> INFO 002 Chaincode code package identifier: TestHLF:7544dc9a9c60359520cc16c4f2bbf0091c79a9aa7476e21c1a4cc76bd2f7e27b
[user@hyperledgerfabric ~]# /appl/hyperledger-fabric/bin/peer lifecycle chaincode approveformyorg -C orderer-channel \
-n TestHLF \
-v 1.0.0 \
--sequence 1 \
--package-id "TestHLF:7544dc9a9c60359520cc16c4f2bbf0091c79a9aa7476e21c1a4cc76bd2f7e27b" \
--peerAddresses localhost:7051 -o localhost:7050
2021-09-06 16:07:07.614 +08 [grpc] UpdateSubConnState -> DEBU 023 pickfirstBalancer: HandleSubConnStateChange: 0xc000453a40, {CONNECTING <nil>}
2021-09-06 16:07:07.614 +08 [grpc] Infof -> DEBU 024 Channel Connectivity change to CONNECTING
2021-09-06 16:07:07.614 +08 [grpc] Infof -> DEBU 025 Subchannel Connectivity change to READY
2021-09-06 16:07:07.614 +08 [grpc] UpdateSubConnState -> DEBU 026 pickfirstBalancer: HandleSubConnStateChange: 0xc000453a40, {READY <nil>}
2021-09-06 16:07:07.614 +08 [grpc] Infof -> DEBU 027 Channel Connectivity change to READY
2021-09-06 16:07:07.615 +08 [grpc] Infof -> DEBU 028 parsed scheme: ""
2021-09-06 16:07:07.615 +08 [grpc] Infof -> DEBU 029 scheme "" not registered, fallback to default scheme
2021-09-06 16:07:07.615 +08 [grpc] Infof -> DEBU 02a ccResolverWrapper: sending update to cc: {[{localhost:7051 <nil> 0 <nil>}] <nil> <nil>}
2021-09-06 16:07:07.615 +08 [grpc] Infof -> DEBU 02b ClientConn switching balancer to "pick_first"
2021-09-06 16:07:07.615 +08 [grpc] Infof -> DEBU 02c Channel switches to new LB policy "pick_first"
2021-09-06 16:07:07.615 +08 [grpc] Infof -> DEBU 02d Subchannel Connectivity change to CONNECTING
2021-09-06 16:07:07.615 +08 [grpc] Infof -> DEBU 02e Subchannel picks a new address "localhost:7051" to connect
2021-09-06 16:07:07.616 +08 [grpc] UpdateSubConnState -> DEBU 02f pickfirstBalancer: HandleSubConnStateChange: 0xc0004acb80, {CONNECTING <nil>}
2021-09-06 16:07:07.616 +08 [grpc] Infof -> DEBU 030 Channel Connectivity change to CONNECTING
2021-09-06 16:07:07.616 +08 [grpc] Infof -> DEBU 031 Subchannel Connectivity change to READY
2021-09-06 16:07:07.616 +08 [grpc] UpdateSubConnState -> DEBU 032 pickfirstBalancer: HandleSubConnStateChange: 0xc0004acb80, {READY <nil>}
2021-09-06 16:07:07.616 +08 [grpc] Infof -> DEBU 033 Channel Connectivity change to READY
2021-09-06 16:07:07.617 +08 [grpc] WithKeepaliveParams -> DEBU 034 Adjusting keepalive ping interval to minimum period of 10s
2021-09-06 16:07:07.617 +08 [grpc] Infof -> DEBU 035 parsed scheme: ""
2021-09-06 16:07:07.617 +08 [grpc] Infof -> DEBU 036 scheme "" not registered, fallback to default scheme
2021-09-06 16:07:07.617 +08 [grpc] Infof -> DEBU 037 ccResolverWrapper: sending update to cc: {[{localhost:7050 <nil> 0 <nil>}] <nil> <nil>}
2021-09-06 16:07:07.617 +08 [grpc] Infof -> DEBU 038 ClientConn switching balancer to "pick_first"
2021-09-06 16:07:07.617 +08 [grpc] Infof -> DEBU 039 Channel switches to new LB policy "pick_first"
2021-09-06 16:07:07.617 +08 [grpc] Infof -> DEBU 03a Subchannel Connectivity change to CONNECTING
2021-09-06 16:07:07.617 +08 [grpc] Infof -> DEBU 03b Subchannel picks a new address "localhost:7050" to connect
2021-09-06 16:07:07.618 +08 [grpc] UpdateSubConnState -> DEBU 03c pickfirstBalancer: HandleSubConnStateChange: 0xc000021820, {CONNECTING <nil>}
2021-09-06 16:07:07.618 +08 [grpc] Infof -> DEBU 03d Channel Connectivity change to CONNECTING
2021-09-06 16:07:07.618 +08 [grpc] Infof -> DEBU 03e Subchannel Connectivity change to READY
2021-09-06 16:07:07.618 +08 [grpc] UpdateSubConnState -> DEBU 03f pickfirstBalancer: HandleSubConnStateChange: 0xc000021820, {READY <nil>}
2021-09-06 16:07:07.618 +08 [grpc] Infof -> DEBU 040 Channel Connectivity change to READY
2021-09-06 16:07:07.619 +08 [msp.identity] Sign -> DEBU 041 Sign: plaintext: 0ADD080A7308031A0C08AB98D7890610...31613463633736626432663765323762
2021-09-06 16:07:07.619 +08 [msp.identity] Sign -> DEBU 042 Sign: digest: 2866DE7D44974B662CDEECFCA0C958E5884AE0FAA0C1F7E30A72A990FC65D241
2021-09-06 16:07:07.627 +08 [msp.identity] Sign -> DEBU 043 Sign: plaintext: 0ADD080A7308031A0C08AB98D7890610...3A0291CE38FD5CAF0782D4A75B2CB833
2021-09-06 16:07:07.627 +08 [msp.identity] Sign -> DEBU 044 Sign: digest: 2F0106AC9B01865833250CE5D44AC0C8EC4B75A17409E808CB1D7A391F8DEF5C
2021-09-06 16:07:07.627 +08 [msp.identity] Sign -> DEBU 045 Sign: plaintext: 0A85080A1B08051A0608AB98D7890622...00120D1A0B08FFFFFFFFFFFFFFFFFF01
2021-09-06 16:07:07.627 +08 [msp.identity] Sign -> DEBU 046 Sign: digest: 47CF4E1203F1D14CC1AEEB7AC0776DA2F360EE23FEA927E9F5A1E66878BEB027
2021-09-06 16:07:09.652 +08 [chaincodeCmd] ClientWait -> INFO 047 txid [2349c7438eae022d2453d0c57b9ad44250a9aca7ce5f5647b68877b51c20dd73] committed with status (VALID) at localhost:7051
[user@hyperledgerfabric ~]# /appl/hyperledger-fabric/bin/peer lifecycle chaincode commit -C orderer-channel \
-n TestHLF \
-v 1.0.0 \
--sequence 1 \
--peerAddresses localhost:7051 -o localhost:7050
2021-09-06 16:07:09.691 +08 [grpc] UpdateSubConnState -> DEBU 023 pickfirstBalancer: HandleSubConnStateChange: 0xc00036e440, {CONNECTING <nil>}
2021-09-06 16:07:09.692 +08 [grpc] Infof -> DEBU 024 Channel Connectivity change to CONNECTING
2021-09-06 16:07:09.694 +08 [grpc] Infof -> DEBU 025 Subchannel Connectivity change to READY
2021-09-06 16:07:09.694 +08 [grpc] UpdateSubConnState -> DEBU 026 pickfirstBalancer: HandleSubConnStateChange: 0xc00036e440, {READY <nil>}
2021-09-06 16:07:09.694 +08 [grpc] Infof -> DEBU 027 Channel Connectivity change to READY
2021-09-06 16:07:09.695 +08 [grpc] Infof -> DEBU 028 parsed scheme: ""
2021-09-06 16:07:09.695 +08 [grpc] Infof -> DEBU 029 scheme "" not registered, fallback to default scheme
2021-09-06 16:07:09.695 +08 [grpc] Infof -> DEBU 02a ccResolverWrapper: sending update to cc: {[{localhost:7051 <nil> 0 <nil>}] <nil> <nil>}
2021-09-06 16:07:09.695 +08 [grpc] Infof -> DEBU 02b ClientConn switching balancer to "pick_first"
2021-09-06 16:07:09.695 +08 [grpc] Infof -> DEBU 02c Channel switches to new LB policy "pick_first"
2021-09-06 16:07:09.695 +08 [grpc] Infof -> DEBU 02d Subchannel Connectivity change to CONNECTING
2021-09-06 16:07:09.695 +08 [grpc] Infof -> DEBU 02e Subchannel picks a new address "localhost:7051" to connect
2021-09-06 16:07:09.696 +08 [grpc] UpdateSubConnState -> DEBU 02f pickfirstBalancer: HandleSubConnStateChange: 0xc0004eb3e0, {CONNECTING <nil>}
2021-09-06 16:07:09.696 +08 [grpc] Infof -> DEBU 030 Channel Connectivity change to CONNECTING
2021-09-06 16:07:09.696 +08 [grpc] Infof -> DEBU 031 Subchannel Connectivity change to READY
2021-09-06 16:07:09.696 +08 [grpc] UpdateSubConnState -> DEBU 032 pickfirstBalancer: HandleSubConnStateChange: 0xc0004eb3e0, {READY <nil>}
2021-09-06 16:07:09.697 +08 [grpc] Infof -> DEBU 033 Channel Connectivity change to READY
2021-09-06 16:07:09.697 +08 [grpc] WithKeepaliveParams -> DEBU 034 Adjusting keepalive ping interval to minimum period of 10s
2021-09-06 16:07:09.697 +08 [grpc] Infof -> DEBU 035 parsed scheme: ""
2021-09-06 16:07:09.697 +08 [grpc] Infof -> DEBU 036 scheme "" not registered, fallback to default scheme
2021-09-06 16:07:09.697 +08 [grpc] Infof -> DEBU 037 ccResolverWrapper: sending update to cc: {[{localhost:7050 <nil> 0 <nil>}] <nil> <nil>}
2021-09-06 16:07:09.697 +08 [grpc] Infof -> DEBU 038 ClientConn switching balancer to "pick_first"
2021-09-06 16:07:09.697 +08 [grpc] Infof -> DEBU 039 Channel switches to new LB policy "pick_first"
2021-09-06 16:07:09.698 +08 [grpc] Infof -> DEBU 03a Subchannel Connectivity change to CONNECTING
2021-09-06 16:07:09.698 +08 [grpc] Infof -> DEBU 03b Subchannel picks a new address "localhost:7050" to connect
2021-09-06 16:07:09.698 +08 [grpc] UpdateSubConnState -> DEBU 03c pickfirstBalancer: HandleSubConnStateChange: 0xc0005c5ec0, {CONNECTING <nil>}
2021-09-06 16:07:09.698 +08 [grpc] Infof -> DEBU 03d Channel Connectivity change to CONNECTING
2021-09-06 16:07:09.698 +08 [grpc] Infof -> DEBU 03e Subchannel Connectivity change to READY
2021-09-06 16:07:09.698 +08 [grpc] UpdateSubConnState -> DEBU 03f pickfirstBalancer: HandleSubConnStateChange: 0xc0005c5ec0, {READY <nil>}
2021-09-06 16:07:09.698 +08 [grpc] Infof -> DEBU 040 Channel Connectivity change to READY
2021-09-06 16:07:09.698 +08 [msp.identity] Sign -> DEBU 041 Sign: plaintext: 0ADD080A7308031A0C08AD98D7890610...120754657374484C461A05312E302E30
2021-09-06 16:07:09.698 +08 [msp.identity] Sign -> DEBU 042 Sign: digest: 5E875D07A47E27DA338662AACC2860D9419371EDA2D57677D85149C8B18908E1
2021-09-06 16:07:09.704 +08 [msp.identity] Sign -> DEBU 043 Sign: plaintext: 0ADD080A7308031A0C08AD98D7890610...BD169FAD1ECF8613FFD9C8CE30A6C9AC
2021-09-06 16:07:09.704 +08 [msp.identity] Sign -> DEBU 044 Sign: digest: 4E45786A0763C875B6B18A7E30D2332BC45543DCA7885B39DAFC2C86F296856F
2021-09-06 16:07:09.705 +08 [msp.identity] Sign -> DEBU 045 Sign: plaintext: 0A85080A1B08051A0608AD98D7890622...00120D1A0B08FFFFFFFFFFFFFFFFFF01
2021-09-06 16:07:09.705 +08 [msp.identity] Sign -> DEBU 046 Sign: digest: 76501C0D734448AB048D31B2DC6A8428EE8BEA6F18FD1450ED0B9058890678C9
2021-09-06 16:07:11.728 +08 [chaincodeCmd] ClientWait -> INFO 047 txid [7d7e22e6e7d71ebb3b73fd797114da6c0ffbf3de1ab3e0e12d4c8ac8e409fdec] committed with status (VALID) at localhost:7051
这里是我用来查看是否存在的命令,发现使用peer chaincode list
没有安装任何东西。
[user@hyperledgerfabric ~]# /appl/hyperledger-fabric/bin/peer lifecycle chaincode queryinstalled --peerAddresses localhost:7051 -o localhost:7051
Installed chaincodes on peer:
Package ID: TestHLF:7544dc9a9c60359520cc16c4f2bbf0091c79a9aa7476e21c1a4cc76bd2f7e27b, Label: TestHLF
[user@hyperledgerfabric ~]# /appl/hyperledger-fabric/bin/peer lifecycle chaincode queryapproved -C orderer-channel \
-n TestHLF \
--peerAddresses localhost:7051 -o localhost:7051
Approved chaincode definition for chaincode 'TestHLF' on channel 'orderer-channel':
sequence: 1, version: 1.0.0, init-required: false, package-id: TestHLF:7544dc9a9c60359520cc16c4f2bbf0091c79a9aa7476e21c1a4cc76bd2f7e27b, endorsement plugin: escc, validation plugin: vscc
[user@hyperledgerfabric ~]# /appl/hyperledger-fabric/bin/peer lifecycle chaincode querycommitted -C orderer-channel \
-n TestHLF \
--peerAddresses localhost:7051 -o localhost:7051
Committed chaincode definition for chaincode 'TestHLF' on channel 'orderer-channel':
Version: 1.0.0, Sequence: 1, Endorsement Plugin: escc, Validation Plugin: vscc, Approvals: [MyOrg1: true]
[user@hyperledgerfabric ~]# /appl/hyperledger-fabric/bin/peer chaincode list --installed \
-C orderer-channel \
--peerAddresses localhost:7051 -o localhost:7050
Get installed chaincodes on peer:
这是我执行peer chaincode invoke
,
时的输出
在我通过 cli 调用期间在控制台上的这个:
[user@hyperledgerfabric ~]# /appl/hyperledger-fabric/bin/peer chaincode invoke -C orderer-channel -n TestHLF --peerAddresses localhost:7051 -o localhost:7050 -c '{"Args":["retrieve", "key1"]}'
2021-09-06 17:14:36.991 +08 [chaincodeCmd] chaincodeInvokeOrQuery -> DEBU 043 ESCC invoke result: response:<status:500 message:"error in simulation: failed to execute transaction 16e55029175cd3e14d8155afb932e3fbf2dabdce73db120486968fa9126af2ef: could not launch chaincode TestHLF:7544dc9a9c60359520cc16c4f2bbf0091c79a9aa7476e21c1a4cc76bd2f7e27b: chaincode registration failed: container exited with 0" >
Error: endorsement failure during invoke. response: status:500 message:"error in simulation: failed to execute transaction 16e55029175cd3e14d8155afb932e3fbf2dabdce73db120486968fa9126af2ef: could not launch chaincode TestHLF:7544dc9a9c60359520cc16c4f2bbf0091c79a9aa7476e21c1a4cc76bd2f7e27b: chaincode registration failed: container exited with 0"
这是我通过 cli peer chaincode invoke
调用期间的对等调试日志:
Sep 06 17:14:36 hyperledgerfabric peer[1570]: 2021-09-06 17:14:36.986 +08 [chaincode] Start -> DEBU 1667 start container: TestHLF:7544dc9a9c60359520cc16c4f2bbf0091c79a9aa7476e21c1a4cc76bd2f7e27b
Sep 06 17:14:36 hyperledgerfabric peer[1570]: 2021-09-06 17:14:36.990 +08 [chaincode] Launch -> DEBU 1668 stopping due to error while launching: container exited with 0
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/chaincode.(*RuntimeLauncher).Launch.func1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/chaincode/runtime_launcher.go:118
Sep 06 17:14:36 hyperledgerfabric peer[1570]: runtime.goexit
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /usr/local/go/src/runtime/asm_amd64.s:1374
Sep 06 17:14:36 hyperledgerfabric peer[1570]: chaincode registration failed
Sep 06 17:14:36 hyperledgerfabric peer[1570]: 2021-09-06 17:14:36.990 +08 [chaincode] Launch -> DEBU 1669 launch complete
Sep 06 17:14:36 hyperledgerfabric peer[1570]: 2021-09-06 17:14:36.990 +08 [chaincode] Deregister -> DEBU 166a deregister handler: TestHLF:7544dc9a9c60359520cc16c4f2bbf0091c79a9aa7476e21c1a4cc76bd2f7e27b
Sep 06 17:14:36 hyperledgerfabric peer[1570]: 2021-09-06 17:14:36.991 +08 [endorser] callChaincode -> INFO 166b finished chaincode: TestHLF duration: 4ms channel=orderer-channel txID=16e55029
Sep 06 17:14:36 hyperledgerfabric peer[1570]: 2021-09-06 17:14:36.991 +08 [endorser] SimulateProposal -> ERRO 166c failed to invoke chaincode TestHLF, error: container exited with 0
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/chaincode.(*RuntimeLauncher).Launch.func1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/chaincode/runtime_launcher.go:118
Sep 06 17:14:36 hyperledgerfabric peer[1570]: runtime.goexit
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /usr/local/go/src/runtime/asm_amd64.s:1374
Sep 06 17:14:36 hyperledgerfabric peer[1570]: chaincode registration failed
Sep 06 17:14:36 hyperledgerfabric peer[1570]: could not launch chaincode TestHLF:7544dc9a9c60359520cc16c4f2bbf0091c79a9aa7476e21c1a4cc76bd2f7e27b
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).Launch
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:85
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).Invoke
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:197
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).Execute
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:155
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/endorser.(*SupportImpl).Execute
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/endorser/support.go:126
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/endorser.(*Endorser).callChaincode
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/endorser/endorser.go:119
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/endorser.(*Endorser).SimulateProposal
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/endorser/endorser.go:187
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/endorser.(*Endorser).ProcessProposalSuccessfullyOrError
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/endorser/endorser.go:398
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/endorser.(*Endorser).ProcessProposal
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/endorser/endorser.go:340
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/handlers/auth/filter.(*expirationCheckFilter).ProcessProposal
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/handlers/auth/filter/expiration.go:61
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/handlers/auth/filter.(*filter).ProcessProposal
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/handlers/auth/filter/filter.go:32
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric-protos-go/peer._Endorser_ProcessProposal_Handler.func1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/vendor/github.com/hyperledger/fabric-protos-go/peer/peer.pb.go:107
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/internal/peer/node.unaryGrpcLimiter.func1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/internal/peer/node/grpc_limiters.go:51
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:25
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/common/grpclogging.UnaryServerInterceptor.func1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/common/grpclogging/server.go:92
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:25
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/common/grpcmetrics.UnaryServerInterceptor.func1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/common/grpcmetrics/interceptor.go:31
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:25
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:34
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric-protos-go/peer._Endorser_ProcessProposal_Handler
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/vendor/github.com/hyperledger/fabric-protos-go/peer/peer.pb.go:109
Sep 06 17:14:36 hyperledgerfabric peer[1570]: google.golang.org/grpc.(*Server).processUnaryRPC
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:1082
Sep 06 17:14:36 hyperledgerfabric peer[1570]: google.golang.org/grpc.(*Server).handleStream
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:1405
Sep 06 17:14:36 hyperledgerfabric peer[1570]: google.golang.org/grpc.(*Server).serveStreams.func1.1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:746
Sep 06 17:14:36 hyperledgerfabric peer[1570]: runtime.goexit
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /usr/local/go/src/runtime/asm_amd64.s:1374
Sep 06 17:14:36 hyperledgerfabric peer[1570]: failed to execute transaction 16e55029175cd3e14d8155afb932e3fbf2dabdce73db120486968fa9126af2ef
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/chaincode.processChaincodeExecutionResult
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:161
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).Execute
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:156
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/endorser.(*SupportImpl).Execute
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/endorser/support.go:126
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/endorser.(*Endorser).callChaincode
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/endorser/endorser.go:119
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/endorser.(*Endorser).SimulateProposal
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/endorser/endorser.go:187
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/endorser.(*Endorser).ProcessProposalSuccessfullyOrError
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/endorser/endorser.go:398
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/endorser.(*Endorser).ProcessProposal
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/endorser/endorser.go:340
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/handlers/auth/filter.(*expirationCheckFilter).ProcessProposal
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/handlers/auth/filter/expiration.go:61
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/handlers/auth/filter.(*filter).ProcessProposal
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/handlers/auth/filter/filter.go:32
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric-protos-go/peer._Endorser_ProcessProposal_Handler.func1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/vendor/github.com/hyperledger/fabric-protos-go/peer/peer.pb.go:107
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/internal/peer/node.unaryGrpcLimiter.func1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/internal/peer/node/grpc_limiters.go:51
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:25
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/common/grpclogging.UnaryServerInterceptor.func1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/common/grpclogging/server.go:92
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:25
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/common/grpcmetrics.UnaryServerInterceptor.func1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/common/grpcmetrics/interceptor.go:31
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:25
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:34
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric-protos-go/peer._Endorser_ProcessProposal_Handler
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/vendor/github.com/hyperledger/fabric-protos-go/peer/peer.pb.go:109
Sep 06 17:14:36 hyperledgerfabric peer[1570]: google.golang.org/grpc.(*Server).processUnaryRPC
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:1082
Sep 06 17:14:36 hyperledgerfabric peer[1570]: google.golang.org/grpc.(*Server).handleStream
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:1405
Sep 06 17:14:36 hyperledgerfabric peer[1570]: google.golang.org/grpc.(*Server).serveStreams.func1.1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:746
Sep 06 17:14:36 hyperledgerfabric peer[1570]: runtime.goexit
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /usr/local/go/src/runtime/asm_amd64.s:1374 channel=orderer-channel txID=16e55029
Sep 06 17:14:36 hyperledgerfabric peer[1570]: 2021-09-06 17:14:36.991 +08 [lockbasedtxmgr] Done -> DEBU 166d Done with transaction simulation / query execution [16e55029175cd3e14d8155afb932e3fbf2dabdce73db120486968fa9126af2ef]
Sep 06 17:14:36 hyperledgerfabric peer[1570]: 2021-09-06 17:14:36.991 +08 [endorser] ProcessProposal -> WARN 166e Failed to invoke chaincode channel=orderer-channel chaincode=TestHLF error="error in simulation: failed to execute transaction 16e55029175cd3e14d8155afb932e3fbf2dabdce73db120486968fa9126af2ef: could not launch chaincode TestHLF:7544dc9a9c60359520cc16c4f2bbf0091c79a9aa7476e21c1a4cc76bd2f7e27b: chaincode registration failed: container exited with 0"
peer chaincode list
响应为空,因为您作为外部服务的链代码未被 LSCC 注册,但您可以信任 peer lifecycle chaincode queryinstalled
,链代码似乎已安装。
你的post标题说你不能调用。你调用的时候有什么问题?
尽管您可以 运行 直接在 Docker 之外的 Fabric 组件,默认情况下 Peer 将尝试使用 Docker 守护进程来为 运行 创建图像输入链码。这是对等节点工作的标准方式。
有关如何直接 运行 Fabric 组件的更多信息 - 我强烈建议查看 test-network-nano-bash
最近添加到示例中,这准确地显示了如何直接启动所有组件。尽管这仍然需要 Docker 用于链代码。
就链码和 运行 而言,如果没有 docker,也可以使用 Fabric 的外部构建器和链码作为服务器功能(我想当我有时间的时候把它添加到那个 test-network-nano-bash 中)。您无需安装实际的链码 'code',而是安装一个包,其中包含指向链码所在位置的指针 运行ning。只要链码 运行ning 在那个 host/port 就可以 运行 ok。有关该功能的更多信息,请参阅 example repo - 虽然这是关于 K8S 中的 运行ning。
编辑:
如果你想监控所有 运行ning 容器并且还监控任何产生的容器,即使它死了 this script 会很有帮助
我在 Oracle Linux 8.4
中使用 Hyperledger Fabric v2.2.3
我 运行 没有 docker。
我已成功安装、批准并将链码提交到我的频道(订购者频道)。
我正在使用 peer lifecycle chaincode xxx
命令进行安装、批准和提交。
但是,当我使用 peer chaincode list
命令时,它显示为空。
以下是命令及其调试输出。
[user@hyperledgerfabric ~]# /appl/hyperledger-fabric/bin/peer lifecycle chaincode install --peerAddresses localhost:7051 -o localhost:7050 \
/appl/chaincode/TestHLF/TestHLF.tar.gz
2021-09-06 16:07:07.506 +08 [cli.lifecycle.chaincode] submitInstallProposal -> INFO 001 Installed remotely: response:<status:200 payload:"\nHTestHLF:7544dc9a9c60359520cc16c4f2bbf0091c79a9aa7476e21c1a4cc76bd2f7e27b2[=10=]7TestHLF" >
2021-09-06 16:07:07.506 +08 [cli.lifecycle.chaincode] submitInstallProposal -> INFO 002 Chaincode code package identifier: TestHLF:7544dc9a9c60359520cc16c4f2bbf0091c79a9aa7476e21c1a4cc76bd2f7e27b
[user@hyperledgerfabric ~]# /appl/hyperledger-fabric/bin/peer lifecycle chaincode approveformyorg -C orderer-channel \
-n TestHLF \
-v 1.0.0 \
--sequence 1 \
--package-id "TestHLF:7544dc9a9c60359520cc16c4f2bbf0091c79a9aa7476e21c1a4cc76bd2f7e27b" \
--peerAddresses localhost:7051 -o localhost:7050
2021-09-06 16:07:07.614 +08 [grpc] UpdateSubConnState -> DEBU 023 pickfirstBalancer: HandleSubConnStateChange: 0xc000453a40, {CONNECTING <nil>}
2021-09-06 16:07:07.614 +08 [grpc] Infof -> DEBU 024 Channel Connectivity change to CONNECTING
2021-09-06 16:07:07.614 +08 [grpc] Infof -> DEBU 025 Subchannel Connectivity change to READY
2021-09-06 16:07:07.614 +08 [grpc] UpdateSubConnState -> DEBU 026 pickfirstBalancer: HandleSubConnStateChange: 0xc000453a40, {READY <nil>}
2021-09-06 16:07:07.614 +08 [grpc] Infof -> DEBU 027 Channel Connectivity change to READY
2021-09-06 16:07:07.615 +08 [grpc] Infof -> DEBU 028 parsed scheme: ""
2021-09-06 16:07:07.615 +08 [grpc] Infof -> DEBU 029 scheme "" not registered, fallback to default scheme
2021-09-06 16:07:07.615 +08 [grpc] Infof -> DEBU 02a ccResolverWrapper: sending update to cc: {[{localhost:7051 <nil> 0 <nil>}] <nil> <nil>}
2021-09-06 16:07:07.615 +08 [grpc] Infof -> DEBU 02b ClientConn switching balancer to "pick_first"
2021-09-06 16:07:07.615 +08 [grpc] Infof -> DEBU 02c Channel switches to new LB policy "pick_first"
2021-09-06 16:07:07.615 +08 [grpc] Infof -> DEBU 02d Subchannel Connectivity change to CONNECTING
2021-09-06 16:07:07.615 +08 [grpc] Infof -> DEBU 02e Subchannel picks a new address "localhost:7051" to connect
2021-09-06 16:07:07.616 +08 [grpc] UpdateSubConnState -> DEBU 02f pickfirstBalancer: HandleSubConnStateChange: 0xc0004acb80, {CONNECTING <nil>}
2021-09-06 16:07:07.616 +08 [grpc] Infof -> DEBU 030 Channel Connectivity change to CONNECTING
2021-09-06 16:07:07.616 +08 [grpc] Infof -> DEBU 031 Subchannel Connectivity change to READY
2021-09-06 16:07:07.616 +08 [grpc] UpdateSubConnState -> DEBU 032 pickfirstBalancer: HandleSubConnStateChange: 0xc0004acb80, {READY <nil>}
2021-09-06 16:07:07.616 +08 [grpc] Infof -> DEBU 033 Channel Connectivity change to READY
2021-09-06 16:07:07.617 +08 [grpc] WithKeepaliveParams -> DEBU 034 Adjusting keepalive ping interval to minimum period of 10s
2021-09-06 16:07:07.617 +08 [grpc] Infof -> DEBU 035 parsed scheme: ""
2021-09-06 16:07:07.617 +08 [grpc] Infof -> DEBU 036 scheme "" not registered, fallback to default scheme
2021-09-06 16:07:07.617 +08 [grpc] Infof -> DEBU 037 ccResolverWrapper: sending update to cc: {[{localhost:7050 <nil> 0 <nil>}] <nil> <nil>}
2021-09-06 16:07:07.617 +08 [grpc] Infof -> DEBU 038 ClientConn switching balancer to "pick_first"
2021-09-06 16:07:07.617 +08 [grpc] Infof -> DEBU 039 Channel switches to new LB policy "pick_first"
2021-09-06 16:07:07.617 +08 [grpc] Infof -> DEBU 03a Subchannel Connectivity change to CONNECTING
2021-09-06 16:07:07.617 +08 [grpc] Infof -> DEBU 03b Subchannel picks a new address "localhost:7050" to connect
2021-09-06 16:07:07.618 +08 [grpc] UpdateSubConnState -> DEBU 03c pickfirstBalancer: HandleSubConnStateChange: 0xc000021820, {CONNECTING <nil>}
2021-09-06 16:07:07.618 +08 [grpc] Infof -> DEBU 03d Channel Connectivity change to CONNECTING
2021-09-06 16:07:07.618 +08 [grpc] Infof -> DEBU 03e Subchannel Connectivity change to READY
2021-09-06 16:07:07.618 +08 [grpc] UpdateSubConnState -> DEBU 03f pickfirstBalancer: HandleSubConnStateChange: 0xc000021820, {READY <nil>}
2021-09-06 16:07:07.618 +08 [grpc] Infof -> DEBU 040 Channel Connectivity change to READY
2021-09-06 16:07:07.619 +08 [msp.identity] Sign -> DEBU 041 Sign: plaintext: 0ADD080A7308031A0C08AB98D7890610...31613463633736626432663765323762
2021-09-06 16:07:07.619 +08 [msp.identity] Sign -> DEBU 042 Sign: digest: 2866DE7D44974B662CDEECFCA0C958E5884AE0FAA0C1F7E30A72A990FC65D241
2021-09-06 16:07:07.627 +08 [msp.identity] Sign -> DEBU 043 Sign: plaintext: 0ADD080A7308031A0C08AB98D7890610...3A0291CE38FD5CAF0782D4A75B2CB833
2021-09-06 16:07:07.627 +08 [msp.identity] Sign -> DEBU 044 Sign: digest: 2F0106AC9B01865833250CE5D44AC0C8EC4B75A17409E808CB1D7A391F8DEF5C
2021-09-06 16:07:07.627 +08 [msp.identity] Sign -> DEBU 045 Sign: plaintext: 0A85080A1B08051A0608AB98D7890622...00120D1A0B08FFFFFFFFFFFFFFFFFF01
2021-09-06 16:07:07.627 +08 [msp.identity] Sign -> DEBU 046 Sign: digest: 47CF4E1203F1D14CC1AEEB7AC0776DA2F360EE23FEA927E9F5A1E66878BEB027
2021-09-06 16:07:09.652 +08 [chaincodeCmd] ClientWait -> INFO 047 txid [2349c7438eae022d2453d0c57b9ad44250a9aca7ce5f5647b68877b51c20dd73] committed with status (VALID) at localhost:7051
[user@hyperledgerfabric ~]# /appl/hyperledger-fabric/bin/peer lifecycle chaincode commit -C orderer-channel \
-n TestHLF \
-v 1.0.0 \
--sequence 1 \
--peerAddresses localhost:7051 -o localhost:7050
2021-09-06 16:07:09.691 +08 [grpc] UpdateSubConnState -> DEBU 023 pickfirstBalancer: HandleSubConnStateChange: 0xc00036e440, {CONNECTING <nil>}
2021-09-06 16:07:09.692 +08 [grpc] Infof -> DEBU 024 Channel Connectivity change to CONNECTING
2021-09-06 16:07:09.694 +08 [grpc] Infof -> DEBU 025 Subchannel Connectivity change to READY
2021-09-06 16:07:09.694 +08 [grpc] UpdateSubConnState -> DEBU 026 pickfirstBalancer: HandleSubConnStateChange: 0xc00036e440, {READY <nil>}
2021-09-06 16:07:09.694 +08 [grpc] Infof -> DEBU 027 Channel Connectivity change to READY
2021-09-06 16:07:09.695 +08 [grpc] Infof -> DEBU 028 parsed scheme: ""
2021-09-06 16:07:09.695 +08 [grpc] Infof -> DEBU 029 scheme "" not registered, fallback to default scheme
2021-09-06 16:07:09.695 +08 [grpc] Infof -> DEBU 02a ccResolverWrapper: sending update to cc: {[{localhost:7051 <nil> 0 <nil>}] <nil> <nil>}
2021-09-06 16:07:09.695 +08 [grpc] Infof -> DEBU 02b ClientConn switching balancer to "pick_first"
2021-09-06 16:07:09.695 +08 [grpc] Infof -> DEBU 02c Channel switches to new LB policy "pick_first"
2021-09-06 16:07:09.695 +08 [grpc] Infof -> DEBU 02d Subchannel Connectivity change to CONNECTING
2021-09-06 16:07:09.695 +08 [grpc] Infof -> DEBU 02e Subchannel picks a new address "localhost:7051" to connect
2021-09-06 16:07:09.696 +08 [grpc] UpdateSubConnState -> DEBU 02f pickfirstBalancer: HandleSubConnStateChange: 0xc0004eb3e0, {CONNECTING <nil>}
2021-09-06 16:07:09.696 +08 [grpc] Infof -> DEBU 030 Channel Connectivity change to CONNECTING
2021-09-06 16:07:09.696 +08 [grpc] Infof -> DEBU 031 Subchannel Connectivity change to READY
2021-09-06 16:07:09.696 +08 [grpc] UpdateSubConnState -> DEBU 032 pickfirstBalancer: HandleSubConnStateChange: 0xc0004eb3e0, {READY <nil>}
2021-09-06 16:07:09.697 +08 [grpc] Infof -> DEBU 033 Channel Connectivity change to READY
2021-09-06 16:07:09.697 +08 [grpc] WithKeepaliveParams -> DEBU 034 Adjusting keepalive ping interval to minimum period of 10s
2021-09-06 16:07:09.697 +08 [grpc] Infof -> DEBU 035 parsed scheme: ""
2021-09-06 16:07:09.697 +08 [grpc] Infof -> DEBU 036 scheme "" not registered, fallback to default scheme
2021-09-06 16:07:09.697 +08 [grpc] Infof -> DEBU 037 ccResolverWrapper: sending update to cc: {[{localhost:7050 <nil> 0 <nil>}] <nil> <nil>}
2021-09-06 16:07:09.697 +08 [grpc] Infof -> DEBU 038 ClientConn switching balancer to "pick_first"
2021-09-06 16:07:09.697 +08 [grpc] Infof -> DEBU 039 Channel switches to new LB policy "pick_first"
2021-09-06 16:07:09.698 +08 [grpc] Infof -> DEBU 03a Subchannel Connectivity change to CONNECTING
2021-09-06 16:07:09.698 +08 [grpc] Infof -> DEBU 03b Subchannel picks a new address "localhost:7050" to connect
2021-09-06 16:07:09.698 +08 [grpc] UpdateSubConnState -> DEBU 03c pickfirstBalancer: HandleSubConnStateChange: 0xc0005c5ec0, {CONNECTING <nil>}
2021-09-06 16:07:09.698 +08 [grpc] Infof -> DEBU 03d Channel Connectivity change to CONNECTING
2021-09-06 16:07:09.698 +08 [grpc] Infof -> DEBU 03e Subchannel Connectivity change to READY
2021-09-06 16:07:09.698 +08 [grpc] UpdateSubConnState -> DEBU 03f pickfirstBalancer: HandleSubConnStateChange: 0xc0005c5ec0, {READY <nil>}
2021-09-06 16:07:09.698 +08 [grpc] Infof -> DEBU 040 Channel Connectivity change to READY
2021-09-06 16:07:09.698 +08 [msp.identity] Sign -> DEBU 041 Sign: plaintext: 0ADD080A7308031A0C08AD98D7890610...120754657374484C461A05312E302E30
2021-09-06 16:07:09.698 +08 [msp.identity] Sign -> DEBU 042 Sign: digest: 5E875D07A47E27DA338662AACC2860D9419371EDA2D57677D85149C8B18908E1
2021-09-06 16:07:09.704 +08 [msp.identity] Sign -> DEBU 043 Sign: plaintext: 0ADD080A7308031A0C08AD98D7890610...BD169FAD1ECF8613FFD9C8CE30A6C9AC
2021-09-06 16:07:09.704 +08 [msp.identity] Sign -> DEBU 044 Sign: digest: 4E45786A0763C875B6B18A7E30D2332BC45543DCA7885B39DAFC2C86F296856F
2021-09-06 16:07:09.705 +08 [msp.identity] Sign -> DEBU 045 Sign: plaintext: 0A85080A1B08051A0608AD98D7890622...00120D1A0B08FFFFFFFFFFFFFFFFFF01
2021-09-06 16:07:09.705 +08 [msp.identity] Sign -> DEBU 046 Sign: digest: 76501C0D734448AB048D31B2DC6A8428EE8BEA6F18FD1450ED0B9058890678C9
2021-09-06 16:07:11.728 +08 [chaincodeCmd] ClientWait -> INFO 047 txid [7d7e22e6e7d71ebb3b73fd797114da6c0ffbf3de1ab3e0e12d4c8ac8e409fdec] committed with status (VALID) at localhost:7051
这里是我用来查看是否存在的命令,发现使用peer chaincode list
没有安装任何东西。
[user@hyperledgerfabric ~]# /appl/hyperledger-fabric/bin/peer lifecycle chaincode queryinstalled --peerAddresses localhost:7051 -o localhost:7051
Installed chaincodes on peer:
Package ID: TestHLF:7544dc9a9c60359520cc16c4f2bbf0091c79a9aa7476e21c1a4cc76bd2f7e27b, Label: TestHLF
[user@hyperledgerfabric ~]# /appl/hyperledger-fabric/bin/peer lifecycle chaincode queryapproved -C orderer-channel \
-n TestHLF \
--peerAddresses localhost:7051 -o localhost:7051
Approved chaincode definition for chaincode 'TestHLF' on channel 'orderer-channel':
sequence: 1, version: 1.0.0, init-required: false, package-id: TestHLF:7544dc9a9c60359520cc16c4f2bbf0091c79a9aa7476e21c1a4cc76bd2f7e27b, endorsement plugin: escc, validation plugin: vscc
[user@hyperledgerfabric ~]# /appl/hyperledger-fabric/bin/peer lifecycle chaincode querycommitted -C orderer-channel \
-n TestHLF \
--peerAddresses localhost:7051 -o localhost:7051
Committed chaincode definition for chaincode 'TestHLF' on channel 'orderer-channel':
Version: 1.0.0, Sequence: 1, Endorsement Plugin: escc, Validation Plugin: vscc, Approvals: [MyOrg1: true]
[user@hyperledgerfabric ~]# /appl/hyperledger-fabric/bin/peer chaincode list --installed \
-C orderer-channel \
--peerAddresses localhost:7051 -o localhost:7050
Get installed chaincodes on peer:
这是我执行peer chaincode invoke
,
时的输出
在我通过 cli 调用期间在控制台上的这个:
[user@hyperledgerfabric ~]# /appl/hyperledger-fabric/bin/peer chaincode invoke -C orderer-channel -n TestHLF --peerAddresses localhost:7051 -o localhost:7050 -c '{"Args":["retrieve", "key1"]}'
2021-09-06 17:14:36.991 +08 [chaincodeCmd] chaincodeInvokeOrQuery -> DEBU 043 ESCC invoke result: response:<status:500 message:"error in simulation: failed to execute transaction 16e55029175cd3e14d8155afb932e3fbf2dabdce73db120486968fa9126af2ef: could not launch chaincode TestHLF:7544dc9a9c60359520cc16c4f2bbf0091c79a9aa7476e21c1a4cc76bd2f7e27b: chaincode registration failed: container exited with 0" >
Error: endorsement failure during invoke. response: status:500 message:"error in simulation: failed to execute transaction 16e55029175cd3e14d8155afb932e3fbf2dabdce73db120486968fa9126af2ef: could not launch chaincode TestHLF:7544dc9a9c60359520cc16c4f2bbf0091c79a9aa7476e21c1a4cc76bd2f7e27b: chaincode registration failed: container exited with 0"
这是我通过 cli peer chaincode invoke
调用期间的对等调试日志:
Sep 06 17:14:36 hyperledgerfabric peer[1570]: 2021-09-06 17:14:36.986 +08 [chaincode] Start -> DEBU 1667 start container: TestHLF:7544dc9a9c60359520cc16c4f2bbf0091c79a9aa7476e21c1a4cc76bd2f7e27b
Sep 06 17:14:36 hyperledgerfabric peer[1570]: 2021-09-06 17:14:36.990 +08 [chaincode] Launch -> DEBU 1668 stopping due to error while launching: container exited with 0
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/chaincode.(*RuntimeLauncher).Launch.func1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/chaincode/runtime_launcher.go:118
Sep 06 17:14:36 hyperledgerfabric peer[1570]: runtime.goexit
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /usr/local/go/src/runtime/asm_amd64.s:1374
Sep 06 17:14:36 hyperledgerfabric peer[1570]: chaincode registration failed
Sep 06 17:14:36 hyperledgerfabric peer[1570]: 2021-09-06 17:14:36.990 +08 [chaincode] Launch -> DEBU 1669 launch complete
Sep 06 17:14:36 hyperledgerfabric peer[1570]: 2021-09-06 17:14:36.990 +08 [chaincode] Deregister -> DEBU 166a deregister handler: TestHLF:7544dc9a9c60359520cc16c4f2bbf0091c79a9aa7476e21c1a4cc76bd2f7e27b
Sep 06 17:14:36 hyperledgerfabric peer[1570]: 2021-09-06 17:14:36.991 +08 [endorser] callChaincode -> INFO 166b finished chaincode: TestHLF duration: 4ms channel=orderer-channel txID=16e55029
Sep 06 17:14:36 hyperledgerfabric peer[1570]: 2021-09-06 17:14:36.991 +08 [endorser] SimulateProposal -> ERRO 166c failed to invoke chaincode TestHLF, error: container exited with 0
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/chaincode.(*RuntimeLauncher).Launch.func1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/chaincode/runtime_launcher.go:118
Sep 06 17:14:36 hyperledgerfabric peer[1570]: runtime.goexit
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /usr/local/go/src/runtime/asm_amd64.s:1374
Sep 06 17:14:36 hyperledgerfabric peer[1570]: chaincode registration failed
Sep 06 17:14:36 hyperledgerfabric peer[1570]: could not launch chaincode TestHLF:7544dc9a9c60359520cc16c4f2bbf0091c79a9aa7476e21c1a4cc76bd2f7e27b
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).Launch
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:85
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).Invoke
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:197
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).Execute
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:155
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/endorser.(*SupportImpl).Execute
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/endorser/support.go:126
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/endorser.(*Endorser).callChaincode
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/endorser/endorser.go:119
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/endorser.(*Endorser).SimulateProposal
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/endorser/endorser.go:187
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/endorser.(*Endorser).ProcessProposalSuccessfullyOrError
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/endorser/endorser.go:398
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/endorser.(*Endorser).ProcessProposal
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/endorser/endorser.go:340
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/handlers/auth/filter.(*expirationCheckFilter).ProcessProposal
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/handlers/auth/filter/expiration.go:61
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/handlers/auth/filter.(*filter).ProcessProposal
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/handlers/auth/filter/filter.go:32
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric-protos-go/peer._Endorser_ProcessProposal_Handler.func1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/vendor/github.com/hyperledger/fabric-protos-go/peer/peer.pb.go:107
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/internal/peer/node.unaryGrpcLimiter.func1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/internal/peer/node/grpc_limiters.go:51
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:25
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/common/grpclogging.UnaryServerInterceptor.func1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/common/grpclogging/server.go:92
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:25
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/common/grpcmetrics.UnaryServerInterceptor.func1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/common/grpcmetrics/interceptor.go:31
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:25
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:34
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric-protos-go/peer._Endorser_ProcessProposal_Handler
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/vendor/github.com/hyperledger/fabric-protos-go/peer/peer.pb.go:109
Sep 06 17:14:36 hyperledgerfabric peer[1570]: google.golang.org/grpc.(*Server).processUnaryRPC
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:1082
Sep 06 17:14:36 hyperledgerfabric peer[1570]: google.golang.org/grpc.(*Server).handleStream
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:1405
Sep 06 17:14:36 hyperledgerfabric peer[1570]: google.golang.org/grpc.(*Server).serveStreams.func1.1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:746
Sep 06 17:14:36 hyperledgerfabric peer[1570]: runtime.goexit
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /usr/local/go/src/runtime/asm_amd64.s:1374
Sep 06 17:14:36 hyperledgerfabric peer[1570]: failed to execute transaction 16e55029175cd3e14d8155afb932e3fbf2dabdce73db120486968fa9126af2ef
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/chaincode.processChaincodeExecutionResult
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:161
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).Execute
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:156
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/endorser.(*SupportImpl).Execute
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/endorser/support.go:126
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/endorser.(*Endorser).callChaincode
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/endorser/endorser.go:119
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/endorser.(*Endorser).SimulateProposal
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/endorser/endorser.go:187
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/endorser.(*Endorser).ProcessProposalSuccessfullyOrError
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/endorser/endorser.go:398
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/endorser.(*Endorser).ProcessProposal
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/endorser/endorser.go:340
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/handlers/auth/filter.(*expirationCheckFilter).ProcessProposal
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/handlers/auth/filter/expiration.go:61
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/core/handlers/auth/filter.(*filter).ProcessProposal
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/core/handlers/auth/filter/filter.go:32
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric-protos-go/peer._Endorser_ProcessProposal_Handler.func1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/vendor/github.com/hyperledger/fabric-protos-go/peer/peer.pb.go:107
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/internal/peer/node.unaryGrpcLimiter.func1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/internal/peer/node/grpc_limiters.go:51
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:25
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/common/grpclogging.UnaryServerInterceptor.func1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/common/grpclogging/server.go:92
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:25
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric/common/grpcmetrics.UnaryServerInterceptor.func1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/common/grpcmetrics/interceptor.go:31
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1.1.1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:25
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/grpc-ecosystem/go-grpc-middleware.ChainUnaryServer.func1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/vendor/github.com/grpc-ecosystem/go-grpc-middleware/chain.go:34
Sep 06 17:14:36 hyperledgerfabric peer[1570]: github.com/hyperledger/fabric-protos-go/peer._Endorser_ProcessProposal_Handler
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/vendor/github.com/hyperledger/fabric-protos-go/peer/peer.pb.go:109
Sep 06 17:14:36 hyperledgerfabric peer[1570]: google.golang.org/grpc.(*Server).processUnaryRPC
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:1082
Sep 06 17:14:36 hyperledgerfabric peer[1570]: google.golang.org/grpc.(*Server).handleStream
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:1405
Sep 06 17:14:36 hyperledgerfabric peer[1570]: google.golang.org/grpc.(*Server).serveStreams.func1.1
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /__w/1/go/src/github.com/hyperledger/fabric/vendor/google.golang.org/grpc/server.go:746
Sep 06 17:14:36 hyperledgerfabric peer[1570]: runtime.goexit
Sep 06 17:14:36 hyperledgerfabric peer[1570]: /usr/local/go/src/runtime/asm_amd64.s:1374 channel=orderer-channel txID=16e55029
Sep 06 17:14:36 hyperledgerfabric peer[1570]: 2021-09-06 17:14:36.991 +08 [lockbasedtxmgr] Done -> DEBU 166d Done with transaction simulation / query execution [16e55029175cd3e14d8155afb932e3fbf2dabdce73db120486968fa9126af2ef]
Sep 06 17:14:36 hyperledgerfabric peer[1570]: 2021-09-06 17:14:36.991 +08 [endorser] ProcessProposal -> WARN 166e Failed to invoke chaincode channel=orderer-channel chaincode=TestHLF error="error in simulation: failed to execute transaction 16e55029175cd3e14d8155afb932e3fbf2dabdce73db120486968fa9126af2ef: could not launch chaincode TestHLF:7544dc9a9c60359520cc16c4f2bbf0091c79a9aa7476e21c1a4cc76bd2f7e27b: chaincode registration failed: container exited with 0"
peer chaincode list
响应为空,因为您作为外部服务的链代码未被 LSCC 注册,但您可以信任 peer lifecycle chaincode queryinstalled
,链代码似乎已安装。
你的post标题说你不能调用。你调用的时候有什么问题?
尽管您可以 运行 直接在 Docker 之外的 Fabric 组件,默认情况下 Peer 将尝试使用 Docker 守护进程来为 运行 创建图像输入链码。这是对等节点工作的标准方式。
有关如何直接 运行 Fabric 组件的更多信息 - 我强烈建议查看 test-network-nano-bash
最近添加到示例中,这准确地显示了如何直接启动所有组件。尽管这仍然需要 Docker 用于链代码。
就链码和 运行 而言,如果没有 docker,也可以使用 Fabric 的外部构建器和链码作为服务器功能(我想当我有时间的时候把它添加到那个 test-network-nano-bash 中)。您无需安装实际的链码 'code',而是安装一个包,其中包含指向链码所在位置的指针 运行ning。只要链码 运行ning 在那个 host/port 就可以 运行 ok。有关该功能的更多信息,请参阅 example repo - 虽然这是关于 K8S 中的 运行ning。
编辑:
如果你想监控所有 运行ning 容器并且还监控任何产生的容器,即使它死了 this script 会很有帮助