Skip to content

Commit

Permalink
Add test newtork download instructions to create a channel tutorial
Browse files Browse the repository at this point in the history
Signed-off-by: pama-ibm <pama@ibm.com>
  • Loading branch information
pamandrejko authored and denyeart committed Jan 31, 2021
1 parent bebb75f commit 0583c22
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
21 changes: 17 additions & 4 deletions docs/source/create_channel/create_channel.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,24 @@ In the process of creating the channel, this tutorial will take you through the
- [Joining peers to the channel](#join-peers-to-the-channel)
- [Setting anchor peers](#set-anchor-peers)

## Setting up the configtxgen tool

Channels are created by building a channel creation transaction and submitting the transaction to the ordering service. The channel creation transaction specifies the initial configuration of the channel and is used by the ordering service to write the channel genesis block. While it is possible to build the channel creation transaction file manually, it is easier to use the [configtxgen](../commands/configtxgen.html) tool. The tool works by reading a `configtx.yaml` file that defines the configuration of your channel, and then writing the relevant information into the channel creation transaction. Before we discuss the `configtx.yaml` file in the next section, we can get started by downloading and setting up the `configtxgen` tool.
## Before you begin

**Important:** This tutorial uses the Fabric test network and is compatible with v2.2.x or lower of the
test network sample. After you have installed the [prerequisites](../getting_started.html),
**you must run the following command** to clone the required version of the
[hyperledger/fabric samples](https://github.com/hyperledger/fabric-samples) repository and checkout
the correct version tag. The command also installs the Hyperledger Fabric platform-specific
binaries and config files for the version into the `/bin` and `/config` directories of `fabric-samples`
so that you can run the test network.

```
curl -sSL https://bit.ly/2ysbOFE | bash -s -- 2.2.2 1.4.9
```

## Setting up the configtxgen tool

You can download the `configtxgen` binaries by following the steps to [install the samples, binaries and Docker images](../install.html). `configtxgen` will be downloaded to the `bin` folder of your local clone of the `fabric-samples` repository along with other Fabric tools.
Channels are created by building a channel creation transaction and submitting the transaction to the ordering service. The channel creation transaction specifies the initial configuration of the channel and is used by the ordering service to write the channel genesis block. While it is possible to build the channel creation transaction file manually, it is easier to use the [configtxgen](../commands/configtxgen.html) tool. The tool works by reading a `configtx.yaml` file that defines the configuration of your channel, and then writing the relevant information into the channel creation transaction. The `configtxgen` tool was installed when you ran the `curl` command in the previous step.

For the purposes of this tutorial, we will want to operate from the `test-network` directory inside `fabric-samples`. Navigate to that directory using the following command:
```
Expand Down Expand Up @@ -364,7 +377,7 @@ Blockchain info: {"height":3,"currentBlockHash":"eBpwWKTNUgnXGpaY2ojF4xeP3bWdjlP
We can confirm that the channel was created successfully by deploying a chaincode to the channel. We can use the `network.sh` script to deploy the Basic asset transfer chaincode to any test network channel. Deploy a chaincode to our new channel using the following command:
```
./network.sh deployCC --ccn basic -ccp ../asset-transfer-basic/chaincode-go/ -ccl go -c channel1 --cci InitLedger
./network.sh deployCC --ccn basic -ccp ../asset-transfer-basic/chaincode-go/ -ccl go -c channel1 --cci InitLedger
```
After you run the command, you should see the chaincode being deployed to the channel in your logs. The chaincode is invoked to add data to the channel ledger.
Expand Down
13 changes: 11 additions & 2 deletions docs/source/test_network.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,17 @@ current master branch, it is possible that you will encounter errors.
## Before you begin

Before you can run the test network, you need to clone the `fabric-samples`
repository and download the Fabric images. Make sure that you have installed
the [Prerequisites](prereqs.html) and [Installed the Samples, Binaries and Docker Images](install.html).
repository and download the Fabric images.

**Important:** This tutorial is compatible with the Fabric test network sample v2.2.x. After you have installed the [prerequisites](../getting_started.html),
**you must run the following command** to clone the required version of the
[hyperledger/fabric samples](https://github.com/hyperledger/fabric-samples) repository and checkout
the correct version tag. The command also installs the Hyperledger Fabric platform-specific
binaries and config files for the version into the `/bin` and `/config` directories of `fabric-samples`.

```
curl -sSL https://bit.ly/2ysbOFE | bash -s -- 2.2.2 1.4.9
```

## Bring up the test network

Expand Down

0 comments on commit 0583c22

Please sign in to comment.