Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kfsoftware/meetup-hlf-3-0

Instructions to run Hyperledger Fabric 3.0 on Kubernetes in 2024
https://github.com/kfsoftware/meetup-hlf-3-0

Last synced: about 2 months ago
JSON representation

Instructions to run Hyperledger Fabric 3.0 on Kubernetes in 2024

Awesome Lists containing this project

README

        

# Workshop to create your first HLF network

This workshop is divided in this steps:

1. [Create kubernetes cluster](#1-create-kubernetes-cluster)
2. [Install and configure Istio](#2-install-and-configure-istio)
3. [Install Hyperledger Fabric operator](#3-install-hyperledger-fabric-operator)
4. [Deploy a peer organization](#4-deploy-a-peer-organization)
5. [Deploy an orderer organization](#5-deploy-an-orderer-organization)
6. [Create a channel](#6-create-a-channel)
7. [Join peer to the channel](#7-join-peer-to-the-channel)
8. [Install a chaincode](#8-install-a-chaincode)
9. [Deploy chaincode container on cluster](#9-deploy-chaincode-container-on-cluster)
10. [Approve chaincode](#10-approve-chaincode)
11. [Commit chaincode](#11-commit-chaincode)
12. [Invoke a transaction on the channel](#12-invoke-a-transaction-on-the-channel)
13. [Query assets in the channel](#13-query-assets-in-the-channel)
14. [Completion](#14-completion)

In order to follow the workshop, you have two options, follow the Loom video or follow the steps below.

Run through the steps explaining what we are going to do and how to do it.

## 1. Create kubernetes cluster

To start deploying our red fabric we have to have a Kubernetes cluster. For this we will use KinD.

Ensure you have these ports available before creating the cluster:

- 80
- 443

If these ports are not available this tutorial will not work.

### Using K3D

```bash
k3d cluster create -p "80:30949@agent:0" -p "443:30950@agent:0" --agents 2 k8s-hlf
```

### Using KinD

```bash
cat << EOF > kind-config.yaml
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
image: kindest/node:v1.27.3
extraPortMappings:
- containerPort: 30949
hostPort: 80
- containerPort: 30950
hostPort: 443
EOF

kind create cluster --config=./kind-config.yaml

```

## 2. Install and configure Istio

Install Istio binaries on the machine:

```bash
# add TARGET_ARCH=x86_64 if you are using arm64
curl -L https://istio.io/downloadIstio | ISTIO_VERSION=1.20.0 sh -
export PATH="$PATH:$PWD/istio-1.20.0/bin"
```

Install Istio on the Kubernetes cluster:

```bash

kubectl create namespace istio-system

istioctl operator init

kubectl apply -f - < org1.yaml
```

### Create metadata file

```bash
# remove the code.tar.gz chaincode.tgz if they exist
rm code.tar.gz chaincode.tgz
export CHAINCODE_NAME=asset
export CHAINCODE_LABEL=asset
cat << METADATA-EOF > "metadata.json"
{
"type": "ccaas",
"label": "${CHAINCODE_LABEL}"
}
METADATA-EOF
```

### Prepare connection file

```bash
## chaincode as a service
cat > "connection.json" <