Skip to content

feat:Add config-driven Fabric-X namespaces - #828

Draft
MaryamArif7 wants to merge 3 commits into
hyperledger-labs:mainfrom
MaryamArif7:feat_819
Draft

MaryamArif7 wants to merge 3 commits into
hyperledger-labs:mainfrom
MaryamArif7:feat_819

Conversation

@MaryamArif7

@MaryamArif7 MaryamArif7 commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

fixes #819

This PR adds support for configuring Fabric-X namespaces through the Fablo configuration.

Changes

  1. Added support for defining namespaces in the config.
  2. Added validation for namespace configuration.
  3. Added namespace initialization during network setup.
  4. Supports multiple namespaces.

This makes it easier to set up Fabric-X namespaces without needing to configure them manually.

@MaryamArif7
MaryamArif7 marked this pull request as draft September 9, 2026 10:43
@MaryamArif7

MaryamArif7 commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Hi @umegbewe Id like to clarify a few things regarding this PR

  1. The issue requires that Fablo be able to create at least one namespace. Should we enforce this by making namespaces a required field in the config like the network simply cannot be generated without at least one namespace ?

  2. The current plan for namespace init is that it creates every namespace declared in the config, one after another. If a user has multiple namespaces defined, should we also support creating just one specifically where we create nampespace for one ( namespace init ) instead of only being able to create all of them at once?

  3. currenlty every fabric-x-only rule (one channel, no chaincodes, TLS required) is in validate/index.ts, not the schema. So I added namespaces as a plain optional field in the same shared schema, with the "at least one, for fabric-x" rule also enforced in validate/index.t.So here im going with "no separate Fabric-X schema" requirement mentioned in the issue,by just applying that rule only for fabric-x.......

4.Right now we are doing something like this below :Just like this ref Make File

"namespaces": [
  { "name": "mynamespace", "policy": "AND('Org1MSP.member','Org2MSP.member')" }
]

But the flaw with this approach is that

we type the ploicies by hand everytime we add them even tho fablo already knows every org's MSP name from orgs[]

what do you think if we should go with this ?

we can do somethig like this
{ "name": "mynamespace", "orgs": ["Org1", "Org2"] }

with this we can add a helper fun ,resolvePolicy which can input the orgs with namespace names and return this
{ "name": "mynamespace", "policy": "AND('Org1MSP.member','Org2MSP.member')" } it can be flow to the basefunctions

@MaryamArif7
MaryamArif7 marked this pull request as ready for review September 10, 2026 08:35
@MaryamArif7
MaryamArif7 marked this pull request as draft September 15, 2026 04:43
@umegbewe

Copy link
Copy Markdown
Contributor

@MaryamArif7

  1. Do not make namespaces globally required in the JSON schema, because classic Fabric configs should not need it. But yes, for provider == fabric-x validation should require at least one namespace, fablo init fabric-x should generate one by default

  2. namespace init should create all configured namespaces by default. I’d also support namespace init if it is not too much extra work, because once multiple namespaces exist, users will expect targeted creation

  3. Yes, provider-specific rules belong in validate/index.ts, not as global schema requirements. The schema should define the optional top-level namespaces shape. Fabric-X validation should enforce “at least one namespace,” uniqueness, and valid org references.

  4. Yes, use orgs, not hand-written policy as the normal interface. Something like

"namespaces": [
  { "name": "mynamespace", "orgs": ["Org1", "Org2"] }
]

advanced override can be

"namespaces": [
  { "name": "custom", "policy": "AND('Org1MSP.member')" }
]

I’d avoid allowing both orgs and policy in the same namespace for now

@MaryamArif7

Copy link
Copy Markdown
Contributor Author

implementation is completed ,only testing is left

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): Add config-driven Fabric-X namespaces

2 participants