Skip to content

feat(fabric-x): Make the Fabric-X application organization configurable - #830

Open
HarK-github wants to merge 1 commit into
hyperledger-labs:mainfrom
HarK-github:feat/fabric-x-configurable-org-818
Open

HarK-github wants to merge 1 commit into
hyperledger-labs:mainfrom
HarK-github:feat/fabric-x-configurable-org-818

Conversation

@HarK-github

@HarK-github HarK-github commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Parameterizes the Fabric-X generator so the primary application org drives all output. Networks with custom organization names, domains, and MSP IDs now generate and boot successfully.

Changes

  • Generator: fabricXDockerWriter.ts extracts primaryOrg and primaryOrgSlug (name.toLowerCase()) into template context.
  • Templates: Replaced hardcoded Org1, org1.example.com, and Org1MSP with dynamic variables across 9 config, compose, and script files.
  • Tests: Incorporated custom org generator test (Bank, BankMSP, bank.fablo.com) into existing e2e/fabloCommands.test.ts.

Note: Channel parameterization is intentionally excluded to avoid merge conflicts with PR #824.

@HarK-github
HarK-github force-pushed the feat/fabric-x-configurable-org-818 branch 4 times, most recently from 1ff5f64 to 4a9d9a7 Compare September 14, 2026 12:09
Comment thread src/setup-docker/fabricXDockerWriter.ts
Comment thread src/commands/validate/index.ts Outdated
Comment on lines +604 to +609
if (channel.orgs.length !== 1) {
this.emit(validationErrorType.ERROR, {
category: validationCategories.CHANNEL,
message: `fabric-x requires exactly one organization in channel '${channel.name}', found ${channel.orgs.length}.`,
});
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is outside the scope of this PR

Comment thread src/commands/validate/index.ts Outdated
Comment on lines +623 to +630
orgs
.filter((o) => !isOrdererOrg(o) && !channelOrgNames.includes(o.organization.name))
.forEach((o) => {
this.emit(validationErrorType.WARN, {
category: validationCategories.ORGS,
message: `Organization '${o.organization.name}' is declared but not joined to any channel.`,
});
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

outside the scope of this PR

Comment on lines 591 to 597
if (channels.length !== 1) {
this.emit(validationErrorType.ERROR, {
category: validationCategories.CHANNEL,
message: `fabric-x requires exactly one channel found ${channels.length}.`,
message: `fabric-x requires exactly one channel, found ${channels.length}.`,
});
return;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid returning early from validation unless absolutely necessary.

The validator usually tries to collect all relevant errors. this block can emit the channel-count error and still avoid unsafe indexing without cutting off unrelated validation

@umegbewe

Copy link
Copy Markdown
Contributor

Looks good for a first draft, expecting some tests too atleast for example

name: "Bank"
mspName: "BankMSP"
domain: "bank.fablo.com"

The test should assert generated output includes:

localMspID: BankMSP
MSPDir: ./crypto/peerOrganizations/bank.fablo.com/msp
tlsca.bank.fablo.com-cert.pem
User1@bank.fablo.com
AND('BankMSP.member')

@HarK-github
HarK-github force-pushed the feat/fabric-x-configurable-org-818 branch from 4a9d9a7 to 63d15c1 Compare September 16, 2026 20:39
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.

2 participants