Skip to content

Commit

Permalink
Add CA capability to test-network-nano-bash
Browse files Browse the repository at this point in the history
This change adds:
- shell scripts to start CAs for each org
- optional flag (-c) to network.sh to start CAs
- generate crypto material in the same format as cryptogen using the CAs
- describe how to start the CAs using terminals

Signed-off-by: Chris Elder <celder@chriss-mbp.raleigh.ibm.com>
  • Loading branch information
Chris Elder authored and denyeart committed May 29, 2024
1 parent 92f028c commit 3c63eac
Show file tree
Hide file tree
Showing 13 changed files with 1,451 additions and 9 deletions.
1 change: 1 addition & 0 deletions test-network-nano-bash/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
channel-artifacts/
crypto-config/
data/
data_ca/
logs/
*.gz
chaincode-external/
15 changes: 15 additions & 0 deletions test-network-nano-bash/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ If you have trouble running bash scripts in your environment, you can just as ea

Note the syntax of running the scripts. The peer admin scripts set the admin environment variables and must be run with the `source` command in order that the exported environment variables can be utilized by any subsequent user commands.

## Running each component separately with CAs

These instructions are for running the CAs from terminal sessions. Open terminal windows for 3 CAs as seen in the following terminal setup. These instructions should be followd before opening the ordering and peer windows described above.

![CA Terminal setup](ca_terminal_setup.png)

- cd to the `test-network-nano-bash` directory in each terminal window
- Before running the `./generate_artifacts.sh -ca` in the first orderer terminal, run `./ordererca.sh`, `./org1ca.sh`, `./org2ca.sh` in the repsective terminals.
- In the first orderer terminal, run `./generate_artifacts.sh -ca` to generate crypto material using the CAs and application channel genesis block and configuration transactions (calls configtxgen). The artifacts will be created in the `crypto-config` and `channel-artifacts` directories. If you are running BFT consensus then run `./generate_artifacts.sh BFT -ca`. All artifacts generated with the CA will conform to the same directory structure as cryptogen.

## Starting the network with one command

Using the individual scripts above gives you more control of the process of starting a Fabric network and demonstrates how all the required components fit together, however the same network can also be started using a single script for convenience.
Expand All @@ -73,6 +83,11 @@ For BFT consensus type:
./network.sh start -o BFT
```

For Raft consensus type using CAs:
```shell
./network.sh start -ca
```

After the network has started, use separate terminals to run peer commands.
You will need to configure the peer environment for each new terminal.
For example to run against peer1, use:
Expand Down
Loading

0 comments on commit 3c63eac

Please sign in to comment.