Skip to content

Commit e415203

Browse files
committed
Suggested updates to the sample network readme
Therese are some suggested updates to make the overall 'flow' of the readme.md better. So it easier for Fred/Fiona to follow along. Also added a way of 'cheating' if you been through the tutorial before, then just a quick recap of the commands is useful Signed-off-by: mbw <[email protected]>
1 parent 220d4e8 commit e415203

File tree

2 files changed

+69
-9
lines changed

2 files changed

+69
-9
lines changed

sample-network/README.md

+25-9
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,39 @@ Feedback, comments, questions, etc. at Discord : [#fabric-kubernetes](https://di
1212

1313
![sample-network](../docs/images/fabric-operator-sample-network.png)
1414

15-
## Prerequisites:
15+
## Essential Setup
1616

17-
### General
17+
### Clone this repo
18+
19+
Remeber to clone this repo and change to the `sample-network` directory
20+
21+
```shell
22+
git clone https://github.com/hyperledger-labs/fabric-operator.git
23+
cd fabric-operator/sample-network
24+
```
25+
26+
### Required Tools
27+
28+
If you don't have these already, please install these first.
1829

1930
- [kubectl](https://kubernetes.io/docs/tasks/tools/)
2031
- [jq](https://stedolan.github.io/jq/)
2132
- [envsubst](https://www.gnu.org/software/gettext/manual/html_node/envsubst-Invocation.html) (`brew install gettext` on OSX)
22-
- [k9s](https://k9scli.io) (recommended)
23-
- Fabric binaries (peer, osnadmin, etc.) will be installed into the local `bin` folder. Add these to your PATH:
2433

34+
Note that the Fabric binaries (peer, osnadmin, etc.) will be installed for you into a local `bin` folder. These should be added to your PATH:
2535
```shell
2636
export PATH=$PWD:$PWD/bin:$PATH
2737
```
2838

39+
### Optional Tools
40+
41+
These are optional but strongly recommended; especially if you want to run a local cluster.
42+
43+
- [kind](https://kind.sigs.k8s.io/) if you want to create a cluster locally, see below for other options
44+
- [k9s](https://k9scli.io) (recommended, but not essential)
45+
- [just](https://github.com/casey/just#installation) to run all the comamnds here directly
46+
47+
If you've run this tutorial before, there is a `justfile` that can used as a helpful 'cheatsheet' of the commands. If you `just` installed then a `just ` will setup and create a channel for you.
2948

3049
### Kubernetes
3150

@@ -63,9 +82,7 @@ export TEST_NETWORK_INGRESS_DOMAIN=test-network.example.com
6382
For additional guidelines on configuring ingress and DNS, see [Considerations for Kubernetes Distributions](https://cloud.ibm.com/docs/blockchain-sw-252?topic=blockchain-sw-252-deploy-k8#console-deploy-k8-considerations).
6483

6584

66-
67-
68-
## Sample Network
85+
## Starting the Sample Network
6986

7087
Install the Nginx controller and Fabric CRDs:
7188
```shell
@@ -82,8 +99,7 @@ Explore Kubernetes `Pods`, `Deployments`, `Services`, `Ingress`, etc.:
8299
kubectl -n test-network get all
83100
```
84101

85-
86-
## Chaincode
102+
## Deploying Chaincode
87103

88104
In the examples below, the `peer` binary will be used to invoke smart contracts on the org1-peer1 ledger. Set the CLI context with:
89105
```shell

sample-network/justfile

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Apache-2.0
2+
3+
# Main justfile to run all the scripts
4+
#
5+
# To install 'just' see https://github.com/casey/just#installation
6+
7+
8+
# Ensure all properties are exported as shell env-vars
9+
set export
10+
11+
# set the current directory, and the location of the test dats
12+
CWDIR := justfile_directory()
13+
14+
_default:
15+
@just --list
16+
17+
# Starts and configures a local KIND cluster
18+
cluster:
19+
#!/bin/bash
20+
set -ex -o pipefail
21+
22+
# create and configure the cluster
23+
./network kind
24+
./network cluster init
25+
26+
# Installs and configures a sample Fabric Network
27+
network:
28+
#!/bin/bash
29+
set -ex -o pipefail
30+
31+
# create Fabric network
32+
./network up
33+
34+
kubectl -n test-network get all
35+
36+
# create Fabric channnel
37+
./network channel create
38+
39+
# Cluster and Fabric Network
40+
everything: cluster network
41+
42+
# Removes the local cluster
43+
unkind:
44+
./network unkind

0 commit comments

Comments
 (0)