mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-18 16:05:10 +00:00
Also fix the version of prometheus and grafana being used to ensure the queries remain compatible as well as avoid issues whether they may not work if latest images already exist on machine but are not at a level that will work Signed-off-by: D <d_kelsey@uk.ibm.com> Co-authored-by: D <d_kelsey@uk.ibm.com>
35 lines
2.2 KiB
Markdown
35 lines
2.2 KiB
Markdown
# 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](https://hyperledger-fabric.readthedocs.io/en/latest/test_network.html). 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](https://hyperledger-fabric.readthedocs.io/en/latest/install.html) 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.
|
|
|
|
```bash
|
|
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.
|
|
|
|
```bash
|
|
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](./CHAINCODE_AS_A_SERVICE_TUTORIAL.md). It is expected that this will move to augment the tutorial in the [Hyperledger Fabric ReadTheDocs](https://hyperledger-fabric.readthedocs.io/en/release-2.4/cc_service.html)
|
|
|
|
## Prometheus and Grafana
|
|
|
|
To enable the collection of fabric networks into Prometheus and also have a default Grafana dashboard please see this [tutorial](prometheus-grafana/README.md).
|