部署链码时收到错误

时间:2016-11-01 09:43:41

标签: blockchain hyperledger

我是Block chain和HyperLedger的新手。我正在使用以下链接开始工作。 http://hyperledger-fabric.readthedocs.io/en/latest/Setup/Chaincode-setup/#option-3-docker-toolbox

在创建对等和注册链代码名称后,我从另一个窗口执行了以下命令:

peer chaincode deploy -u jim -p 'github.com/hyperledger/fabric/examples/chaincode/go/chaincode_example02' -n mycc -c '{"Args": ["mycc", "a","100", "b", "200"]}'

收到错误:

Error: Error endorsing chaincode: rpc error: code = 2 desc = Failed to init chaincode(handler not found for chaincode 418d7ac89eb66fc076b6e1f90cd3c445ebac8ecfb84f6914a101fde33ecca9b37cddf535f464fa5a3f336541992fe008ba7cf0f2aff9f23facc79ee5dd12c4d5)

Usage:
  peer chaincode deploy [flags]

Global Flags:
  -a, --attributes string          User attributes for the chaincode in JSON format (default "[]")
  -c, --ctor string                Constructor message for the chaincode in JSON format (default "{}")
  -l, --lang string                Language the chaincode is written in (default "golang")
      --logging-level string       Default logging level and overrides, see core.yaml for full syntax
  -n, --name string                Name of the chaincode returned by the deploy transaction
  -p, --path string                Path to chaincode
      --test.coverprofile string   Done (default "coverage.cov")
  -t, --tid string                 Name of a custom ID generation algorithm (hashing and decoding) e.g. sha256base64
  -u, --username string            Username for chaincode operations when security is enabled
  -v, --version                    Display current version of fabric peer server

我还检查了对等日志,发现如下:

