Skip to content

edgeflare/hyperledger-fabric-v2-kubernetes-dev

Repository files navigation

Hyperledger Fabric v2 with Raft on Kubernetes

Demo on YouTube

Limitations

  • Requires Docker on Kubernetes node

Prerequisites

  • Kubernetes cluster with at least 4GB memory and 2 vCPUs
  • kubectl available on path and configured to use a cluster
  • Fabric binaries available on path

Architechture

  • Three peer orgs and two orderer orgs. Peer orgs too run an orderer each.
  • Each org components are deployed in org's own namespace
  • crypto materials generated by cryptogen
  • crypto materials and channel-artifacts are mounted as k8s Secret
  • Fabric CA stores data in Postgres (in this demo in sqlite)
  • Fabric peer uses couchdb as state db. CouchDB is deployed in a separate pod (in this demo same pod as peer itself)

hyperledger-fabric-network

Network

Start

./hlf.sh up

Have peers joined to channel. Ensure all components are up and running.

./hlf.sh joinChannel

Chaincode lifecycle

./hlf.sh ccInstall
./hlf.sh ccApprove
./hlf.sh ccCommit
./hlf.sh ccInvoke         # Creates greeting="Hello, World!"
./hlf.sh ccQuery          # Reads greeting value
./hlf.sh ccInvokeUpdate   # Updates greeting="Hello, Blockchain!"
./hlf.sh ccQuery          # Reads greeting value to check update succeeded

Explorer

Start explorer db

kubectl -n org1 apply -f explorer/explorerdb.yaml

Start explorer. Ensure explorerdb is up and running.

kubectl -n org1 apply -f explorer/explorer.yaml

Access explorer UI

kubectl -n org1 port-forward svc/explorer 8080:80

explorer should now be available at http://localhost:8080

Rest API

Start server

kubectl -n org1 apply -f api/api-k8s.yaml

port-forward API server once its in Running state

kubectl -n org1 port-forward svc/hlf-api 3000

Access API Swagger UI at http://localhost:3000/swagger

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published