Skip to content
Merged
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
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -589,18 +589,28 @@ Other available parameters for entries in the `chaincodes` array are:

### hooks

Hooks in Fablo are Bash commands to be executed after a specific event.
Currently, Fablo supports only one kind of hook: `postGenerate`.
It will be executed each time after the network config is generated -- after the `./fablo generate` command (executed separately or automatically by `./fablo up`).
Hooks in Fablo are Bash commands to be executed after specific events.
Supported hooks:

The following hook example will change `MaxMessageCount` to 1 in the generated Hyperledger Fabric config:
- `postGenerate` — executed after the network config is generated (after `./fablo generate`, executed separately or automatically by `./fablo up`).
- `postStart` — executed after the network is started (after `./fablo up` or `./fablo start`).

Example `postGenerate` hook that changes `MaxMessageCount` to 1 in generated Hyperledger Fabric config:

```json
"hooks": {
"postGenerate": "perl -i -pe 's/MaxMessageCount: 10/MaxMessageCount: 1/g' \"./fablo-target/fabric-config/configtx.yaml\""
}
```

Example `postStart` hook that waits for peers to be ready or performs any additional bootstrap actions:

```json
"hooks": {
"postStart": "echo 'Network started' && ./fablo-target/fabric-docker.sh channel list org1 peer0"
}
```

Generated hooks are saved in `fablo-target/hooks`.


