Skip to main content

Multi-Organization Fabric Network

This tutorial walks through deploying a Fabric network with multiple organizations — the most common enterprise scenario.

What You'll Build

A 3-organization network with:

  • Org1MSP — 2 peers, ordering service
  • Org2MSP — 1 peer
  • Org3MSP — 1 peer
  • A shared channel (supply-chain) with all 3 orgs
  • Chaincode deployed and approved by all orgs

Prerequisites

  • ChainLaunch running at http://localhost:8100
  • Docker running with at least 8 GB RAM available

Step 1: Create the Network with CLI

The fastest way to create a multi-org network:

chainlaunch testnet fabric \
--name supply-chain \
--org "Org1MSP,Org2MSP,Org3MSP" \
--peerOrgs "Org1MSP,Org2MSP,Org3MSP" \
--ordererOrgs "Org1MSP" \
--channels supply-chain \
--peerCounts "Org1MSP=2,Org2MSP=1,Org3MSP=1" \
--ordererCounts "Org1MSP=3"

This creates everything in one command: organizations, nodes, channel, and joins all peers to the channel.

Step 2: Create Step-by-Step via UI

If you prefer the UI, follow these steps:

2.1 Create Organizations

Go to Organizations and create each one:

  1. Click Add Organization
  2. Set MSP ID: Org1MSP, Description: Manufacturing
  3. Repeat for Org2MSP (Logistics) and Org3MSP (Retail)

2.2 Create Nodes

Go to Nodes > Bulk Create for each org:

OrganizationPeersOrderers
Org1MSP23
Org2MSP10
Org3MSP10

2.3 Create the Channel

Go to Networks > Create Network > Fabric:

  1. Name: supply-chain
  2. Add Peer Organizations: Org1MSP, Org2MSP, Org3MSP
  3. Select peers for each org
  4. Add Orderer Organization: Org1MSP
  5. Select all 3 orderers
  6. Consensus: etcdraft
  7. Click Create

2.4 Verify

Check that all peers have joined the channel:

curl http://localhost:8100/api/v1/networks | jq '.[].name'

Step 3: Deploy Shared Chaincode

All organizations must approve the chaincode before it's committed to the channel.

Via CLI

# Install on all peers
chainlaunch chaincode install --name mycc --version 1.0 --lang golang \
--path ./chaincode/mycc --peers peer0-org1,peer0-org2,peer0-org3

# Approve for each org
chainlaunch chaincode approve --name mycc --version 1.0 --sequence 1 \
--channel supply-chain --org Org1MSP

chainlaunch chaincode approve --name mycc --version 1.0 --sequence 1 \
--channel supply-chain --org Org2MSP

chainlaunch chaincode approve --name mycc --version 1.0 --sequence 1 \
--channel supply-chain --org Org3MSP

# Commit (needs majority approval)
chainlaunch chaincode commit --name mycc --version 1.0 --sequence 1 \
--channel supply-chain

Via API

See Deploy Chaincode for the full API flow.

Step 4: Test Cross-Org Transactions

Once chaincode is committed, any org can submit transactions and all peers will validate:

# Org1 invokes
curl -X POST http://localhost:8100/api/v1/networks/{networkId}/chaincode/invoke \
-H "Content-Type: application/json" \
-d '{
"chaincodeName": "mycc",
"channelName": "supply-chain",
"function": "CreateAsset",
"args": ["asset1", "Manufacturing plant A", "100"],
"organizationId": "Org1MSP"
}'

Endorsement Policies

By default, Fabric requires a majority of organizations to endorse a transaction. Common policies:

PolicyMeaningUse case
MAJORITY>50% of orgs must endorseDefault, good for most cases
AND('Org1MSP.peer', 'Org2MSP.peer')Specific orgs requiredWhen both parties must agree
OR('Org1MSP.peer', 'Org2MSP.peer')Any org can endorseLow-trust requirements
OutOf(2, 'Org1MSP.peer', 'Org2MSP.peer', 'Org3MSP.peer')N-of-M orgsFlexible quorum

Set the policy during chaincode approval.

Adding a New Organization Later

To add a 4th organization to an existing network:

  1. Create the organization
  2. Create peer nodes for the new org
  3. Update the channel to include the new org
  4. Have the new org's peers join the channel
  5. Install and approve chaincode for the new org

Next Steps