09:12:50.404 [chaincode] Launch -> DEBU 269 chaincode is running(no need to launch) : lccc
09:12:50.408 [chaincode] sendExecuteMessage -> DEBU 26a [221bef6f]Inside sendExecuteMessage. Message TRANSACTION
09:12:50.409 [chaincode] setChaincodeSecurityContext -> DEBU 26b setting chaincode security context...
09:12:50.409 [chaincode] setChaincodeSecurityContext -> DEBU 26c setting chaincode security context. Transaction different from nil
09:12:50.409 [chaincode] setChaincodeSecurityContext -> DEBU 26d setting chaincode security context. Metadata []
09:12:50.414 [chaincode] sendExecuteMessage -> DEBU 26e [221bef6f]sendExecuteMsg trigger event TRANSACTION
09:12:50.415 [chaincode] processStream -> DEBU 26f [221bef6f]Move state message TRANSACTION
09:12:50.415 [chaincode] HandleMessage -> DEBU 270 [221bef6f]Handling ChaincodeMessage of type: TRANSACTION in state ready
09:12:50.415 [chaincode] processStream -> DEBU 271 [221bef6f]sending state message TRANSACTION
09:12:50.421 [chaincode] processStream -> DEBU 272 [221bef6f]Received message GET_STATE from shim
09:12:50.421 [chaincode] HandleMessage -> DEBU 273 [221bef6f]Handling ChaincodeMessage of type: GET_STATE in state transaction
09:12:50.421 [chaincode] afterGetState -> DEBU 274 [221bef6f]Received GET_STATE, invoking get state from ledger
09:12:50.421 [chaincode] filterError -> DEBU 275 Ignoring NoTransitionError: no transition
09:12:50.421 [chaincode] func1 -> DEBU 276 [221bef6f]No state associated with key: 18chaincodes-default. Sending RESPONSE with an empty payload
09:12:50.421 [chaincode] 1 -> DEBU 277 [221bef6f]handleGetState serial send RESPONSE
09:12:50.421 [chaincode] processStream -> DEBU 278 [221bef6f]Received message GET_STATE from shim
09:12:50.421 [chaincode] HandleMessage -> DEBU 279 [221bef6f]Handling ChaincodeMessage of type: GET_STATE in state transaction
09:12:50.421 [chaincode] afterGetState -> DEBU 27a [221bef6f]Received GET_STATE, invoking get state from ledger
09:12:50.422 [chaincode] filterError -> DEBU 27b Ignoring NoTransitionError: no transition
09:12:50.422 [chaincode] func1 -> DEBU 27c [221bef6f]No state associated with key: 18chaincodes-default. Sending RESPONSE with an empty payload
09:12:50.422 [chaincode] 1 -> DEBU 27d [221bef6f]handleGetState serial send RESPONSE
09:12:50.422 [chaincode] processStream -> DEBU 27e [221bef6f]Received message PUT_STATE from shim
09:12:50.422 [chaincode] HandleMessage -> DEBU 27f [221bef6f]Handling ChaincodeMessage of type: PUT_STATE in state transaction
09:12:50.422 [chaincode] afterPutState -> DEBU 280 Received PUT_STATE in state busyxact, invoking put state to ledger
09:12:50.422 [chaincode] func1 -> DEBU 281 [221bef6f]state is busyxact
09:12:50.422 [chaincode] func1 -> DEBU 282 [221bef6f]Completed PUT_STATE. Sending RESPONSE
09:12:50.422 [chaincode] 1 -> DEBU 283 [221bef6f]enterBusyState trigger event RESPONSE
09:12:50.422 [chaincode] processStream -> DEBU 284 [221bef6f]Move state message RESPONSE
09:12:50.422 [chaincode] HandleMessage -> DEBU 285 [221bef6f]Handling ChaincodeMessage of type: RESPONSE in state busyxact
09:12:50.422 [chaincode] processStream -> DEBU 286 [221bef6f]sending state message RESPONSE
09:12:50.425 [chaincode] processStream -> DEBU 287 [221bef6f]Received message GET_STATE from shim
09:12:50.426 [chaincode] HandleMessage -> DEBU 288 [221bef6f]Handling ChaincodeMessage of type: GET_STATE in state transaction
09:12:50.426 [chaincode] afterGetState -> DEBU 289 [221bef6f]Received GET_STATE, invoking get state from ledger
09:12:50.426 [chaincode] filterError -> DEBU 28a Ignoring NoTransitionError: no transition
09:12:50.426 [chaincode] func1 -> DEBU 28b [221bef6f]No state associated with key: 18chaincodes-default128418d7ac89eb66fc076b6e1f90cd3c445ebac8ecfb84f6914a101fde33ecca9b37cddf535f464fa5a3f336541992fe008ba7cf0f2aff9f23facc79ee5dd12c4d5. Sending RESPONSE with an empty payload
09:12:50.426 [chaincode] 1 -> DEBU 28c [221bef6f]handleGetState serial send RESPONSE
09:12:50.426 [chaincode] processStream -> DEBU 28d [221bef6f]Received message GET_STATE from shim
09:12:50.426 [chaincode] HandleMessage -> DEBU 28e [221bef6f]Handling ChaincodeMessage of type: GET_STATE in state transaction
09:12:50.427 [chaincode] afterGetState -> DEBU 28f [221bef6f]Received GET_STATE, invoking get state from ledger
09:12:50.427 [chaincode] filterError -> DEBU 290 Ignoring NoTransitionError: no transition
09:12:50.427 [chaincode] func1 -> DEBU 291 [221bef6f]Got state. Sending RESPONSE
09:12:50.427 [chaincode] 1 -> DEBU 292 [221bef6f]handleGetState serial send RESPONSE
09:12:50.427 [chaincode] processStream -> DEBU 293 [221bef6f]Received message GET_STATE from shim
09:12:50.427 [chaincode] HandleMessage -> DEBU 294 [221bef6f]Handling ChaincodeMessage of type: GET_STATE in state transaction
09:12:50.427 [chaincode] afterGetState -> DEBU 295 [221bef6f]Received GET_STATE, invoking get state from ledger
09:12:50.427 [chaincode] filterError -> DEBU 296 Ignoring NoTransitionError: no transition
09:12:50.427 [chaincode] func1 -> DEBU 297 [221bef6f]No state associated with key: 18chaincodes-default128418d7ac89eb66fc076b6e1f90cd3c445ebac8ecfb84f6914a101fde33ecca9b37cddf535f464fa5a3f336541992fe008ba7cf0f2aff9f23facc79ee5dd12c4d5. Sending RESPONSE with an empty payload
09:12:50.427 [chaincode] 1 -> DEBU 298 [221bef6f]handleGetState serial send RESPONSE
09:12:50.435 [chaincode] processStream -> DEBU 299 [221bef6f]Received message PUT_STATE from shim
09:12:50.435 [chaincode] HandleMessage -> DEBU 29a [221bef6f]Handling ChaincodeMessage of type: PUT_STATE in state transaction
09:12:50.435 [chaincode] afterPutState -> DEBU 29b Received PUT_STATE in state busyxact, invoking put state to ledger
09:12:50.435 [chaincode] func1 -> DEBU 29c [221bef6f]state is busyxact
09:12:50.439 [chaincode] func1 -> DEBU 29d [221bef6f]Completed PUT_STATE. Sending RESPONSE
09:12:50.439 [chaincode] 1 -> DEBU 29e [221bef6f]enterBusyState trigger event RESPONSE
09:12:50.439 [chaincode] processStream -> DEBU 29f [221bef6f]Move state message RESPONSE
09:12:50.439 [chaincode] HandleMessage -> DEBU 2a0 [221bef6f]Handling ChaincodeMessage of type: RESPONSE in state busyxact
09:12:50.439 [chaincode] processStream -> DEBU 2a1 [221bef6f]sending state message RESPONSE
09:12:50.439 [chaincode] processStream -> DEBU 2a2 [221bef6f]Received message COMPLETED from shim
09:12:50.439 [chaincode] HandleMessage -> DEBU 2a3 [221bef6f]Handling ChaincodeMessage of type: COMPLETED in state transaction
09:12:50.439 [chaincode] beforeCompletedEvent -> DEBU 2a4 [221bef6f]beforeCompleted - not in ready state will notify when in readystate
09:12:50.439 [chaincode] enterReadyState -> DEBU 2a5 [221bef6f]Entered state ready
09:12:50.439 [chaincode] notify -> DEBU 2a6 notifying Txid:221bef6f-eafc-4d12-9a42-2bc02ad834f2
09:12:50.457 [chaincode] Deploy -> DEBU 2a7 user runs chaincode, not deploying chaincode
09:12:50.463 [chaincode] sendInitOrReady -> DEBU 2a8 handler not found for chaincode 418d7ac89eb66fc076b6e1f90cd3c445ebac8ecfb84f6914a101fde33ecca9b37cddf535f464fa5a3f336541992fe008ba7cf0f2aff9f23facc79ee5dd12c4d5
09:12:50.463 [chaincode] Launch -> ERRO 2a9 sending init failed(handler not found for chaincode 418d7ac89eb66fc076b6e1f90cd3c445ebac8ecfb84f6914a101fde33ecca9b37cddf535f464fa5a3f336541992fe008ba7cf0f2aff9f23facc79ee5dd12c4d5)
09:12:50.469 [chaincode] Launch -> DEBU 2aa sending init completed
09:12:50.469 [chaincode] Launch -> DEBU 2ab LaunchChaincode complete

请帮我解决问题。

0 个答案:

没有答案