hyperledger-labs / fabric-operator

Hyperledger Fabric Kubernetes Operator
Apache License 2.0
67 stars 37 forks source link

Create a sample-network with the Ansible Blockchain Collection #36

Open jkneubuh opened 2 years ago

jkneubuh commented 2 years ago

The operator sample-network uses an odd mix of bash scripting and kustomization overlays to realize a Fabric network compatible with the fabric-samples chaincode and gateway applications. CRDs are applied to the k8s API controller, where they are reconciled in the operator to realize a blockchain network. The bash scripts provide a little bit of imperative control flow, using envsubst to perform some light string substitution into the CRDs before applying to k8s. Once the nodes are set up, the fabric CLI binaries are strung together to administer the subsequent network topology.

This is one way that fabric-operator can be used, but it is not the only (or preferred) way to spin up networks. Illustrate this feature by creating a new sample-network, equivalent to the fabric-samples / test-network-k8s / sample-network (bash), but this time using the Ansible Blockchain Collection as a fully declarative representation for the Fabric Network.

This includes the core Resource types managed by the operator (CAs, Peers, Orderers, Consoles), but also extends up into the higher-order constructs of Channel, Chaincode, Organization (MSP), etc. Fabric-operator makes the network node setup simple, but still leaves open some administrative complexity for actually constructing the blockchain and channel constructs. The ansible playbooks, despite some rough edges, provide for some nice automation at this layer and complement the operator well. Demonstrate this linkage with a sample network in the operator project.

A good starting point for this feature is emerging over at hyperledgendary/full-stack-asset-transfer-guide

Hey - I just want to write some chaincode on Fabric...

Not a bad start:

just kind 

just operator 

just sample-network
jkneubuh commented 2 years ago

cc: @denyeart @mbwhite