Skip to content

feat: Making the Fabric-X channel configurable - #824

Open
MaryamArif7 wants to merge 6 commits into
hyperledger-labs:mainfrom
MaryamArif7:feat817
Open

MaryamArif7 wants to merge 6 commits into
hyperledger-labs:mainfrom
MaryamArif7:feat817

Conversation

@MaryamArif7

@MaryamArif7 MaryamArif7 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

fixes #817

What it does

Fabric-X generation was hardcoding the channel name (mychannel) instead of reading it from fablo-config.json. This makes the channel name configurable.

Changes

  1. src/setup-docker/templates/fabric-x/scripts/base-functions.shconfigtxgen --channelID now uses <%= channels[0].name %> instead of the hardcoded mychannel.
  2. src/setup-docker/templates/fabric-x/fxconfig.yamlchannel: field now uses <%= channels[0].name %> instead of the hardcoded mychannel.

@MaryamArif7
MaryamArif7 marked this pull request as draft September 7, 2026 08:11
@MaryamArif7

MaryamArif7 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Research: where the channel name (mychannel) appears

  1. Hardcoded in source templates (src/setup-docker/templates/fabric-x*):

fxconfig.yaml:10 channel: mychannel
scripts/base-functions.sh:61 configtxgen --channelID mychannel

2.In the generated target for the fabric-x:

  1. In the fablo/fablo-target/fabric-x/fxconfig.yaml file
Image

2.fabric-x/crypto/config-block.pb.bin
3.fabric-x/data/orderers/party1-consenter/chains/consensus/blockfile_000000
4.fabric-x/data/orderers/party1-router/config.pb.bin/block-0.config.pb.bin
5.fabric-x/data/orderers/party1-batcher/config.pb.bin/block-0.config.pb.bin
6.fabric-x/data/orderers/party1-batcher/wal/0000000000000001.wal
7.fabric-x/data/committer-org1/sidecar-ledger/chains/fabric-x-committer/blockfile_000000

@MaryamArif7 MaryamArif7 changed the title fix: Making the Fabric-X channel configurable feat: Making the Fabric-X channel configurable Sep 7, 2026
@MaryamArif7

MaryamArif7 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Few notes :
"channelID <%= channels[0].name %> --profile <%= channels[0].profileName %> "
->for the profileName i have followed the same pattern of fabric-classic
->channels[0] ->will get 1st channel only ,because fabric-x is validated elsewhere to allow exactly one channel

Verification

1) Default channel , mychannel

  • Rebuilt the local image
  • Pruned the existing network
  • Regenerated the default config using ./fablo.sh init fabric-x
  • Confirmed the default channel name is set correctly
image
  • Confirmed the generated files pick up the default channel
  • Ran up and all namespace commands successfully

2) Custom channel name mychanneltest

  • Changed the channel name in the default init config, then also confirmed it can be changed directly in fablo-config.json after generation
  • Rebuilt the local image
  • Confirmed the new channel name is reflected in the generated files (examples below)
image image
  • Ran up and namespace commands ,everything works

@MaryamArif7
MaryamArif7 marked this pull request as ready for review September 8, 2026 02:53
Comment thread src/setup-docker/templates/fabric-x/fxconfig.yaml Outdated
Comment thread src/setup-docker/templates/fabric-x/scripts/base-functions.sh Outdated
@umegbewe

Copy link
Copy Markdown
Contributor

Looks okay, but i'd expect this PR to be modified into something like this in FabricXDockerWriter:

interface FabricXTemplateModel {
  channelName: string;
  channelProfileName: string;
}

and then render templates from:

<%- fabricX.channelName %>
<%- fabricX.channelProfileName %>

not from channels[0] and some tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat (fabric-x): Make the Fabric-X channel configurable

2 participants