Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ fablo init fabric-x [--set <path>=<value> ...]
```

Creates a minimal config for the experimental Fabric-X provider, with `global.provider` set to `fabric-x`.
Use `--set fabricX.orderer.partyCount=4` for the four party BFT orderer.
You cannot combine `fabric-x` with `node`, `rest`, `dev`, `ccaas` or `gateway`.

#### Custom overrides
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ The `fabric-x` option works differently, because you get a whole different start
fablo init fabric-x
```

Fablo writes a minimal config for the experimental Fabric-X provider, with `global.provider` set to `fabric-x`, a single organization (`Org1`) that has one BFT orderer and no peers, and a channel named `mychannel`. You cannot combine `fabric-x` with `node`, `dev`, `ccaas`, `gateway` or `rest`.
Fablo writes a minimal config for the experimental Fabric-X provider, with `global.provider` set to `fabric-x`, a single organization (`Org1`), a channel named `mychannel` that all organizations join, and a namespace named `mynamespace`. The config holds only what you need to change, and Fablo derives the rest. The orderer is a single party by default, and `--set fabricX.orderer.partyCount=4` selects the four party BFT profile. You cannot combine `fabric-x` with `node`, `dev`, `ccaas`, `gateway` or `rest`.

You can also override generated fields with `--set`:

Expand Down
28 changes: 28 additions & 0 deletions docs/reference/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,34 @@ When `provider` is `fabric-x`, `fablo validate` reports an error for any of the
- Explorer or Fablo REST is enabled, in `global.tools` or in any `orgs[].tools`
- `chaincodes` is not empty, because the Fabric-X provider does not deploy chaincodes yet
- `channels` does not hold exactly one channel
- `fabricX.orderer.partyCount` is not `1` or `4`

#### Compact Fabric-X config

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.

“Compact” only makes sense relative to the old unreleased format

Just update the documentation with the new schema instead of this new section, not sure why users need to understand the simplification history when fabric-x on fablo hasn't released yet


A Fabric-X config can be much smaller than a classic one, because Fablo fills in what it can derive. These settings are optional when `provider` is `fabric-x`:

- `global.fabricVersion` (default `3.1.0`), `global.tls` (default `true`), `global.peerDevMode` (default `false`) and `global.engine` (default `docker`)
- `orgs[].organization.mspName` (default `<name>MSP`) and `orgs[].ca`
- `channels[].orgs`. When omitted, all top-level organizations join the channel. When given, an entry needs only `name`, and `peers` is not needed.
- `chaincodes` and `hooks`
- `namespaces[].orgs`. When omitted, all organizations on the channel govern the namespace.
- `fabricX.orderer.partyCount` (default `1`). Use `4` for the local BFT profile. Fablo derives the organizations of the orderer parties.

```json
{
"$schema": "https://github.com/hyperledger-labs/fablo/releases/download/2.6.0/schema.json",
"global": { "provider": "fabric-x" },
"orgs": [
{ "organization": { "name": "Org1", "domain": "org1.example.com" } },
{ "organization": { "name": "Org2", "domain": "org2.example.com" } }
],
"channels": [{ "name": "mychannel" }],
"namespaces": [{ "name": "mynamespace" }, { "name": "audit_ns", "orgs": ["Org1"] }],
"fabricX": { "orderer": { "partyCount": 4 } }
}
```

For the `fabric` provider, `global.fabricVersion`, `global.tls`, `chaincodes`, `channels[].orgs` and the `peers` of each channel organization are still required, and `fablo validate` reports them when they are missing.

### `global.fabricImages`

