fabric-samples/test-network
sapthasurendran 9df7e9f86d
Configtxlator script changes (#552)
Signed-off-by: sapthasurendran <saptha.surendran@ibm.com>
2021-12-09 11:37:38 +00:00
..
addOrg3 Update Compose Spec & VM Spec Version (#482) 2021-09-02 10:26:14 +01:00
configtx chore: minor simplification of configtx yaml (#459) 2021-07-12 17:42:23 +02:00
docker Extend test network to support prometheus/grafana performances framework (#542) 2021-11-24 16:04:42 +00:00
organizations Fix creating channel when ${PWD} contains space. (#402) 2021-01-20 16:32:38 +01:00
scripts Configtxlator script changes (#552) 2021-12-09 11:37:38 +00:00
system-genesis-block [FAB-17145] Add test network to Fabric Samples 2019-12-11 10:28:39 -05:00
.gitignore Allow install of a chaincode 2020-07-15 10:39:12 -04:00
network.sh test-network: Make the regexp of checking version more strict (#515) 2021-10-26 11:24:15 +01:00
README.md Add in a setEnvOrg script (#487) 2021-09-08 14:54:11 +00:00
setOrgEnv.sh Add in a setEnvOrg script (#487) 2021-09-08 14:54:11 +00:00

Running the test network

You can use the ./network.sh script to stand up a simple Fabric test network. The test network has two peer organizations with one peer each and a single node raft ordering service. You can also use the ./network.sh script to create channels and deploy chaincode. For more information, see Using the Fabric test network. The test network is being introduced in Fabric v2.0 as the long term replacement for the first-network sample.

Before you can deploy the test network, you need to follow the instructions to Install the Samples, Binaries and Docker Images in the Hyperledger Fabric documentation.

Using the Peer commands

The setOrgEnv.sh script can be used to setup the environment variables for the ogrganziations, this will will help to be able to use the peer commands directly.

First, ensure that the peer binaries are on your path, and the Fabric Config path is set Assuming that you're in the test-network directory.

 export PATH=$PATH:$(realpath ../bin)
 export FABRIC_CFG_PATH=$(realpath ../config)

You can then set up the environment variables for each organization. The ./setOrgEnv.sh command is designed to be run as follows.

export $(./setOrgEnv.sh Org2 | xargs)

You will now be able to run the peer commands in the context of Org2. If a different command prompt you can run the same command with Org1 instead. The setOrgEnv script outputs a series of <name>=<value> strings. These can then be fed into the export command for your current shell