【问题标题】:Unable to deploy java chain code which is provided by IBM Bluemix无法部署 IBM Bluemix 提供的 java 链代码
【发布时间】:2017-06-13 09:48:45
【问题描述】:

来自 restclient 的请求:

发布http://localhost:7050/chaincode

请求:
{ "jsonrpc": "2.0", “方法”:“部署”, “参数”:{ “类型”:1, “链码ID”:{ “名称”:“拉贾” }, “ctorMsg”:{ "args":["init", "a", "100", "b", "200"] } }, “身份证”:5 }

用链码id名称注册java链码:

rajasekhar@rajasekhar-VirtualBox:~/mychaincode/src/github.com/hyperledger/fabric/examples/chaincode/java/chaincode_example02/build/distributions/chaincode_example02/bin$ CORE_CHAINCODE_ID_NAME=raja  ./chaincode_example02
Jun 13, 2017 1:24:06 PM org.hyperledger.fabric.shim.ChaincodeBase newPeerClientConnection
INFO: Configuring channel connection to peer.
Jun 13, 2017 1:24:09 PM org.hyperledger.fabric.shim.ChaincodeBase chatWithPeer
INFO: Connecting to peer.
Jun 13, 2017 1:24:09 PM io.grpc.internal.TransportSet$1 call
INFO: Created transport io.grpc.netty.NettyClientTransport@599c4539(/127.0.0.1:7051) for /127.0.0.1:7051
Jun 13, 2017 1:24:10 PM io.grpc.internal.TransportSet$TransportListener transportReady
INFO: Transport io.grpc.netty.NettyClientTransport@599c4539(/127.0.0.1:7051) for /127.0.0.1:7051 is ready
Jun 13, 2017 1:24:10 PM org.hyperledger.fabric.shim.ChaincodeBase chatWithPeer
INFO: Registering as 'raja' ... sending REGISTER
java.lang.RuntimeException: [raja]Chaincode handler org.hyperledger.fabric.shim.fsm cannot handle message (INIT) with payload size (23) while in state: established
    at org.hyperledger.fabric.shim.impl.Handler.handleMessage(Handler.java:493)
    at org.hyperledger.fabric.shim.ChaincodeBase$1.onNext(ChaincodeBase.java:188)
    at org.hyperledger.fabric.shim.ChaincodeBase$1.onNext(ChaincodeBase.java:181)
    at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onMessage(ClientCalls.java:305)
    at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$2.runInContext(ClientCallImpl.java:423)
    at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:54)
    at io.grpc.internal.SerializingExecutor$TaskRunner.run(SerializingExecutor.java:154)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:748)

【问题讨论】:

标签: ibm-cloud blockchain hyperledger-fabric


【解决方案1】:

您需要提供更多信息,说明您目前所做的工作。仅使用错误消息 - 无法确定失败的原因。

这里有关于如何为区块链编写 Java 链代码的优秀文档:https://www.ibm.com/developerworks/library/j-chaincode-for-java-developers/index.html

我希望您已经看过上述文档。请一一完成这些步骤。该文档在设置环境以使用 Java 编写您的第一个链代码方面非常广泛。

希望这会有所帮助。

【讨论】:

    猜你喜欢
    • 2019-05-01
    • 2016-07-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多