Skip to content

Commit 383c4ba

Browse files
committed
feat: bump chaincode lifecycle + update tasks file
1 parent 86faa80 commit 383c4ba

File tree

4 files changed

+2725
-15
lines changed

4 files changed

+2725
-15
lines changed

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ export CC_SEQUENCE=1
66
export CC_INIT_FCN=InitLedger
77
# export CC_INIT_ARGS="[]"
88
# export CC_COLLECTIONS_CONFIG_PATH=./collections_config.json
9+
# export CC_CHANNEL="mychannel"

.vscode/tasks.json

Lines changed: 148 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"version": "2.0.0",
33
"tasks": [
44
{
5-
"label": "package chaincode",
5+
"label": "chaincode lifecycle - 1. package",
66
"type": "shell",
77
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh package",
88
"group": {
@@ -12,59 +12,193 @@
1212
"problemMatcher": []
1313
},
1414
{
15-
"label": "deploy chaincode",
15+
"label": "chaincode lifecycle - 2. deploy",
1616
"type": "shell",
17-
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh install",
17+
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh install ${input:select-peer}",
1818
"problemMatcher": []
1919
},
2020
{
21-
"label": "approve chaincode",
21+
"label": "chaincode lifecycle - 3. approve",
2222
"type": "shell",
23-
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh approve",
23+
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh approve ${input:select-peer}",
2424
"problemMatcher": []
2525
},
2626
{
27-
"label": "commit chaincode",
27+
"label": "chaincode lifecycle - 4. check commit readiness",
2828
"type": "shell",
29-
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh commit",
29+
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh commit-readiness ${input:select-peer}",
3030
"problemMatcher": []
3131
},
3232
{
33-
"label": "init chaincode",
33+
"label": "chaincode lifecycle - 5. commit",
3434
"type": "shell",
35-
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh init",
35+
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh commit ${input:select-peer}",
3636
"problemMatcher": []
3737
},
3838
{
39-
"label": "list peers",
39+
"label": "chaincode lifecycle - 6. init",
40+
"type": "shell",
41+
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh init ${input:select-peer}",
42+
"problemMatcher": []
43+
},
44+
{
45+
"label": "chaincode - query",
46+
"type": "shell",
47+
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh query ${input:select-peer} ${input:select-function-name} '[${input:select-function-args}]'",
48+
"problemMatcher": []
49+
},
50+
{
51+
"label": "chaincode - invoke",
52+
"type": "shell",
53+
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh invoke ${input:select-peer} ${input:select-function-name} '[${input:select-function-args}]'",
54+
"problemMatcher": []
55+
},
56+
{
57+
"label": "list - deployed chaincode",
58+
"type": "shell",
59+
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh installed ${input:select-peer}",
60+
"problemMatcher": []
61+
},
62+
{
63+
"label": "list - approved chaincode",
64+
"type": "shell",
65+
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh approved ${input:select-peer}",
66+
"problemMatcher": []
67+
},
68+
{
69+
"label": "list - committed chaincode",
70+
"type": "shell",
71+
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh committed ${input:select-peer}",
72+
"problemMatcher": []
73+
},
74+
{
75+
"label": "list - peers",
4076
"type": "shell",
4177
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh peers",
4278
"problemMatcher": []
4379
},
4480
{
45-
"label": "list orderers",
81+
"label": "list - orderers",
4682
"type": "shell",
4783
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh orderers",
4884
"problemMatcher": []
4985
},
5086
{
51-
"label": "list nodes",
87+
"label": "list - nodes",
5288
"type": "shell",
5389
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh nodes",
5490
"problemMatcher": []
5591
},
5692
{
57-
"label": "list channels",
93+
"label": "list - channels",
5894
"type": "shell",
5995
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh channels",
6096
"problemMatcher": []
6197
},
98+
{
99+
"label": "channel - create",
100+
"type": "shell",
101+
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh create-channel \"${input:create-channel-name}\" --endorsementPolicy \"${input:create-channel-endorsement-policy}\" --batchTimeoutInSeconds ${input:create-channel-batch-timeout-seconds} --maxMessageCount ${input:create-channel-max-message-count} --absoluteMaxMB ${input:create-channel-absolute-max-mb} --preferredMaxMB ${input:create-channel-preferred-max-mb}",
102+
"problemMatcher": []
103+
},
104+
{
105+
"label": "channel - orderer join",
106+
"type": "shell",
107+
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh orderer-join-channel ${input:select-orderer} ${input:select-channel}",
108+
"problemMatcher": []
109+
},
110+
{
111+
"label": "channel - orderer leave",
112+
"type": "shell",
113+
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh orderer-leave-channel ${input:select-orderer} ${input:select-channel}",
114+
"problemMatcher": []
115+
},
116+
{
117+
"label": "channel - peer join",
118+
"type": "shell",
119+
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh peer-join-channel ${input:select-peer} ${input:select-channel}",
120+
"problemMatcher": []
121+
},
122+
{
123+
"label": "channel - peer leave",
124+
"type": "shell",
125+
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh peer-leave-channel ${input:select-peer} ${input:select-channel}",
126+
"problemMatcher": []
127+
},
62128
{
63129
"label": "help",
64130
"type": "shell",
65131
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh help",
66132
"problemMatcher": []
67133
}
68134
],
69-
"inputs": []
135+
"inputs": [
136+
{
137+
"id": "select-peer",
138+
"description": "Which peer do you want to use?",
139+
"default": "default",
140+
"type": "promptString"
141+
},
142+
{
143+
"id": "select-orderer",
144+
"description": "Which orderer do you want to use?",
145+
"default": "default",
146+
"type": "promptString"
147+
},
148+
{
149+
"id": "select-channel",
150+
"description": "Which channel do you want to use?",
151+
"default": "default",
152+
"type": "promptString"
153+
},
154+
{
155+
"id": "select-function-name",
156+
"description": "Which function do you want to call?",
157+
"default": "",
158+
"type": "promptString"
159+
},
160+
{
161+
"id": "select-function-args",
162+
"description": "Which function arguments do you want to pass?",
163+
"default": "\"arg1\", \"arg2\"",
164+
"type": "promptString"
165+
},
166+
{
167+
"id": "create-channel-name",
168+
"description": "How do you want to name your new channel?",
169+
"default": "",
170+
"type": "promptString"
171+
},
172+
{
173+
"id": "create-channel-endorsement-policy",
174+
"description": "Which endorsement policy do you want to use?",
175+
"default": "MAJORITY",
176+
"type": "pickString",
177+
"options": ["MAJORITY", "ALL"]
178+
},
179+
{
180+
"id": "create-channel-batch-timeout-seconds",
181+
"description": "Batch timeout in seconds?",
182+
"default": "2",
183+
"type": "promptString"
184+
},
185+
{
186+
"id": "create-channel-max-message-count",
187+
"description": " Maximum of transactions per block?",
188+
"default": "500",
189+
"type": "promptString"
190+
},
191+
{
192+
"id": "create-channel-absolute-max-mb",
193+
"description": "Absolute maximum MB for block size?",
194+
"default": "10",
195+
"type": "promptString"
196+
},
197+
{
198+
"id": "create-channel-preferred-max-mb",
199+
"description": "Preferred maximum MB for block size?",
200+
"default": "2",
201+
"type": "promptString"
202+
}
203+
]
70204
}

0 commit comments

Comments
 (0)