Explore Fablo by example
Start with a small local network, then add collaboration, data privacy, external chaincode services, operational tools, and repeatable state. Every example below maps to a maintained sample or documented command.
- Your first network
- Private data across organizations
- CCaaS, CouchDB, and REST
- Blockchain Explorer for Fabric v2
- Snapshot and restore
Start with one local network
Scaffold a Fabric 3.1 network and a sample Node.js chaincode, inspect the generated Docker files, then start everything with one command.
Try it
mkdir fablo-first-network && cd fablo-first-network
fablo init node
fablo generate
fablo up
fablo init node creates fablo-config.json plus a sample chaincode. generate writes the network artifacts to fablo-target, and up starts the network, creates its channel, and deploys the chaincode.
Share a channel, keep selected data private
Model two peer organizations on one channel, set explicit endorsement policies, and give each chaincode the private collections it needs.
Configuration excerpt
chaincodes:
- name: or-policy-chaincode
version: 0.0.1
lang: node
channel: my-channel1
directory: ./chaincodes/chaincode-kv-node
endorsement: OR('Org1MSP.member', 'Org2MSP.member')
privateData:
- name: org1-collection
orgNames: [Org1]
Generate the network normally with fablo up. Fablo writes the collection configuration and uses the declared policy when the chaincode is deployed.
Run chaincode as a service
Use a container image for CCaaS, store world state in CouchDB, and expose Fabric operations through Fablo REST for each peer organization.
Configuration excerpt
orgs:
- organization: { name: Org1, domain: org1.example.com }
peer: { instances: 1, db: CouchDb }
tools: { fabloRest: true }
chaincodes:
- name: chaincode1
version: 0.0.1
lang: ccaas
channel: my-channel1
image: ghcr.io/fablo-io/fablo-sample-kv-node-chaincode:2.2.0
chaincodeStartCommand: npm run start:ccaas
The complete sample applies the peer and tool settings to both organizations and connects them through my-channel1.
Add Blockchain Explorer to Fabric v2
Enable the optional Explorer UI when you need to inspect channels, blocks, and transactions in a Fabric 2.5 development network.
Configuration excerpt
{
"global": {
"fabricVersion": "2.5.12",
"tls": true,
"tools": { "explorer": true }
}
}
Explorer is supported for Fabric v2 and not Fabric v3. Keep the Fabric version explicit, then run fablo up to generate its connection material and start its containers with the network.
Save state before the next experiment
Capture a complete local network state, including transactions and identities, then restore it after a test, upgrade, or destructive change.
Try it
fablo snapshot ./snapshots/before-upgrade
fablo down
fablo restore ./snapshots/before-upgrade
Use a snapshot path outside fablo-target if you plan to prune generated files before restoring the network.