Skip to content

Commit 0bca544

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 0bca544

File tree

2 files changed

+77
-9
lines changed

2 files changed

+77
-9
lines changed

sample-network/README.md

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,47 @@ 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 have `just` installed then a `just everything` will setup everything!
48+
For all the available recipies just run `just`
49+
```shell
50+
Available recipes:
51+
cluster # Starts and configures a local KIND cluster
52+
everything # Cluster and Fabric Network
53+
network # Installs and configures a sample Fabric Network
54+
unkind # Removes the local cluster
55+
```
2956

3057
### Kubernetes
3158

@@ -63,9 +90,7 @@ export TEST_NETWORK_INGRESS_DOMAIN=test-network.example.com
6390
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).
6491

6592

66-
67-
68-
## Sample Network
93+
## Starting the Sample Network
6994

7095
Install the Nginx controller and Fabric CRDs:
7196
```shell
@@ -82,8 +107,7 @@ Explore Kubernetes `Pods`, `Deployments`, `Services`, `Ingress`, etc.:
82107
kubectl -n test-network get all
83108
```
84109

85-
86-
## Chaincode
110+
## Deploying Chaincode
87111

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

sample-network/justfile

Lines changed: 44 additions & 0 deletions
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)