Expand Down
6 changes: 6 additions & 0 deletions docs/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,12 @@
"title": "Post generate hook",
"description": "Operation to run run after a network config is generated",
"type": "string"
},
"postStart": {
"$id": "#/properties/hooks/postStart",
"title": "Post start hook",
"description": "Operation to run after the network is started (after 'up' or 'start')",
"type": "string"
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions e2e-network/docker/test-02-v2-raft-2orgs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ networkUp() {
expectCommand "cat \"$TEST_TMP/fablo-target/fabric-config/configtx.yaml\"" "MaxMessageCount: 1$"

(cd "$TEST_TMP" && "$FABLO_HOME/fablo.sh" up)

# verify if post start hook was called
expectCommand "cat \"$TEST_TMP/fablo-target/container-list.txt\"" "peer0.org1.example.com"
echo "✅ All expected containers found in the log"
}

dumpLogs() {
Expand Down
11 changes: 11 additions & 0 deletions e2e/__snapshots__/extendConfig.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,7 @@ exports[`extend config samples/fablo-config-hlf2-1org-1chaincode.json 1`] = `
},
"hooks": {
"postGenerate": "",
"postStart": "",
},
"orderedHeadsDistinct": [
{
Expand Down Expand Up @@ -1438,6 +1439,7 @@ exports[`extend config samples/fablo-config-hlf2-1org-1chaincode-k8s.json 1`] =
},
"hooks": {
"postGenerate": "",
"postStart": "",
},
"orderedHeadsDistinct": [
{
Expand Down Expand Up @@ -2242,6 +2244,7 @@ exports[`extend config samples/fablo-config-hlf2-1org-1chaincode-peer-dev-mode.j
},
"hooks": {
"postGenerate": "",
"postStart": "",
},
"orderedHeadsDistinct": [
{
Expand Down Expand Up @@ -3611,6 +3614,7 @@ exports[`extend config samples/fablo-config-hlf2-2orgs-2chaincodes-private-data.
},
"hooks": {
"postGenerate": "",
"postStart": "",
},
"orderedHeadsDistinct": [
{
Expand Down Expand Up @@ -5893,6 +5897,7 @@ exports[`extend config samples/fablo-config-hlf2-2orgs-2chaincodes-raft.yaml 1`]
},
"hooks": {
"postGenerate": "perl -i -pe 's/MaxMessageCount: 10/MaxMessageCount: 1/g' "./fablo-target/fabric-config/configtx.yaml"",
"postStart": "docker ps --format 'table {{.Names}} {{.Status}} {{.Ports}}' > ./fablo-target/container-list.txt 2>&1 && echo 'Container list saved into fablo-target directory'",
},
"orderedHeadsDistinct": [
{
Expand Down Expand Up @@ -8489,6 +8494,7 @@ exports[`extend config samples/fablo-config-hlf2-3orgs-1chaincode-raft-explorer.
},
"hooks": {
"postGenerate": "",
"postStart": "",
},
"orderedHeadsDistinct": [
{
Expand Down Expand Up @@ -10335,6 +10341,7 @@ exports[`extend config samples/fablo-config-hlf3-1org-2chaincode-raft-ccaas.json
},
"hooks": {
"postGenerate": "perl -i -pe 's/MaxMessageCount: 10/MaxMessageCount: 1/g' "./fablo-target/fabric-config/configtx.yaml"",
"postStart": "",
},
"orderedHeadsDistinct": [
{
Expand Down Expand Up @@ -11224,6 +11231,7 @@ exports[`extend config samples/fablo-config-hlf3-1orgs-1chaincode.json 1`] = `
},
"hooks": {
"postGenerate": "",
"postStart": "",
},
"orderedHeadsDistinct": [
{
Expand Down Expand Up @@ -12184,6 +12192,7 @@ exports[`extend config samples/fablo-config-hlf3-bft-1orgs-1chaincode.json 1`] =
},
"hooks": {
"postGenerate": "",
"postStart": "",
},
"orderedHeadsDistinct": [
{
Expand Down Expand Up @@ -13621,6 +13630,7 @@ exports[`extend config samples/invalid-fablo-config.json 1`] = `
},
"hooks": {
"postGenerate": "perl -i -pe 's/MaxMessageCount: 10/MaxMessageCount: 1/g' "./fablo-target/fabric-config/configtx.yaml"",
"postStart": "",
},
"orderedHeadsDistinct": [
{
Expand Down Expand Up @@ -14325,6 +14335,7 @@ exports[`extend config samples/java-dev-mode-sample.json 1`] = `
},
"hooks": {
"postGenerate": "",
"postStart": "",
},
"orderedHeadsDistinct": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,14 @@ echo "Executing post-generate hook"
"
`;

exports[`samples/fablo-config-hlf2-1org-1chaincode-k8s.json should create proper e2e/__tmp__/samples/fablo-config-hlf2-1org-1chaincode-k8s.json.tmpdir/fablo-target/hooks/post-start.sh from samples/fablo-config-hlf2-1org-1chaincode-k8s.json 1`] = `
"#!/usr/bin/env bash

# The code from this file is called after Fablo starts the Hyperledger Fabric network (after 'up' or 'start')
echo "Executing post-start hook"
"
`;

exports[`samples/fablo-config-hlf2-1org-1chaincode-k8s.json should create proper e2e/__tmp__/samples/fablo-config-hlf2-1org-1chaincode-k8s.json.tmpdir/fablo-target/network-topology.mmd from samples/fablo-config-hlf2-1org-1chaincode-k8s.json 1`] = `
"graph TD

Expand Down Expand Up @@ -583,6 +591,7 @@ exports[`samples/fablo-config-hlf2-1org-1chaincode-k8s.json should create proper
"e2e/__tmp__/samples/fablo-config-hlf2-1org-1chaincode-k8s.json.tmpdir/fablo-target/fabric-k8s/scripts/chaincode-functions.sh",
"e2e/__tmp__/samples/fablo-config-hlf2-1org-1chaincode-k8s.json.tmpdir/fablo-target/fabric-k8s/scripts/util.sh",
"e2e/__tmp__/samples/fablo-config-hlf2-1org-1chaincode-k8s.json.tmpdir/fablo-target/hooks/post-generate.sh",
"e2e/__tmp__/samples/fablo-config-hlf2-1org-1chaincode-k8s.json.tmpdir/fablo-target/hooks/post-start.sh",
"e2e/__tmp__/samples/fablo-config-hlf2-1org-1chaincode-k8s.json.tmpdir/fablo-target/network-topology.mmd",
]
`;
Original file line number Diff line number Diff line change
Expand Up @@ -3528,6 +3528,14 @@ echo "Executing post-generate hook"
"
`;

exports[`samples/fablo-config-hlf2-1org-1chaincode-peer-dev-mode.json should create proper e2e/__tmp__/samples/fablo-config-hlf2-1org-1chaincode-peer-dev-mode.json.tmpdir/fablo-target/hooks/post-start.sh from samples/fablo-config-hlf2-1org-1chaincode-peer-dev-mode.json 1`] = `
"#!/usr/bin/env bash

# The code from this file is called after Fablo starts the Hyperledger Fabric network (after 'up' or 'start')
echo "Executing post-start hook"
"
`;

exports[`samples/fablo-config-hlf2-1org-1chaincode-peer-dev-mode.json should create proper e2e/__tmp__/samples/fablo-config-hlf2-1org-1chaincode-peer-dev-mode.json.tmpdir/fablo-target/network-topology.mmd from samples/fablo-config-hlf2-1org-1chaincode-peer-dev-mode.json 1`] = `
"graph TD

Expand Down Expand Up @@ -3578,6 +3586,7 @@ exports[`samples/fablo-config-hlf2-1org-1chaincode-peer-dev-mode.json should cre
"e2e/__tmp__/samples/fablo-config-hlf2-1org-1chaincode-peer-dev-mode.json.tmpdir/fablo-target/fabric-docker/scripts/cli/channel_fns.sh",
"e2e/__tmp__/samples/fablo-config-hlf2-1org-1chaincode-peer-dev-mode.json.tmpdir/fablo-target/fabric-docker/snapshot-scripts.sh",
"e2e/__tmp__/samples/fablo-config-hlf2-1org-1chaincode-peer-dev-mode.json.tmpdir/fablo-target/hooks/post-generate.sh",
"e2e/__tmp__/samples/fablo-config-hlf2-1org-1chaincode-peer-dev-mode.json.tmpdir/fablo-target/hooks/post-start.sh",
"e2e/__tmp__/samples/fablo-config-hlf2-1org-1chaincode-peer-dev-mode.json.tmpdir/fablo-target/network-topology.mmd",
]
`;
Original file line number Diff line number Diff line change
Expand Up @@ -3589,6 +3589,14 @@ echo "Executing post-generate hook"
"
`;

exports[`samples/fablo-config-hlf2-1org-1chaincode.json should create proper e2e/__tmp__/samples/fablo-config-hlf2-1org-1chaincode.json.tmpdir/fablo-target/hooks/post-start.sh from samples/fablo-config-hlf2-1org-1chaincode.json 1`] = `
"#!/usr/bin/env bash

# The code from this file is called after Fablo starts the Hyperledger Fabric network (after 'up' or 'start')
echo "Executing post-start hook"
"
`;

exports[`samples/fablo-config-hlf2-1org-1chaincode.json should create proper e2e/__tmp__/samples/fablo-config-hlf2-1org-1chaincode.json.tmpdir/fablo-target/network-topology.mmd from samples/fablo-config-hlf2-1org-1chaincode.json 1`] = `
"graph TD

Expand Down Expand Up @@ -3641,6 +3649,7 @@ exports[`samples/fablo-config-hlf2-1org-1chaincode.json should create proper fil
"e2e/__tmp__/samples/fablo-config-hlf2-1org-1chaincode.json.tmpdir/fablo-target/fabric-docker/scripts/cli/channel_fns.sh",
"e2e/__tmp__/samples/fablo-config-hlf2-1org-1chaincode.json.tmpdir/fablo-target/fabric-docker/snapshot-scripts.sh",
"e2e/__tmp__/samples/fablo-config-hlf2-1org-1chaincode.json.tmpdir/fablo-target/hooks/post-generate.sh",
"e2e/__tmp__/samples/fablo-config-hlf2-1org-1chaincode.json.tmpdir/fablo-target/hooks/post-start.sh",
"e2e/__tmp__/samples/fablo-config-hlf2-1org-1chaincode.json.tmpdir/fablo-target/network-topology.mmd",
]
`;
Original file line number Diff line number Diff line change
Expand Up @@ -3774,6 +3774,14 @@ perl -i -pe 's/MaxMessageCount: 10/MaxMessageCount: 1/g' "./fablo-target/fabric-
"
`;

exports[`samples/fablo-config-hlf3-1org-2chaincode-raft-ccaas.json should create proper e2e/__tmp__/samples/fablo-config-hlf3-1org-2chaincode-raft-ccaas.json.tmpdir/fablo-target/hooks/post-start.sh from samples/fablo-config-hlf3-1org-2chaincode-raft-ccaas.json 1`] = `
"#!/usr/bin/env bash

# The code from this file is called after Fablo starts the Hyperledger Fabric network (after 'up' or 'start')
echo "Executing post-start hook"
"
`;

exports[`samples/fablo-config-hlf3-1org-2chaincode-raft-ccaas.json should create proper e2e/__tmp__/samples/fablo-config-hlf3-1org-2chaincode-raft-ccaas.json.tmpdir/fablo-target/network-topology.mmd from samples/fablo-config-hlf3-1org-2chaincode-raft-ccaas.json 1`] = `
"graph TD

Expand Down Expand Up @@ -3831,6 +3839,7 @@ exports[`samples/fablo-config-hlf3-1org-2chaincode-raft-ccaas.json should create
"e2e/__tmp__/samples/fablo-config-hlf3-1org-2chaincode-raft-ccaas.json.tmpdir/fablo-target/fabric-docker/scripts/cli/channel_fns.sh",
"e2e/__tmp__/samples/fablo-config-hlf3-1org-2chaincode-raft-ccaas.json.tmpdir/fablo-target/fabric-docker/snapshot-scripts.sh",
"e2e/__tmp__/samples/fablo-config-hlf3-1org-2chaincode-raft-ccaas.json.tmpdir/fablo-target/hooks/post-generate.sh",
"e2e/__tmp__/samples/fablo-config-hlf3-1org-2chaincode-raft-ccaas.json.tmpdir/fablo-target/hooks/post-start.sh",
"e2e/__tmp__/samples/fablo-config-hlf3-1org-2chaincode-raft-ccaas.json.tmpdir/fablo-target/network-topology.mmd",
]
`;
Original file line number Diff line number Diff line change
Expand Up @@ -4546,6 +4546,14 @@ echo "Executing post-generate hook"
"
`;

exports[`samples/fablo-config-hlf2-2orgs-2chaincodes-private-data.yaml should create proper e2e/__tmp__/samples/fablo-config-hlf2-2orgs-2chaincodes-private-data.yaml.tmpdir/fablo-target/hooks/post-start.sh from samples/fablo-config-hlf2-2orgs-2chaincodes-private-data.yaml 1`] = `
"#!/usr/bin/env bash

# The code from this file is called after Fablo starts the Hyperledger Fabric network (after 'up' or 'start')
echo "Executing post-start hook"
"
`;

exports[`samples/fablo-config-hlf2-2orgs-2chaincodes-private-data.yaml should create proper e2e/__tmp__/samples/fablo-config-hlf2-2orgs-2chaincodes-private-data.yaml.tmpdir/fablo-target/network-topology.mmd from samples/fablo-config-hlf2-2orgs-2chaincodes-private-data.yaml 1`] = `
"graph TD

Expand Down Expand Up @@ -4612,6 +4620,7 @@ exports[`samples/fablo-config-hlf2-2orgs-2chaincodes-private-data.yaml should cr
"e2e/__tmp__/samples/fablo-config-hlf2-2orgs-2chaincodes-private-data.yaml.tmpdir/fablo-target/fabric-docker/scripts/cli/channel_fns.sh",
"e2e/__tmp__/samples/fablo-config-hlf2-2orgs-2chaincodes-private-data.yaml.tmpdir/fablo-target/fabric-docker/snapshot-scripts.sh",
"e2e/__tmp__/samples/fablo-config-hlf2-2orgs-2chaincodes-private-data.yaml.tmpdir/fablo-target/hooks/post-generate.sh",
"e2e/__tmp__/samples/fablo-config-hlf2-2orgs-2chaincodes-private-data.yaml.tmpdir/fablo-target/hooks/post-start.sh",
"e2e/__tmp__/samples/fablo-config-hlf2-2orgs-2chaincodes-private-data.yaml.tmpdir/fablo-target/network-topology.mmd",
]
`;
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ chaincodes:
hooks:
# changes MaxMessageCount to 1
postGenerate: "perl -i -pe 's/MaxMessageCount: 10/MaxMessageCount: 1/g' \\"./fablo-target/fabric-config/configtx.yaml\\""
postStart: "docker ps --format 'table {{.Names}}\\t{{.Status}}\\t{{.Ports}}' > ./fablo-target/container-list.txt 2>&1 && echo 'Container list saved into fablo-target directory'"
"
`;

Expand Down Expand Up @@ -6509,6 +6510,16 @@ perl -i -pe 's/MaxMessageCount: 10/MaxMessageCount: 1/g' "./fablo-target/fabric-
"
`;

exports[`samples/fablo-config-hlf2-2orgs-2chaincodes-raft.yaml should create proper e2e/__tmp__/samples/fablo-config-hlf2-2orgs-2chaincodes-raft.yaml.tmpdir/fablo-target/hooks/post-start.sh from samples/fablo-config-hlf2-2orgs-2chaincodes-raft.yaml 1`] = `
"#!/usr/bin/env bash

# The code from this file is called after Fablo starts the Hyperledger Fabric network (after 'up' or 'start')
echo "Executing post-start hook"

docker ps --format 'table {{.Names}} {{.Status}} {{.Ports}}' >./fablo-target/container-list.txt 2>&1 && echo 'Container list saved into fablo-target directory'
"
`;

exports[`samples/fablo-config-hlf2-2orgs-2chaincodes-raft.yaml should create proper e2e/__tmp__/samples/fablo-config-hlf2-2orgs-2chaincodes-raft.yaml.tmpdir/fablo-target/network-topology.mmd from samples/fablo-config-hlf2-2orgs-2chaincodes-raft.yaml 1`] = `
"graph TD

Expand Down Expand Up @@ -6610,6 +6621,7 @@ exports[`samples/fablo-config-hlf2-2orgs-2chaincodes-raft.yaml should create pro
"e2e/__tmp__/samples/fablo-config-hlf2-2orgs-2chaincodes-raft.yaml.tmpdir/fablo-target/fabric-docker/scripts/cli/channel_fns.sh",
"e2e/__tmp__/samples/fablo-config-hlf2-2orgs-2chaincodes-raft.yaml.tmpdir/fablo-target/fabric-docker/snapshot-scripts.sh",
"e2e/__tmp__/samples/fablo-config-hlf2-2orgs-2chaincodes-raft.yaml.tmpdir/fablo-target/hooks/post-generate.sh",
"e2e/__tmp__/samples/fablo-config-hlf2-2orgs-2chaincodes-raft.yaml.tmpdir/fablo-target/hooks/post-start.sh",
"e2e/__tmp__/samples/fablo-config-hlf2-2orgs-2chaincodes-raft.yaml.tmpdir/fablo-target/network-topology.mmd",
]
`;
Original file line number Diff line number Diff line change
Expand Up @@ -7108,6 +7108,14 @@ echo "Executing post-generate hook"
"
`;

exports[`samples/fablo-config-hlf2-3orgs-1chaincode-raft-explorer.json should create proper e2e/__tmp__/samples/fablo-config-hlf2-3orgs-1chaincode-raft-explorer.json.tmpdir/fablo-target/hooks/post-start.sh from samples/fablo-config-hlf2-3orgs-1chaincode-raft-explorer.json 1`] = `
"#!/usr/bin/env bash

# The code from this file is called after Fablo starts the Hyperledger Fabric network (after 'up' or 'start')
echo "Executing post-start hook"
"
`;

exports[`samples/fablo-config-hlf2-3orgs-1chaincode-raft-explorer.json should create proper e2e/__tmp__/samples/fablo-config-hlf2-3orgs-1chaincode-raft-explorer.json.tmpdir/fablo-target/network-topology.mmd from samples/fablo-config-hlf2-3orgs-1chaincode-raft-explorer.json 1`] = `
"graph TD

Expand Down Expand Up @@ -7201,6 +7209,7 @@ exports[`samples/fablo-config-hlf2-3orgs-1chaincode-raft-explorer.json should cr
"e2e/__tmp__/samples/fablo-config-hlf2-3orgs-1chaincode-raft-explorer.json.tmpdir/fablo-target/fabric-docker/scripts/cli/channel_fns.sh",
"e2e/__tmp__/samples/fablo-config-hlf2-3orgs-1chaincode-raft-explorer.json.tmpdir/fablo-target/fabric-docker/snapshot-scripts.sh",
"e2e/__tmp__/samples/fablo-config-hlf2-3orgs-1chaincode-raft-explorer.json.tmpdir/fablo-target/hooks/post-generate.sh",
"e2e/__tmp__/samples/fablo-config-hlf2-3orgs-1chaincode-raft-explorer.json.tmpdir/fablo-target/hooks/post-start.sh",
"e2e/__tmp__/samples/fablo-config-hlf2-3orgs-1chaincode-raft-explorer.json.tmpdir/fablo-target/network-topology.mmd",
]
`;
Original file line number Diff line number Diff line change
Expand Up @@ -3986,6 +3986,14 @@ echo "Executing post-generate hook"
"
`;

exports[`samples/fablo-config-hlf3-1orgs-1chaincode.json should create proper e2e/__tmp__/samples/fablo-config-hlf3-1orgs-1chaincode.json.tmpdir/fablo-target/hooks/post-start.sh from samples/fablo-config-hlf3-1orgs-1chaincode.json 1`] = `
"#!/usr/bin/env bash

# The code from this file is called after Fablo starts the Hyperledger Fabric network (after 'up' or 'start')
echo "Executing post-start hook"
"
`;

exports[`samples/fablo-config-hlf3-1orgs-1chaincode.json should create proper e2e/__tmp__/samples/fablo-config-hlf3-1orgs-1chaincode.json.tmpdir/fablo-target/network-topology.mmd from samples/fablo-config-hlf3-1orgs-1chaincode.json 1`] = `
"graph TD

Expand Down Expand Up @@ -4038,6 +4046,7 @@ exports[`samples/fablo-config-hlf3-1orgs-1chaincode.json should create proper fi
"e2e/__tmp__/samples/fablo-config-hlf3-1orgs-1chaincode.json.tmpdir/fablo-target/fabric-docker/scripts/cli/channel_fns.sh",
"e2e/__tmp__/samples/fablo-config-hlf3-1orgs-1chaincode.json.tmpdir/fablo-target/fabric-docker/snapshot-scripts.sh",
"e2e/__tmp__/samples/fablo-config-hlf3-1orgs-1chaincode.json.tmpdir/fablo-target/hooks/post-generate.sh",
"e2e/__tmp__/samples/fablo-config-hlf3-1orgs-1chaincode.json.tmpdir/fablo-target/hooks/post-start.sh",
"e2e/__tmp__/samples/fablo-config-hlf3-1orgs-1chaincode.json.tmpdir/fablo-target/network-topology.mmd",
]
`;
Original file line number Diff line number Diff line change
Expand Up @@ -4011,6 +4011,14 @@ echo "Executing post-generate hook"
"
`;

exports[`samples/fablo-config-hlf3-bft-1orgs-1chaincode.json should create proper e2e/__tmp__/samples/fablo-config-hlf3-bft-1orgs-1chaincode.json.tmpdir/fablo-target/hooks/post-start.sh from samples/fablo-config-hlf3-bft-1orgs-1chaincode.json 1`] = `
"#!/usr/bin/env bash

# The code from this file is called after Fablo starts the Hyperledger Fabric network (after 'up' or 'start')
echo "Executing post-start hook"
"
`;

exports[`samples/fablo-config-hlf3-bft-1orgs-1chaincode.json should create proper e2e/__tmp__/samples/fablo-config-hlf3-bft-1orgs-1chaincode.json.tmpdir/fablo-target/network-topology.mmd from samples/fablo-config-hlf3-bft-1orgs-1chaincode.json 1`] = `
"graph TD

Expand Down Expand Up @@ -4063,6 +4071,7 @@ exports[`samples/fablo-config-hlf3-bft-1orgs-1chaincode.json should create prope
"e2e/__tmp__/samples/fablo-config-hlf3-bft-1orgs-1chaincode.json.tmpdir/fablo-target/fabric-docker/scripts/cli/channel_fns.sh",
"e2e/__tmp__/samples/fablo-config-hlf3-bft-1orgs-1chaincode.json.tmpdir/fablo-target/fabric-docker/snapshot-scripts.sh",
"e2e/__tmp__/samples/fablo-config-hlf3-bft-1orgs-1chaincode.json.tmpdir/fablo-target/hooks/post-generate.sh",
"e2e/__tmp__/samples/fablo-config-hlf3-bft-1orgs-1chaincode.json.tmpdir/fablo-target/hooks/post-start.sh",
"e2e/__tmp__/samples/fablo-config-hlf3-bft-1orgs-1chaincode.json.tmpdir/fablo-target/network-topology.mmd",
]
`;
6 changes: 4 additions & 2 deletions e2e/__snapshots__/fabloCommands.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2479,7 +2479,8 @@ Validation warnings count: 0
}
],
"hooks": {
"postGenerate": "perl -i -pe 's/MaxMessageCount: 10/MaxMessageCount: 1/g' \\"./fablo-target/fabric-config/configtx.yaml\\""
"postGenerate": "perl -i -pe 's/MaxMessageCount: 10/MaxMessageCount: 1/g' \\"./fablo-target/fabric-config/configtx.yaml\\"",
"postStart": "docker ps --format 'table {{.Names}}\\t{{.Status}}\\t{{.Ports}}' > ./fablo-target/container-list.txt 2>&1 && echo 'Container list saved into fablo-target directory'"
}
}

Expand Down Expand Up @@ -3008,7 +3009,8 @@ Validation warnings count: 0
],
"chaincodes": [],
"hooks": {
"postGenerate": ""
"postGenerate": "",
"postStart": ""
}
}

Expand Down
6 changes: 6 additions & 0 deletions e2e/__snapshots__/schema.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,12 @@ exports[`schema should match snapshot 1`] = `
"title": "Post generate hook",
"type": "string",
},
"postStart": {
"$id": "#/properties/hooks/postStart",
"description": "Operation to run after the network is started (after 'up' or 'start')",
"title": "Post start hook",
"type": "string",
},
},
"title": "Hooks",
"type": "object",
Expand Down
Loading
Loading