0
この間違いを見てください。どうもありがとうございました。 私はIPファブリック-SDK-javaの例を変更するために同じ方法を使用することに成功しているが、私はIPを変更するために、別のオーダーサーバに切り替え、および秘密鍵ファイルのアドレス、 私のスタック情報が間違っている:最初に受信したフレームが設定ではありませんでした。最初の5バイトの16進数のダンプ:1503010002
09:51:03.441 [grpc-default-worker-ELG-1-2] DEBUG io.grpc.netty.NettyClientHandler - [id: 0x35dec18c, L:/192.168.2.10:51815 - R:/10.60.248.45:7050] OUTBOUND GO_AWAY: lastStreamId=0 errorCode=1 length=77 bytes=4669727374207265636569766564206672616d6520776173206e6f742053455454494e47532e204865782064756d7020666f7220666972737420352062797465...
org.hyperledger.fabric.sdk.exception.TransactionException: Channel foo sendDeliver failed on orderer orderer.example.com. Reason: INTERNAL
\t at org.hyperledger.fabric.sdk.OrdererClient.sendDeliver(OrdererClient.java:295)
\t at org.hyperledger.fabric.sdk.Orderer.sendDeliver(Orderer.java:172)
\t at org.hyperledger.fabric.sdk.Channel.seekBlock(Channel.java:1198)
\t at org.hyperledger.fabric.sdk.Channel.getLatestBlock(Channel.java:1274)
\t at org.hyperledger.fabric.sdk.Channel.getLastConfigIndex(Channel.java:1097)
\t at org.hyperledger.fabric.sdk.Channel.getConfigurationBlock(Channel.java:1028)
\t at org.hyperledger.fabric.sdk.Channel.parseConfigBlock(Channel.java:949)
\t at org.hyperledger.fabric.sdk.Channel.initialize(Channel.java:676)
\t at com.foresealife.blockchain.controller.ChaincodeController.query(ChaincodeController.java:246)
\t at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
\t at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
\t at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
\t at java.lang.reflect.Method.invoke(Method.java:498)
\t at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
\t at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)
\t at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)
\t at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
\t at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
\t at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
\t at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)
\t at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
\t at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
\t at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872)
\t at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
\t at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
\t at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
\t at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
\t at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
\t at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
\t at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
\t at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
\t at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
\t at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
\t at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
\t at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
\t at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218)
\t at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)
\t at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)
\t at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
\t at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
\t at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962)
\t at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
\t at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
\t at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1115)
\t at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
\t at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
\t at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
\t at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
\t at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
\t at java.lang.Thread.run(Thread.java:745)
Caused by: io.grpc.StatusRuntimeException: INTERNAL
\t at io.grpc.Status.asRuntimeException(Status.java:526)
\t at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:380)
\t at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:419)
\t at io.grpc.internal.ClientCallImpl.access$100(ClientCallImpl.java:60)
\t at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:493)
\t at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$500(ClientCallImpl.java:422)
\t at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:525)
\t at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
\t at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:102)
\t at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
\t at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
\t ... 1 more
Caused by: io.netty.handler.codec.http2.Http2Exception: First received frame was not SETTINGS. Hex dump for first 5 bytes: 1503010002
\t at io.netty.handler.codec.http2.Http2Exception.connectionError(Http2Exception.java:85)
\t at io.netty.handler.codec.http2.Http2ConnectionHandler$PrefaceDecoder.verifyFirstFrameIsSettings(Http2ConnectionHandler.java:320)
\t at io.netty.handler.codec.http2.Http2ConnectionHandler$PrefaceDecoder.decode(Http2ConnectionHandler.java:221)
\t at io.netty.handler.codec.http2.Http2ConnectionHandler.decode(Http2ConnectionHandler.java:413)
\t at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:489)
\t at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:428)
\t at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:265)
\t at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
\t at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
\t at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
\t at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334)
\t at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
\t at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
\t at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926)
\t at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:134)
\t at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:644)
\t at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:579)
\t at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:496)
\t at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:458)
\t at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
\t at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:138)
\t ... 1 more
09:51:03.466 [grpc-default-worker-ELG-1-2] DEBUG io.netty.handler.codec.http2.Http2ConnectionHandler - [id: 0x35dec18c, L:/192.168.2.10:51815 ! R:/10.60.248.45:7050] Sending GOAWAY failed: lastStreamId '0', errorCode '1', debugData 'First received frame was not SETTINGS. Hex dump for first 5 bytes: 1503010002'. Forcing shutdown of the connection.
java.io.IOException: Broken pipe
\t at sun.nio.ch.FileDispatcherImpl.writev0(Native Method)
\t at sun.nio.ch.SocketDispatcher.writev(SocketDispatcher.java:51)
\t at sun.nio.ch.IOUtil.write(IOUtil.java:148)
\t at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:504)
\t at io.netty.channel.socket.nio.NioSocketChannel.doWrite(NioSocketChannel.java:432)
\t at io.netty.channel.AbstractChannel$AbstractUnsafe.flush0(AbstractChannel.java:856)
\t at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.flush0(AbstractNioChannel.java:362)
\t at io.netty.channel.AbstractChannel$AbstractUnsafe.flush(AbstractChannel.java:823)
\t at io.netty.channel.DefaultChannelPipeline$HeadContext.flush(DefaultChannelPipeline.java:1296)
\t at io.netty.channel.AbstractChannelHandlerContext.invokeFlush0(AbstractChannelHandlerContext.java:776)
\t at io.netty.channel.AbstractChannelHandlerContext.invokeFlush(AbstractChannelHandlerContext.java:768)
\t at io.netty.channel.AbstractChannelHandlerContext.flush(AbstractChannelHandlerContext.java:749)
\t at io.netty.handler.codec.http2.Http2ConnectionHandler.onError(Http2ConnectionHandler.java:573)
\t at io.netty.handler.codec.http2.Http2ConnectionHandler$PrefaceDecoder.decode(Http2ConnectionHandler.java:227)
\t at io.netty.handler.codec.http2.Http2ConnectionHandler.decode(Http2ConnectionHandler.java:413)
\t at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:489)
\t at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:428)
\t at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:265)
\t at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
\t at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
\t at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
\t at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334)
\t at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
\t at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
\t at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926)
\t at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:134)
\t at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:644)
\t at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:579)
\t at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:496)
\t at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:458)
\t at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
\t at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:138)
\t at java.lang.Thread.run(Thread.java:745)
SampleUser peerOrgAdmin = sampleStore.getMember("Org1MSP" + "Admin", "Org1MSP", sampleOrg.getMSPID(),
Util.findFileSk(Paths.get("/Users/zhoutuanjie/workspace-new-sz/", "crypto-config/peerOrganizations/",
"org1.example.com", format("https://stackoverflow.com/users/[email protected]%s/msp/keystore", "org1.example.com")).toFile()),
Paths.get("/Users/zhoutuanjie/workspace-new-sz/", "crypto-config/peerOrganizations/", "org1.example.com",
format("https://stackoverflow.com/users/[email protected]%s/msp/signcerts/[email protected]%s-cert.pem", "org1.example.com", "org1.example.com")).toFile());
sampleOrg.setPeerAdmin(peerOrgAdmin);
} catch (Exception e) {
e.printStackTrace();
}
HFClient client = HFClient.createNewInstance();
try{
client.setCryptoSuite(CryptoSuite.Factory.getCryptoSuite());
} catch (Exception e) {
e.printStackTrace();
}
final ChaincodeID chaincodeID;
chaincodeID = ChaincodeID.newBuilder().setName("qhChaincode004")
.setVersion("1")
.setPath("github.com/hyperledger/fabric/examples/chaincode/go/qhChaincode").build();
// final ChaincodeID chaincodeID;
// chaincodeID = ChaincodeID.newBuilder().setName("example_cc_go")
// .setVersion("1")
// .setPath("github.com/example_cc").build();
try {
ChannelConfiguration channelConfiguration = new ChannelConfiguration(new File("/Users/zhoutuanjie/workspace-new-sz/fabric-sdk-java/src/test/fixture/sdkintegration/e2e-2Orgs/channel/foo.tx"));
client.setUserContext(sampleOrg.getPeerAdmin());
// File cert = Paths.get("/Users/zhoutuanjie/workspace-new-sz/fabric-sdk-java/src/test/fixture/sdkintegration/e2e-2Orgs/channel/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/server.crt").toFile();
File cert = Paths.get("/Users/zhoutuanjie/workspace-new-sz/crypto-config/ordererOrganizations/example.com/orderers/orderer.example.com/tls/server.crt").toFile();
Properties ret = new Properties();
ret.setProperty("pemFile", cert.getAbsolutePath());
ret.setProperty("trustServerCertificate", "true"); //testing environment only NOT FOR PRODUCTION!
ret.setProperty("hostnameOverride", "orderer.example.com");
ret.setProperty("sslProvider", "openSSL");
ret.setProperty("negotiationType", "TLS");
Orderer newOrder = client.newOrderer("orderer.example.com", "grpc://10.60.248.45:7050", ret);
Channel newChannel = client.newChannel("foo");
newChannel.addOrderer(newOrder);
正確に何を求めているのかはわかりません。どんな例を実装しようとしていますか、何を変更しましたか? – MrHug
私のfabric-sdk-javaアプリケーションは、チャネルの作成時にTLSサポートを作成せずにオーダーにアクセスする間違いを報告しましたが、解決方法はわかりませんでした。ありがとうございます –
どのようにこれを解決しましたか? –