Skip to main content

Deployment Guide

This guide describes the end-to-end deployment flow for an on-prem Fabric environment:

  1. prepare target-specific configuration
  2. bootstrap the orderer target (org0)
  3. bootstrap each participant target (org1, org2, ...)
  4. create a channel from org0
  5. join participant peers to that channel
  6. deploy and verify chaincode

In the examples below, org0 is the orderer organization and org1 is the first participant organization.

Deployment Flow​

Prerequisites​

The operator machine must have:

  • ssh
  • scp
  • kubectl

Each target node must provide:

  • passwordless sudo for the SSH user

Prepare Target Configuration​

Clone the deployment bundle, then create the target-local environment files before provisioning any cluster:

git clone https://gitlab.astricsa.cf/PRP106-24CI/deployment-hlf.git
cd deployment-hlf
cp targets/org0/env.example targets/org0/env
cp targets/org0/config/onprem.env.example targets/org0/config/onprem.env
cp targets/org1/env.example targets/org1/env
cp targets/org1/config/onprem.env.example targets/org1/config/onprem.env

Repeat the same pattern for every additional target you plan to deploy.

Bootstrap the Orderer Target​

Run the full target bootstrap for org0 first:

./network onprem org0 init
./network onprem org0 cluster
./network onprem org0 addons
./network onprem org0 hosts /tmp/org0-hosts
sudo tee -a /etc/hosts < /tmp/org0-hosts
./network org0 up

Verify the result:

kubectl --kubeconfig targets/org0/kubeconfig get nodes
kubectl --kubeconfig targets/org0/kubeconfig -n ingress-nginx get pods
kubectl --kubeconfig targets/org0/kubeconfig -n cert-manager get pods
kubectl --kubeconfig targets/org0/kubeconfig -n test-network get deploy

Expected state:

  • all expected nodes show Ready
  • ingress controller pods are Running
  • cert-manager pods are Running
  • org0-ca, org0-orderer1, org0-orderer2, and org0-orderer3 exist
  • org0-orderer4 also exists when using BFT consensus

Bootstrap Participant Targets​

After org0 is ready, apply the same target-scoped bootstrap to each participant organization. Example for org1:

./network onprem org1 init
./network onprem org1 cluster
./network onprem org1 addons
./network onprem org1 hosts /tmp/org1-hosts
sudo tee -a /etc/hosts < /tmp/org1-hosts
./network org1 up

Verify the result:

kubectl --kubeconfig targets/org1/kubeconfig get nodes
kubectl --kubeconfig targets/org1/kubeconfig -n ingress-nginx get pods
kubectl --kubeconfig targets/org1/kubeconfig -n cert-manager get pods
kubectl --kubeconfig targets/org1/kubeconfig -n test-network get deploy

Expected state:

  • all expected nodes show Ready
  • ingress controller pods are Running
  • cert-manager pods are Running
  • org1-ca, org1-peer1, and org1-peer2 exist

For additional participant targets and target-local configuration details, see participant onboarding.

Create a Channel​

Create the channel from org0, listing the participant organizations that should receive the channel artifacts:

./network org0 channel create mychannel --members org1

Verify the generated artifacts:

ls targets/org0/exports/channels/mychannel
ls targets/org1/imports/channels/mychannel

Expected state:

  • genesis_block.pb exists under both directories
  • channel-msp/ordererOrganizations/org0 exists in both the exported and imported channel artifacts

Join a Participant to the Channel​

Join the participant peer to the new channel:

./network org1 channel join mychannel

Verify from the peer:

kubectl --kubeconfig targets/org1/kubeconfig -n test-network exec deploy/org1-peer1 -- peer channel list
kubectl --kubeconfig targets/org1/kubeconfig -n test-network exec deploy/org1-peer1 -- peer channel getinfo -c mychannel

Expected state:

  • peer channel list includes mychannel
  • peer channel getinfo -c mychannel returns blockchain metadata such as the current height
  • neither command fails with join, TLS, or orderer connectivity errors

Deploy Chaincode​

Deploy the chaincode from a participant organization:

./network org1 chaincode deploy carboncc /path/to/api-golang-dmrv-fabric-chaincode

Verify the deployment:

./network org1 chaincode query carboncc '{"Args":["HealthCheck"]}'

Expected state:

  • the command returns ok

For the chaincode update procedure, see Chaincode Update.