fabric-samples/test-network
Yuki Kondo 70cce456d4
fix docs: Chaincode-as-a-service tutorial (#663)
This PR fixes the followings to run the tutorial.
- Add an instruction to set PATH to call the `peer` command.
- Correct an option for `deployCCAAS` to debug Chaincode.

Signed-off-by: Yuki Kondo <yuki.kondo.ob@hitachi.com>
2022-03-09 08:49:34 +00:00
..
addOrg3 fix addOrg3 for test network 2022-03-03 17:14:49 -05:00
compose Support for using podman with the test-network (#596) 2022-02-08 06:41:56 -05:00
configtx chore: minor simplification of configtx yaml (#459) 2021-07-12 17:42:23 +02:00
organizations Update test-network to use org level ca-cert.pem (#609) 2022-02-02 09:03:20 +00:00
prometheus-grafana further grafana dashboard improvements (#614) 2022-02-02 15:30:09 +00:00
scripts Support for using podman with the test-network (#596) 2022-02-08 06:41:56 -05: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
CHAINCODE_AS_A_SERVICE_TUTORIAL.md fix docs: Chaincode-as-a-service tutorial (#663) 2022-03-09 08:49:34 +00:00
monitordocker.sh Adding examples of CCAAS and support into the test-network (#560) 2021-12-17 13:18:22 +00:00
network.sh fix addOrg3 for test network 2022-03-03 17:14:49 -05:00
README.md Podman experimental and not native MacOs (#636) 2022-02-08 15:39:39 +01:00
setOrgEnv.sh Update test-network to use org level ca-cert.pem (#609) 2022-02-02 09:03:20 +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)

(Note bash v4 is required for the scripts)

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

Chaincode-as-a-service

To learn more about how to use the improvements to the Chaincode-as-a-service please see this tutorial. It is expected that this will move to augment the tutorial in the Hyperledger Fabric ReadTheDocs

Podman

Note - podman support should be considered experimental. There are issues with volume mounting on MacOS that prevent this working. If wish to use podman a LinuxVM is suggested.

A copy of the install_fabric.sh script is in the test-network directory. This has been enhanced to support a podman argument; if used it will use the podman command to pull down images and tag them rather than docker. The images are the same, just pulled differently

The network.sh script has been enhanced so that it can use podman and podman-compose instead of docker. Ensure that CONTAINER_CLI is set as below when running network.sh script.

CONTAINER_CLI=podman ./network.sh up

As there is no Docker-Daemon when using podman, only the ./network.sh deployCCAAS command will work.