0% found this document useful (0 votes)
23 views5 pages

Pract 3interact With A Block Chain Network

The document outlines the steps to setup and test a blockchain network using Hyperledger Fabric: 1) Clone the GitHub repository and generate, build, and start the Fabric network; 2) Compile the Java application using Maven and copy the JAR file to the network resources folder; 3) Create and initialize the channel using the JAR file; 4) Register and enroll users to interact with the network; 5) Stop the network when testing is complete.

Uploaded by

pooja Jadhav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views5 pages

Pract 3interact With A Block Chain Network

The document outlines the steps to setup and test a blockchain network using Hyperledger Fabric: 1) Clone the GitHub repository and generate, build, and start the Fabric network; 2) Compile the Java application using Maven and copy the JAR file to the network resources folder; 3) Create and initialize the channel using the JAR file; 4) Register and enroll users to interact with the network; 5) Stop the network when testing is complete.

Uploaded by

pooja Jadhav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Subodh Kamble Roll 20 MSc Computer Science Part 2

Practical 3 : Interact with a block chain network. Execute transactions and requests against a
blockchain network by creating an app to test the network and its rules.

Setup, Running and Testing a Fabric Application:


1. Setup the Blockchain Network (generate network):
$ git clone https://github.com/IBM/blockchain-application-using-fabric-java-
sdk

$ cd /network/

$ chmod +x build.sh stop.sh teardown.sh

$ ./build.sh generate
Subodh Kamble Roll 20 MSc Computer Science Part 2

$ ./network.sh up

$ ./network.sh up –l java
Subodh Kamble Roll 20 MSc Computer Science Part 2

$ docker-compose –f docker-compose.yaml up

OR

$ docker-compose up # this command will build everything needed

Keep this running open another terminal

2. compiling and setting java application using maven:


$ cd ../java/

$ mvn install
Subodh Kamble Roll 20 MSc Computer Science Part 2

$ cd target/

$ mv blockchain-java-sdk-0.0.1-SNAPSHOT-jar-with-dependencies.jar blockchain-client.jar

$ cp blockchain-client.jar ../../network_resources

3. Create and Initialize the channel:


$ cd ../../network_resources

$ java -cp blockchain-client.jar org.example.network.CreateChannel


Subodh Kamble Roll 20 MSc Computer Science Part 2

4. Register and enroll users:


$ java -cp blockchain-client.jar org.example.user.RegisterEnrollUser

5. Stop The network:

You might also like