Skip to content
This repository has been archived by the owner on Dec 22, 2021. It is now read-only.

How do I start this project using byfn network? #39

Open
lotty02cho opened this issue Sep 16, 2019 · 2 comments
Open

How do I start this project using byfn network? #39

lotty02cho opened this issue Sep 16, 2019 · 2 comments

Comments

@lotty02cho
Copy link

lotty02cho commented Sep 16, 2019

I try to run this project using byfn network( which version is 1.4.3) so I start ./byfn.sh -m up, and copy artifacts like crypto-config, channel-artifacts. and I run java -cp blockchain-client.jar org.example.network.DeployInstantiateChaincode(I skip createChannel, because It already make 'mychannel'.) but this error comes out.

log4j:WARN No appenders could be found for logger (org.hyperledger.fabric.sdk.helper.Config).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
org.hyperledger.fabric.sdk.exception.TransactionException: INTERNAL
	at org.hyperledger.fabric.sdk.OrdererClient.sendDeliver(OrdererClient.java:286)
	at org.hyperledger.fabric.sdk.Orderer.sendDeliver(Orderer.java:165)
	at org.hyperledger.fabric.sdk.Channel.getLatestBlock(Channel.java:1074)
	at org.hyperledger.fabric.sdk.Channel.getConfigurationBlock(Channel.java:898)
	at org.hyperledger.fabric.sdk.Channel.parseConfigBlock(Channel.java:826)
	at org.hyperledger.fabric.sdk.Channel.initialize(Channel.java:526)
	at org.example.network.DeployInstantiateChaincode.main(DeployInstantiateChaincode.java:82)
Caused by: io.grpc.StatusRuntimeException: INTERNAL
	at io.grpc.Status.asRuntimeException(Status.java:540)
	at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:392)
	at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:426)
	at io.grpc.internal.ClientCallImpl.access$100(ClientCallImpl.java:76)
	at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:512)
	at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$700(ClientCallImpl.java:429)
	at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:544)
	at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:52)
	at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:117)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: io.netty.handler.codec.http2.Http2Exception: First received frame was not SETTINGS. Hex dump for first 5 bytes: 1503010002
	at io.netty.handler.codec.http2.Http2Exception.connectionError(Http2Exception.java:85)
	at io.netty.handler.codec.http2.Http2ConnectionHandler$PrefaceDecoder.verifyFirstFrameIsSettings(Http2ConnectionHandler.java:309)
	at io.netty.handler.codec.http2.Http2ConnectionHandler$PrefaceDecoder.decode(Http2ConnectionHandler.java:217)
	at io.netty.handler.codec.http2.Http2ConnectionHandler.decode(Http2ConnectionHandler.java:401)
	at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:411)
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:248)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:341)
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:349)
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926)
	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:129)
	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:642)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:565)
	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:479)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:441)
	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
	at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
	... 1 more

does anyone say about how I start this project using byfn network?

@maheshwarishikha
Copy link
Contributor

@lotty02cho , when you are setting network using byfn - plz check if anything needs to be changed in config, before building maven project. It might help.

@lotty02cho
Copy link
Author

when I tested default nework based on README.md, it works well.
and I try to run this project when I run byfn network.
So, I enter fabric-samples/first-network and run byfn.sh -m up.
and then, I start to change crypto-config and config to match the resources.

cd /opt/gopath/src/github.com/hyperledger/fabric-samples/first-network
rm -rf ../../blockchain-application-using-fabric-java-sdk/network_resources/crypto-config/
cp -r crypto-config ../../blockchain-application-using-fabric-java-sdk/network_resources/
ll ../../blockchain-application-using-fabric-java-sdk/network_resources/

rm -rf ../../blockchain-application-using-fabric-java-sdk/network_resources/config/
cp -r channel-artifacts ../../blockchain-application-using-fabric-java-sdk/network_resources/config
ll ../../blockchain-application-using-fabric-java-sdk/network_resources/

and now I wanna make maven install.

/opt/gopath/src/github.com/hyperledger/blockchain-application-using-fabric-java-sdk/java$ mvn install
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building blockchain-java-sdk 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ blockchain-java-sdk ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /opt/gopath/src/github.com/hyperledger/blockchain-application-using-fabric-java-sdk/java/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ blockchain-java-sdk ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ blockchain-java-sdk ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /opt/gopath/src/github.com/hyperledger/blockchain-application-using-fabric-java-sdk/java/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.7.0:testCompile (default-testCompile) @ blockchain-java-sdk ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.17:test (default-test) @ blockchain-java-sdk ---
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ blockchain-java-sdk ---
[INFO] 
[INFO] --- maven-assembly-plugin:2.4.1:single (default) @ blockchain-java-sdk ---
[INFO] Building jar: /opt/gopath/src/github.com/hyperledger/blockchain-application-using-fabric-java-sdk/java/target/blockchain-java-sdk-0.0.1-SNAPSHOT-jar-with-dependencies.jar
[INFO] 
[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ blockchain-java-sdk ---
[INFO] Installing /opt/gopath/src/github.com/hyperledger/blockchain-application-using-fabric-java-sdk/java/target/blockchain-java-sdk-0.0.1-SNAPSHOT.jar to /home/hyper/.m2/repository/blockchain-java-sdk/blockchain-java-sdk/0.0.1-SNAPSHOT/blockchain-java-sdk-0.0.1-SNAPSHOT.jar
[INFO] Installing /opt/gopath/src/github.com/hyperledger/blockchain-application-using-fabric-java-sdk/java/pom.xml to /home/hyper/.m2/repository/blockchain-java-sdk/blockchain-java-sdk/0.0.1-SNAPSHOT/blockchain-java-sdk-0.0.1-SNAPSHOT.pom
[INFO] Installing /opt/gopath/src/github.com/hyperledger/blockchain-application-using-fabric-java-sdk/java/target/blockchain-java-sdk-0.0.1-SNAPSHOT-jar-with-dependencies.jar to /home/hyper/.m2/repository/blockchain-java-sdk/blockchain-java-sdk/0.0.1-SNAPSHOT/blockchain-java-sdk-0.0.1-SNAPSHOT-jar-with-dependencies.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16.507 s
[INFO] Finished at: 2019-11-18T17:31:42+09:00
[INFO] Final Memory: 31M/383M
[INFO] ------------------------------------------------------------------------

and finally I start to instantiate chaincode by using org.example.network.DeployInstantiateChaincode.
but it doesn't work for me.

Error: Could not find or load base class org.example.network.DeployInstantiateChaincode.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants