Время ожидания истекло, в то время как экземпляр однорангового цепного кода создается - PullRequest
0 голосов
/ 22 мая 2018

Я использую CA для создания многоузловой фабричной сети.

Мой код такой: https://github.com/fnpac/fabric-web/blob/master/fabric-ca/scripts/run-fabric.sh

Конфигурация узла: https://github.com/fnpac/fabric-web/blob/ce7929e59b0ba1bc3a55d16ea66fa08131c294dc/fabric-ca/makeDocker.sh#L207-L272

Когда я создаю экземпляркод цепочки, он сообщит о следующей ошибке:

##### 2018-05-22 09:14:49 Instantiating chaincode on peer1-org2 ...
2018-05-22 09:14:49.374 UTC [msp] GetLocalMSP -> DEBU 001 Returning existing local MSP
2018-05-22 09:14:49.375 UTC [msp] GetDefaultSigningIdentity -> DEBU 002 Obtaining default signing identity
2018-05-22 09:14:49.382 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 003 Using default escc
2018-05-22 09:14:49.382 UTC [chaincodeCmd] checkChaincodeCmdParams -> INFO 004 Using default vscc
2018-05-22 09:14:49.383 UTC [chaincodeCmd] getChaincodeSpec -> DEBU 005 java chaincode disabled
2018-05-22 09:14:49.383 UTC [msp/identity] Sign -> DEBU 006 Sign: plaintext: 0AAB090A6708031A0C0889BF8FD80510...324D53500A04657363630A0476736363 
2018-05-22 09:14:49.383 UTC [msp/identity] Sign -> DEBU 007 Sign: digest: 754973C8F271A44D0933CD73D9219A51DA5FDD2E84938E6EA10F9DA3E2981692 
Error: Error endorsing chaincode: rpc error: code = Unknown desc = timeout expired while starting chaincode mycc:1.0(networkid:dev,peerid:peer1-org2,tx:a93b69c5243e04171ca16188e733d03671d93bb606819b101125642410d0c911)
Usage:
  peer chaincode instantiate [flags]

Flags:
  -C, --channelID string            The channel on which this command should be executed

И журнал Заказчика:

2018-05-22 09:19:49.391 UTC [dockercontroller] stopInternal -> DEBU 5e1 Kill container dev-peer1-org2-mycc-1.0 (API error (409): {"message":"Cannot kill container: dev-peer1-org2-mycc-1.0: Container 9751bded21b329c2b516386d78fd7a751833fccdde5104a96dcf3f22304ff0d8 is not running"}
)
2018-05-22 09:19:49.400 UTC [dockercontroller] stopInternal -> DEBU 5e2 Removed container dev-peer1-org2-mycc-1.0
2018-05-22 09:19:49.400 UTC [container] unlockContainer -> DEBU 5e3 container lock deleted(dev-peer1-org2-mycc-1.0)
2018-05-22 09:19:49.400 UTC [chaincode] func1 -> DEBU 5e4 chaincode mycc:1.0 launch seq completed
2018-05-22 09:19:49.400 UTC [chaincode] Launch -> ERRO 5e5 launchAndWaitForRegister failed: timeout expired while starting chaincode mycc:1.0(networkid:dev,peerid:peer1-org2,tx:a93b69c5243e04171ca16188e733d03671d93bb606819b101125642410d0c911)
github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).launchAndWaitForRegister
    /opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:569
github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).Launch
    /opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:731
github.com/hyperledger/fabric/core/chaincode.Execute
    /opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/exectransaction.go:45
github.com/hyperledger/fabric/core/endorser.(*SupportImpl).Execute
    /opt/gopath/src/github.com/hyperledger/fabric/core/endorser/support.go:83
github.com/hyperledger/fabric/core/endorser.(*Endorser).callChaincode
    /opt/gopath/src/github.com/hyperledger/fabric/core/endorser/endorser.go:164
github.com/hyperledger/fabric/core/endorser.(*Endorser).simulateProposal
    /opt/gopath/src/github.com/hyperledger/fabric/core/endorser/endorser.go:265
github.com/hyperledger/fabric/core/endorser.(*Endorser).ProcessProposal
    /opt/gopath/src/github.com/hyperledger/fabric/core/endorser/endorser.go:491
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:781
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:981
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:551
runtime.goexit
    /opt/go/src/runtime/asm_amd64.s:2337
2018-05-22 09:19:49.400 UTC [endorser] callChaincode -> DEBU 5e6 [mychannel][a93b69c5] Exit
2018-05-22 09:19:49.400 UTC [endorser] simulateProposal -> ERRO 5e7 [mychannel][a93b69c5] failed to invoke chaincode name:"lscc" , error: timeout expired while starting chaincode mycc:1.0(networkid:dev,peerid:peer1-org2,tx:a93b69c5243e04171ca16188e733d03671d93bb606819b101125642410d0c911)
github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).launchAndWaitForRegister
    /opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:569
github.com/hyperledger/fabric/core/chaincode.(*ChaincodeSupport).Launch
    /opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/chaincode_support.go:731

как я могу решить?

1 Ответ

0 голосов
/ 25 мая 2018

Я исправил это.

Это потому, что я выполняю операцию peer chaincode instantiate на другом компьютере, и я должен выполнить ее на машине указанного узла.

Например:

 # Instantiate the chain code on the first peer node of the first peer organization
 makePolicy
 initPeerVars ${PORGS[0]} 1
 switchToAdminIdentity
 Logr "Instantiating chaincode on $PEER_HOST ..."
 Peer chaincode instantiate -C $CHANNEL_NAME -n mycc -v 1.0 -c '{"Args":["init","a","100","b","200"]}' -P "$POLICY" $ORDERER_CONN_ARGS

Приведенный выше сценарий должен выполняться на компьютере первого однорангового узла первой одноранговой организации.Если вы выполните скрипт на других машинах, это будет Timeout

...