From c144c5f0bc66964440cdcb03577e8d5bc5f04540 Mon Sep 17 00:00:00 2001 From: David VIEJO Date: Tue, 29 Oct 2024 22:29:29 +0100 Subject: [PATCH] update docs --- README.md | 8 +- .../docs/intro/getting-started-3-0.md | 912 ++++++++++++++++++ website-docs/docs/intro/getting-started.md | 273 ++++-- website-docs/sidebars.ts | 2 +- 4 files changed, 1120 insertions(+), 75 deletions(-) create mode 100644 website-docs/docs/intro/getting-started-3-0.md diff --git a/README.md b/README.md index 7983b357..db31ced5 100644 --- a/README.md +++ b/README.md @@ -222,10 +222,10 @@ EOF ```bash export PEER_IMAGE=hyperledger/fabric-peer -export PEER_VERSION=2.5.10 +export PEER_VERSION=3.0.0 export ORDERER_IMAGE=hyperledger/fabric-orderer -export ORDERER_VERSION=2.5.10 +export ORDERER_VERSION=3.0.0 export CA_IMAGE=hyperledger/fabric-ca export CA_VERSION=1.5.13 @@ -236,10 +236,10 @@ export CA_VERSION=1.5.13 ```bash export PEER_IMAGE=hyperledger/fabric-peer -export PEER_VERSION=2.5.10 +export PEER_VERSION=3.0.0 export ORDERER_IMAGE=hyperledger/fabric-orderer -export ORDERER_VERSION=2.5.10 +export ORDERER_VERSION=3.0.0 export CA_IMAGE=hyperledger/fabric-ca export CA_VERSION=1.5.13 diff --git a/website-docs/docs/intro/getting-started-3-0.md b/website-docs/docs/intro/getting-started-3-0.md new file mode 100644 index 00000000..04816776 --- /dev/null +++ b/website-docs/docs/intro/getting-started-3-0.md @@ -0,0 +1,912 @@ +--- +id: getting-started-3-0 +title: Getting started with Hyperledger Fabric 3.0 +--- + +# Hyperledger Fabric 3.0 + +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" < kind-config.yaml kind: Cluster apiVersion: kind.x-k8s.io/v1alpha4 nodes: - role: control-plane + image: kindest/node:v1.30.2 extraPortMappings: - containerPort: 30949 hostPort: 80 @@ -47,7 +118,7 @@ To install helm: [https://helm.sh/docs/intro/install/](https://helm.sh/docs/intr ```bash helm repo add kfs https://kfsoftware.github.io/hlf-helm-charts --force-update -helm install hlf-operator --version=1.8.0 kfs/hlf-operator +helm install hlf-operator --version=1.10.0 -- kfs/hlf-operator ``` @@ -75,6 +146,9 @@ Install Istio on the Kubernetes cluster: kubectl create namespace istio-system +export ISTIO_PATH=$(echo $PWD/istio-*/bin) +export PATH="$PATH:$ISTIO_PATH" + istioctl operator init kubectl apply -f - <