Skip to content

Commit

Permalink
Suggested updates to the sample network readme
Browse files Browse the repository at this point in the history
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 <matthew@mh-white.com>
  • Loading branch information
mbwhite committed Jul 8, 2022
1 parent 220d4e8 commit e415203
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 9 deletions.
34 changes: 25 additions & 9 deletions sample-network/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,39 @@ Feedback, comments, questions, etc. at Discord : [#fabric-kubernetes](https://di

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

## Prerequisites:
## Essential Setup

### General
### Clone this repo

Remeber to clone this repo and change to the `sample-network` directory

```shell
git clone https://github.com/hyperledger-labs/fabric-operator.git
cd fabric-operator/sample-network
```

### Required Tools

If you don't have these already, please install these first.

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

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:
```shell
export PATH=$PWD:$PWD/bin:$PATH
```

### Optional Tools

These are optional but strongly recommended; especially if you want to run a local cluster.

- [kind](https://kind.sigs.k8s.io/) if you want to create a cluster locally, see below for other options
- [k9s](https://k9scli.io) (recommended, but not essential)
- [just](https://github.com/casey/just#installation) to run all the comamnds here directly

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.

### Kubernetes

Expand Down Expand Up @@ -63,9 +82,7 @@ export TEST_NETWORK_INGRESS_DOMAIN=test-network.example.com
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).




## Sample Network
## Starting the Sample Network

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


## Chaincode
## Deploying Chaincode

In the examples below, the `peer` binary will be used to invoke smart contracts on the org1-peer1 ledger. Set the CLI context with:
```shell
Expand Down
44 changes: 44 additions & 0 deletions sample-network/justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Apache-2.0

# Main justfile to run all the scripts
#
# To install 'just' see https://github.com/casey/just#installation


# Ensure all properties are exported as shell env-vars
set export

# set the current directory, and the location of the test dats
CWDIR := justfile_directory()

_default:
@just --list

# Starts and configures a local KIND cluster
cluster:
#!/bin/bash
set -ex -o pipefail

# create and configure the cluster
./network kind
./network cluster init

# Installs and configures a sample Fabric Network
network:
#!/bin/bash
set -ex -o pipefail

# create Fabric network
./network up

kubectl -n test-network get all

# create Fabric channnel
./network channel create

# Cluster and Fabric Network
everything: cluster network

# Removes the local cluster
unkind:
./network unkind

0 comments on commit e415203

Please sign in to comment.