Expand Down
79 changes: 10 additions & 69 deletions docs/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
"required": [
"global",
"orgs",
"channels",
"chaincodes"
"channels"
],
"properties": {
"$schema": {
Expand All @@ -19,10 +18,7 @@
"title": "Global network settings",
"description": "Basic settings of the Hyperledger Fabric network",
"type": "object",
"required": [
"fabricVersion",
"tls"
],
"required": [],

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.

jsyk this makes these fields optional for classic Fabric too

I tested the schema after removing global.fabricVersion, global.tls, chaincodes and channels[0].orgs from a classic config, and it returned zero schema errors

The issue asks for provider-specific rules, so please keep the shared schema but use draft-07 if/then/else rules, compact requirements for provider: "fabric-x" and the existing requirements for classic Fabric.

cli only checks are not enough because editors and other tools consume schema.json directly

"properties": {
"fabricVersion": {
"$id": "#/properties/global/properties/fabricVersion",
Expand Down Expand Up @@ -415,8 +411,7 @@
"title": "Channel",
"type": "object",
"required": [
"name",
"orgs"
"name"
],
"properties": {
"name": {
Expand All @@ -440,8 +435,7 @@
"title": "Organization",
"type": "object",
"required": [
"name",
"peers"
"name"
],
"properties": {
"name": {
Expand Down Expand Up @@ -692,71 +686,18 @@
"type": "object",
"title": "Fabric-X settings (EXPERIMENTAL)",
"description": "Settings of the 'fabric-x' provider. Ignored for the 'fabric' provider.",
"required": [
"orderer"
],
"properties": {
"orderer": {
"$id": "#/properties/fabricX/properties/orderer",
"type": "object",
"title": "Orderer",
"required": [
"parties"
],
"properties": {
"parties": {
"$id": "#/properties/fabricX/properties/orderer/properties/parties",
"type": "array",
"title": "Orderer parties",
"description": "A party is an organization of the orderer with its own router, batcher, consenter and assembler. Fablo currently supports 1 party (the quick default) or 4 parties (a local profile for BFT testing).",
"default": [
{
"organization": {
"name": "Orderer",
"domain": "orderer.example.com",
"mspName": "OrdererOrdererMSP"
}
}
],
"items": {
"$id": "#/properties/fabricX/properties/orderer/properties/parties/items",
"title": "Orderer party",
"type": "object",
"required": [
"organization"
],
"properties": {
"organization": {
"$id": "#/properties/fabricX/properties/orderer/properties/parties/items/properties/organization",
"title": "Organization of the party",
"type": "object",
"required": [
"name",
"domain"
],
"properties": {
"name": {
"$id": "#/properties/fabricX/properties/orderer/properties/parties/items/properties/organization/properties/name",
"title": "Name",
"type": "string",
"pattern": "^[a-zA-Z0-9]+$"
},
"mspName": {
"$id": "#/properties/fabricX/properties/orderer/properties/parties/items/properties/organization/properties/mspName",
"title": "MSP Name",
"type": "string",
"pattern": "^[a-zA-Z0-9]+$"
},
"domain": {
"$id": "#/properties/fabricX/properties/orderer/properties/parties/items/properties/organization/properties/domain",
"title": "Domain",
"type": "string",
"pattern": "^[a-z0-9\\.\\-]+$"
}
}
}
}
}
"partyCount": {
"$id": "#/properties/fabricX/properties/orderer/properties/partyCount",
"type": "integer",
"title": "Number of orderer parties",
"description": "A party is an organization of the orderer with its own router, batcher, consenter and assembler. Fablo derives the organizations of the parties. Fablo currently supports 1 party (the quick default) or 4 parties (a local profile for BFT testing).",
"default": 1
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion e2e-network/docker/test-08-fabric-x.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ fxconfig_value() {

FX_ORG_DOMAIN="$(jq -r '.orgs[0].organization.domain' "$CONFIG")"
FX_NAMESPACE="$(jq -r '.namespaces[] | select(.orgs == ["Org1"]) | .name' "$CONFIG" | head -n 1)"
FX_MSP_NAME="$(jq -r '.orgs[0].organization.mspName' "$CONFIG")"
FX_MSP_NAME="$(jq -r '.orgs[0].organization | .mspName // (.name + "MSP")' "$CONFIG")"
FX_CHANNEL="$(jq -r '.channels[0].name' "$CONFIG")"
FX_ORDERER="$(fxconfig_value orderer address)"
FX_SIDECAR="$(fxconfig_value notifications address)"
Expand Down
4 changes: 2 additions & 2 deletions e2e-network/docker/test-09-fabric-x-bft.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ expectCommand() {

networkUp() {
run_fablo init fabric-x
# four orderer parties, each with its own organization
jq '.fabricX.orderer.parties = [range(1;5) | {organization: {name: "OrdererOrg\(.)", domain: "orderer-org-\(.)", mspName: "OrdererOrg\(.)MSP"}}]' \
# four orderer parties
jq '.fabricX.orderer.partyCount = 4' \
"$TEST_TMP/fablo-config.json" >"$TEST_TMP/fablo-config.json.tmp"
mv "$TEST_TMP/fablo-config.json.tmp" "$TEST_TMP/fablo-config.json"
run_fablo validate
Expand Down
57 changes: 6 additions & 51 deletions e2e/__snapshots__/fablo-config-fabric-x-2orgs.json.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,81 +4,36 @@ exports[`samples/fablo-config-fabric-x-2orgs.json should create proper e2e/__tmp
"{
"$schema": "https://github.com/hyperledger-labs/fablo/releases/download/2.6.0/schema.json",
"global": {
"fabricVersion": "3.1.0",
"tls": true,
"engine": "docker",
"peerDevMode": false,
"provider": "fabric-x"
},
"orgs": [
{
"organization": {
"name": "Org1",
"domain": "org1.example.com",
"mspName": "Org1MSP"
},
"ca": {
"prefix": "ca",
"db": "sqlite"
"domain": "org1.example.com"
}
},
{
"organization": {
"name": "Org2",
"domain": "org2.example.com",
"mspName": "Org2MSP"
},
"ca": {
"prefix": "ca",
"db": "sqlite"
"domain": "org2.example.com"
}
}
],
"channels": [
{
"name": "mychannel",
"orgs": [
{
"name": "Org1",
"peers": []
},
{
"name": "Org2",
"peers": []
}
]
"name": "mychannel"
}
],
"namespaces": [
{
"name": "mynamespace",
"orgs": [
"Org1",
"Org2"
]
"name": "mynamespace"
},
{
"name": "audit_ns",
"orgs": [
"Org1"
]
"orgs": ["Org1"]
}
],
"fabricX": {
"orderer": {
"parties": [
{
"organization": {
"name": "Orderer",
"domain": "orderer.example.com",
"mspName": "OrdererOrdererMSP"
}
}
]
}
},
"chaincodes": [],
"hooks": {}
]
}
"
`;
Expand Down
73 changes: 7 additions & 66 deletions e2e/__snapshots__/schema.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ exports[`schema should match snapshot 1`] = `
},
"required": [
"name",
"peers",
],
"title": "Organization",
"type": "object",
Expand All @@ -265,7 +264,6 @@ exports[`schema should match snapshot 1`] = `
},
"required": [
"name",
"orgs",
],
"title": "Channel",
"type": "object",
Expand All @@ -280,71 +278,18 @@ exports[`schema should match snapshot 1`] = `
"orderer": {
"$id": "#/properties/fabricX/properties/orderer",
"properties": {
"parties": {
"$id": "#/properties/fabricX/properties/orderer/properties/parties",
"default": [
{
"organization": {
"domain": "orderer.example.com",
"mspName": "OrdererOrdererMSP",
"name": "Orderer",
},
},
],
"description": "A party is an organization of the orderer with its own router, batcher, consenter and assembler. Fablo currently supports 1 party (the quick default) or 4 parties (a local profile for BFT testing).",
"items": {
"$id": "#/properties/fabricX/properties/orderer/properties/parties/items",
"properties": {
"organization": {
"$id": "#/properties/fabricX/properties/orderer/properties/parties/items/properties/organization",
"properties": {
"domain": {
"$id": "#/properties/fabricX/properties/orderer/properties/parties/items/properties/organization/properties/domain",
"pattern": "^[a-z0-9\\.\\-]+$",
"title": "Domain",
"type": "string",
},
"mspName": {
"$id": "#/properties/fabricX/properties/orderer/properties/parties/items/properties/organization/properties/mspName",
"pattern": "^[a-zA-Z0-9]+$",
"title": "MSP Name",
"type": "string",
},
"name": {
"$id": "#/properties/fabricX/properties/orderer/properties/parties/items/properties/organization/properties/name",
"pattern": "^[a-zA-Z0-9]+$",
"title": "Name",
"type": "string",
},
},
"required": [
"name",
"domain",
],
"title": "Organization of the party",
"type": "object",
},
},
"required": [
"organization",
],
"title": "Orderer party",
"type": "object",
},
"title": "Orderer parties",
"type": "array",
"partyCount": {
"$id": "#/properties/fabricX/properties/orderer/properties/partyCount",
"default": 1,
"description": "A party is an organization of the orderer with its own router, batcher, consenter and assembler. Fablo derives the organizations of the parties. Fablo currently supports 1 party (the quick default) or 4 parties (a local profile for BFT testing).",
"title": "Number of orderer parties",
"type": "integer",
},
},
"required": [
"parties",
],
"title": "Orderer",
"type": "object",
},
},
"required": [
"orderer",
],
"title": "Fabric-X settings (EXPERIMENTAL)",
"type": "object",
},
Expand Down Expand Up @@ -496,10 +441,7 @@ exports[`schema should match snapshot 1`] = `
"type": "object",
},
},
"required": [
"fabricVersion",
"tls",
],
"required": [],
"title": "Global network settings",
"type": "object",
},
Expand Down Expand Up @@ -789,7 +731,6 @@ exports[`schema should match snapshot 1`] = `
"global",
"orgs",
"channels",
"chaincodes",
],
"title": "Root",
"type": "object",
Expand Down
Loading
Loading