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.

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.

Fabric 3.1TLSBFTNode.js chaincode

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.

Terminal output showing the main configuration, Docker, connection profile, chaincode script, and topology files generated in fablo-target.
Representative generated files. The exact organization-specific files follow the organizations in your config.

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.

Fabric 2.52 organizationsendorsement policiesprivate data

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.

Network topology showing Org1 and Org2 peers connected to my-channel1, with one Org1-only collection and one collection shared by both organizations.
The sample combines an organization-only collection with a second collection available to both peer organizations.

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.

Fabric 3.1CCaaSCouchDBFablo REST

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.

Terminal output listing running peers, CouchDB databases, Fablo REST services, and a chaincode-as-a-service container.
Representative service groups after startup. Docker Compose service names can vary with the generated network.

Add Blockchain Explorer to Fabric v2

Enable the optional Explorer UI when you need to inspect channels, blocks, and transactions in a Fabric v2 development network.

Fabric v2 onlyExplorerTLSRAFT

Configuration excerpt

{
  "global": {
    "fabricVersion": "2.5.12",
    "tls": true,
    "tools": { "explorer": true }
  }
}

Explorer is supported for Fabric v2 and not Fabric v3. fablo validate warns when the Fabric version is 2.5.13 or newer, or older than 1.4.0, because Hyperledger Explorer may not support those versions. You can also set tools.explorer on a single organization instead of setting it globally. When the global tools.explorer is true, Fablo ignores the setting on each organization. Run fablo up to generate the Explorer connection material and start its containers with the network.

Terminal output showing generated Blockchain Explorer configuration and connection profile files for a Fabric version 2 network.
Fablo generates Explorer configuration and connection-profile material from the same network declaration.

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.

Fabric 2.5 and 3.1network staterepeatable testing

Try it

fablo snapshot before-upgrade
fablo prune
fablo restore before-upgrade
fablo start

Take the snapshot while the network is running, because Fablo copies the state out of the running containers. The command fablo snapshot before-upgrade writes an archive named before-upgrade.fablo.tar.gz in the current directory, and it fails when that file already exists. Run fablo prune before you restore, because fablo restore stops with an error when a fablo-target directory is already there, and fablo down leaves that directory in place. A restored network is created but not started, so run fablo start at the end.

Terminal workflow running fablo snapshot, fablo prune, fablo restore, and fablo start against a named local snapshot.
A compact snapshot workflow for repeatable integration tests and local upgrade experiments.