Skip to content

Commit 9875def

Browse files
committed
detect changes in fablo-config.json and prevent reusing old network
Signed-off-by: OsamaRab3 <osrab3@gmail.com>
1 parent 40d612c commit 9875def

12 files changed

+763
-2
lines changed

e2e/__snapshots__/fablo-config-hlf2-1org-1chaincode-k8s.json.test.ts.snap

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,65 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3+
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/fablo-config.json from samples/fablo-config-hlf2-1org-1chaincode-k8s.json 1`] = `
4+
"{
5+
"$schema": "https://github.com/hyperledger-labs/fablo/releases/download/2.3.0/schema.json",
6+
"global": {
7+
"fabricVersion": "2.4.7",
8+
"tls": false,
9+
"engine": "kubernetes"
10+
},
11+
"orgs": [
12+
{
13+
"organization": {
14+
"name": "Orderer",
15+
"domain": "orderer.example.com"
16+
},
17+
"orderers": [
18+
{
19+
"groupName": "group1",
20+
"type": "solo",
21+
"instances": 1
22+
}
23+
]
24+
},
25+
{
26+
"organization": {
27+
"name": "Org1",
28+
"domain": "org1.example.com"
29+
},
30+
"peer": {
31+
"instances": 2,
32+
"db": "LevelDb"
33+
}
34+
}
35+
],
36+
"channels": [
37+
{
38+
"name": "my-channel1",
39+
"orgs": [
40+
{
41+
"name": "Org1",
42+
"peers": [
43+
"peer0",
44+
"peer1"
45+
]
46+
}
47+
]
48+
}
49+
],
50+
"chaincodes": [
51+
{
52+
"name": "chaincode1",
53+
"version": "0.0.1",
54+
"lang": "node",
55+
"channel": "my-channel1",
56+
"directory": "./chaincodes/chaincode-kv-node"
57+
}
58+
]
59+
}
60+
"
61+
`;
62+
363
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-config/.gitignore from samples/fablo-config-hlf2-1org-1chaincode-k8s.json 1`] = `
464
"/config
565
/crypto-config
@@ -514,6 +574,7 @@ exports[`samples/fablo-config-hlf2-1org-1chaincode-k8s.json should create proper
514574
515575
exports[`samples/fablo-config-hlf2-1org-1chaincode-k8s.json should create proper files from samples/fablo-config-hlf2-1org-1chaincode-k8s.json 1`] = `
516576
[
577+
"e2e/__tmp__/samples/fablo-config-hlf2-1org-1chaincode-k8s.json.tmpdir/fablo-target/fablo-config.json",
517578
"e2e/__tmp__/samples/fablo-config-hlf2-1org-1chaincode-k8s.json.tmpdir/fablo-target/fabric-config/.gitignore",
518579
"e2e/__tmp__/samples/fablo-config-hlf2-1org-1chaincode-k8s.json.tmpdir/fablo-target/fabric-k8s.sh",
519580
"e2e/__tmp__/samples/fablo-config-hlf2-1org-1chaincode-k8s.json.tmpdir/fablo-target/fabric-k8s/.env",

e2e/__snapshots__/fablo-config-hlf2-1org-1chaincode-peer-dev-mode.json.test.ts.snap

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,74 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3+
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/fablo-config.json from samples/fablo-config-hlf2-1org-1chaincode-peer-dev-mode.json 1`] = `
4+
"{
5+
"$schema": "https://github.com/hyperledger-labs/fablo/releases/download/2.3.0/schema.json",
6+
"global": {
7+
"fabricVersion": "2.5.12",
8+
"tls": false,
9+
"peerDevMode": true,
10+
"engine": "docker"
11+
},
12+
"orgs": [
13+
{
14+
"organization": {
15+
"name": "Orderer",
16+
"domain": "orderer.example.com",
17+
"mspName": "OrdererMSP"
18+
},
19+
"orderers": [
20+
{
21+
"groupName": "group1",
22+
"type": "solo",
23+
"instances": 1
24+
}
25+
]
26+
},
27+
{
28+
"organization": {
29+
"name": "Org1",
30+
"domain": "org1.example.com",
31+
"mspName": "Org1MSP"
32+
},
33+
"ca": {
34+
"db": "postgres"
35+
},
36+
"peer": {
37+
"instances": 1,
38+
"db": "CouchDb"
39+
},
40+
"tools": {
41+
"fabloRest": true
42+
}
43+
}
44+
],
45+
"channels": [
46+
{
47+
"name": "my-channel1",
48+
"orgs": [
49+
{
50+
"name": "Org1",
51+
"peers": [
52+
"peer0"
53+
]
54+
}
55+
]
56+
}
57+
],
58+
"chaincodes": [
59+
{
60+
"name": "chaincode1",
61+
"version": "0.0.1",
62+
"lang": "node",
63+
"channel": "my-channel1",
64+
"directory": "./chaincodes/chaincode-kv-node",
65+
"privateData": []
66+
}
67+
],
68+
"hooks": {}
69+
}"
70+
`;
71+
372
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/fabric-config/.gitignore from samples/fablo-config-hlf2-1org-1chaincode-peer-dev-mode.json 1`] = `
473
"/config
574
/crypto-config
@@ -3466,6 +3535,7 @@ exports[`samples/fablo-config-hlf2-1org-1chaincode-peer-dev-mode.json should cre
34663535
34673536
exports[`samples/fablo-config-hlf2-1org-1chaincode-peer-dev-mode.json should create proper files from samples/fablo-config-hlf2-1org-1chaincode-peer-dev-mode.json 1`] = `
34683537
[
3538+
"e2e/__tmp__/samples/fablo-config-hlf2-1org-1chaincode-peer-dev-mode.json.tmpdir/fablo-target/fablo-config.json",
34693539
"e2e/__tmp__/samples/fablo-config-hlf2-1org-1chaincode-peer-dev-mode.json.tmpdir/fablo-target/fabric-config/.gitignore",
34703540
"e2e/__tmp__/samples/fablo-config-hlf2-1org-1chaincode-peer-dev-mode.json.tmpdir/fablo-target/fabric-config/configtx.yaml",
34713541
"e2e/__tmp__/samples/fablo-config-hlf2-1org-1chaincode-peer-dev-mode.json.tmpdir/fablo-target/fabric-config/connection-profiles/connection-profile-orderer.json",

e2e/__snapshots__/fablo-config-hlf2-1org-1chaincode.json.test.ts.snap

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,64 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3+
exports[`samples/fablo-config-hlf2-1org-1chaincode.json should create proper e2e/__tmp__/samples/fablo-config-hlf2-1org-1chaincode.json.tmpdir/fablo-target/fablo-config.json from samples/fablo-config-hlf2-1org-1chaincode.json 1`] = `
4+
"{
5+
"$schema": "https://github.com/hyperledger-labs/fablo/releases/download/2.3.0/schema.json",
6+
"global": {
7+
"fabricVersion": "2.5.9",
8+
"tls": false
9+
},
10+
"orgs": [
11+
{
12+
"organization": {
13+
"name": "Orderer",
14+
"domain": "orderer.example.com"
15+
},
16+
"orderers": [
17+
{
18+
"groupName": "group1",
19+
"type": "solo",
20+
"instances": 1
21+
}
22+
]
23+
},
24+
{
25+
"organization": {
26+
"name": "Org1",
27+
"domain": "org1.example.com"
28+
},
29+
"peer": {
30+
"instances": 2,
31+
"db": "LevelDb"
32+
}
33+
}
34+
],
35+
"channels": [
36+
{
37+
"name": "my-channel1",
38+
"orgs": [
39+
{
40+
"name": "Org1",
41+
"peers": [
42+
"peer0",
43+
"peer1"
44+
]
45+
}
46+
]
47+
}
48+
],
49+
"chaincodes": [
50+
{
51+
"name": "chaincode1",
52+
"version": "0.0.1",
53+
"lang": "node",
54+
"channel": "my-channel1",
55+
"directory": "./chaincodes/chaincode-kv-node"
56+
}
57+
]
58+
}
59+
"
60+
`;
61+
362
exports[`samples/fablo-config-hlf2-1org-1chaincode.json should create proper e2e/__tmp__/samples/fablo-config-hlf2-1org-1chaincode.json.tmpdir/fablo-target/fabric-config/.gitignore from samples/fablo-config-hlf2-1org-1chaincode.json 1`] = `
463
"/config
564
/crypto-config
@@ -3538,6 +3597,7 @@ exports[`samples/fablo-config-hlf2-1org-1chaincode.json should create proper e2e
35383597
35393598
exports[`samples/fablo-config-hlf2-1org-1chaincode.json should create proper files from samples/fablo-config-hlf2-1org-1chaincode.json 1`] = `
35403599
[
3600+
"e2e/__tmp__/samples/fablo-config-hlf2-1org-1chaincode.json.tmpdir/fablo-target/fablo-config.json",
35413601
"e2e/__tmp__/samples/fablo-config-hlf2-1org-1chaincode.json.tmpdir/fablo-target/fabric-config/.gitignore",
35423602
"e2e/__tmp__/samples/fablo-config-hlf2-1org-1chaincode.json.tmpdir/fablo-target/fabric-config/configtx.yaml",
35433603
"e2e/__tmp__/samples/fablo-config-hlf2-1org-1chaincode.json.tmpdir/fablo-target/fabric-config/connection-profiles/connection-profile-orderer.json",

e2e/__snapshots__/fablo-config-hlf2-1org-2chaincode-raft-ccaas.json.test.ts.snap

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,90 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3+
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/fablo-config.json from samples/fablo-config-hlf3-1org-2chaincode-raft-ccaas.json 1`] = `
4+
"{
5+
"$schema": "https://github.com/hyperledger-labs/fablo/releases/download/2.3.0/schema.json",
6+
"global": {
7+
"fabricVersion": "3.0.0",
8+
"tls": true
9+
},
10+
"orgs": [
11+
{
12+
"organization": {
13+
"name": "Orderer",
14+
"domain": "orderer.example.com"
15+
},
16+
"orderers": [
17+
{
18+
"groupName": "group1",
19+
"type": "raft",
20+
"instances": 1
21+
}
22+
]
23+
},
24+
{
25+
"organization": {
26+
"name": "Org1",
27+
"domain": "org1.example.com"
28+
},
29+
"ca": {
30+
"db": "postgres"
31+
},
32+
"peer": {
33+
"instances": 1,
34+
"db": "CouchDb"
35+
},
36+
"tools": {
37+
"fabloRest": true
38+
}
39+
}
40+
],
41+
"channels": [
42+
{
43+
"name": "my-channel1",
44+
"orgs": [
45+
{
46+
"name": "Org1",
47+
"peers": [
48+
"peer0"
49+
]
50+
}
51+
]
52+
},
53+
{
54+
"name": "my-channel2",
55+
"orgs": [
56+
{
57+
"name": "Org1",
58+
"peers": [
59+
"peer0"
60+
]
61+
}
62+
]
63+
}
64+
],
65+
"chaincodes": [
66+
{
67+
"name": "chaincode1",
68+
"version": "0.0.1",
69+
"lang": "ccaas",
70+
"channel": "my-channel1",
71+
"image": "ghcr.io/fablo-io/fablo-sample-kv-node-chaincode:2.2.0"
72+
},
73+
{
74+
"name": "chaincode1",
75+
"version": "0.0.1",
76+
"lang": "ccaas",
77+
"channel": "my-channel2",
78+
"image": "ghcr.io/fablo-io/fablo-sample-kv-node-chaincode:2.2.0"
79+
}
80+
],
81+
"hooks": {
82+
"postGenerate": "perl -i -pe 's/MaxMessageCount: 10/MaxMessageCount: 1/g' \\"./fablo-target/fabric-config/configtx.yaml\\""
83+
}
84+
}
85+
"
86+
`;
87+
388
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/fabric-config/.gitignore from samples/fablo-config-hlf3-1org-2chaincode-raft-ccaas.json 1`] = `
489
"/config
590
/crypto-config
@@ -3688,6 +3773,7 @@ exports[`samples/fablo-config-hlf3-1org-2chaincode-raft-ccaas.json should create
36883773
36893774
exports[`samples/fablo-config-hlf3-1org-2chaincode-raft-ccaas.json should create proper files from samples/fablo-config-hlf3-1org-2chaincode-raft-ccaas.json 1`] = `
36903775
[
3776+
"e2e/__tmp__/samples/fablo-config-hlf3-1org-2chaincode-raft-ccaas.json.tmpdir/fablo-target/fablo-config.json",
36913777
"e2e/__tmp__/samples/fablo-config-hlf3-1org-2chaincode-raft-ccaas.json.tmpdir/fablo-target/fabric-config/.gitignore",
36923778
"e2e/__tmp__/samples/fablo-config-hlf3-1org-2chaincode-raft-ccaas.json.tmpdir/fablo-target/fabric-config/configtx.yaml",
36933779
"e2e/__tmp__/samples/fablo-config-hlf3-1org-2chaincode-raft-ccaas.json.tmpdir/fablo-target/fabric-config/connection-profiles/connection-profile-orderer.json",

0 commit comments

Comments
 (0)