Skip to content

Commit 07da185

Browse files
committed
feat: input orderer, peer and token for tasks
1 parent 8a2157c commit 07da185

File tree

1 file changed

+112
-27
lines changed

1 file changed

+112
-27
lines changed

.vscode/tasks.json

Lines changed: 112 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,130 +9,215 @@
99
"kind": "build",
1010
"isDefault": true
1111
},
12-
"problemMatcher": []
12+
"options": {
13+
"env": {
14+
"BTP_SERVICE_TOKEN": "${input:enter-access-token}"
15+
}
16+
}
1317
},
1418
{
1519
"label": "chaincode lifecycle - 2. deploy",
1620
"type": "shell",
1721
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh install ${input:select-peer}",
18-
"problemMatcher": []
22+
"options": {
23+
"env": {
24+
"BTP_SERVICE_TOKEN": "${input:enter-access-token}"
25+
}
26+
}
1927
},
2028
{
2129
"label": "chaincode lifecycle - 3. approve",
2230
"type": "shell",
23-
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh approve ${input:select-peer}",
24-
"problemMatcher": []
31+
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh approve ${input:select-peer} ${input:select-orderer}",
32+
"options": {
33+
"env": {
34+
"BTP_SERVICE_TOKEN": "${input:enter-access-token}"
35+
}
36+
}
2537
},
2638
{
2739
"label": "chaincode lifecycle - 4. check commit readiness",
2840
"type": "shell",
2941
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh commit-readiness ${input:select-peer}",
30-
"problemMatcher": []
42+
"options": {
43+
"env": {
44+
"BTP_SERVICE_TOKEN": "${input:enter-access-token}"
45+
}
46+
}
3147
},
3248
{
3349
"label": "chaincode lifecycle - 5. commit",
3450
"type": "shell",
35-
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh commit ${input:select-peer}",
36-
"problemMatcher": []
51+
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh commit ${input:select-peer} ${input:select-orderer}",
52+
"options": {
53+
"env": {
54+
"BTP_SERVICE_TOKEN": "${input:enter-access-token}"
55+
}
56+
}
3757
},
3858
{
3959
"label": "chaincode lifecycle - 6. init",
4060
"type": "shell",
41-
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh init ${input:select-peer}",
42-
"problemMatcher": []
61+
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh init ${input:select-peer} ${input:select-orderer}",
62+
"options": {
63+
"env": {
64+
"BTP_SERVICE_TOKEN": "${input:enter-access-token}"
65+
}
66+
}
4367
},
4468
{
4569
"label": "chaincode - query",
4670
"type": "shell",
4771
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh query ${input:select-peer} ${input:select-function-name} --arguments '[${input:select-function-args}]'",
48-
"problemMatcher": []
72+
"options": {
73+
"env": {
74+
"BTP_SERVICE_TOKEN": "${input:enter-access-token}"
75+
}
76+
}
4977
},
5078
{
5179
"label": "chaincode - invoke",
5280
"type": "shell",
53-
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh invoke ${input:select-peer} ${input:select-function-name} --arguments '[${input:select-function-args}]'",
54-
"problemMatcher": []
81+
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh invoke ${input:select-peer} ${input:select-orderer} ${input:select-function-name} --arguments '[${input:select-function-args}]'",
82+
"options": {
83+
"env": {
84+
"BTP_SERVICE_TOKEN": "${input:enter-access-token}"
85+
}
86+
}
5587
},
5688
{
5789
"label": "list - deployed chaincode",
5890
"type": "shell",
5991
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh installed ${input:select-peer}",
60-
"problemMatcher": []
92+
"options": {
93+
"env": {
94+
"BTP_SERVICE_TOKEN": "${input:enter-access-token}"
95+
}
96+
}
6197
},
6298
{
6399
"label": "list - approved chaincode",
64100
"type": "shell",
65101
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh approved ${input:select-peer}",
66-
"problemMatcher": []
102+
"options": {
103+
"env": {
104+
"BTP_SERVICE_TOKEN": "${input:enter-access-token}"
105+
}
106+
}
67107
},
68108
{
69109
"label": "list - committed chaincode",
70110
"type": "shell",
71111
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh committed ${input:select-peer}",
72-
"problemMatcher": []
112+
"options": {
113+
"env": {
114+
"BTP_SERVICE_TOKEN": "${input:enter-access-token}"
115+
}
116+
}
73117
},
74118
{
75119
"label": "list - peers",
76120
"type": "shell",
77121
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh peers",
78-
"problemMatcher": []
122+
"options": {
123+
"env": {
124+
"BTP_SERVICE_TOKEN": "${input:enter-access-token}"
125+
}
126+
}
79127
},
80128
{
81129
"label": "list - orderers",
82130
"type": "shell",
83131
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh orderers",
84-
"problemMatcher": []
132+
"options": {
133+
"env": {
134+
"BTP_SERVICE_TOKEN": "${input:enter-access-token}"
135+
}
136+
}
85137
},
86138
{
87139
"label": "list - nodes",
88140
"type": "shell",
89141
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh nodes",
90-
"problemMatcher": []
142+
"options": {
143+
"env": {
144+
"BTP_SERVICE_TOKEN": "${input:enter-access-token}"
145+
}
146+
}
91147
},
92148
{
93149
"label": "list - channels",
94150
"type": "shell",
95-
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh channels",
96-
"problemMatcher": []
151+
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh channels ${input:select-orderer}",
152+
"options": {
153+
"env": {
154+
"BTP_SERVICE_TOKEN": "${input:enter-access-token}"
155+
}
156+
}
97157
},
98158
{
99159
"label": "channel - create",
100160
"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": []
161+
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh create-channel ${input:select-orderer} \"${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}",
162+
"options": {
163+
"env": {
164+
"BTP_SERVICE_TOKEN": "${input:enter-access-token}"
165+
}
166+
}
103167
},
104168
{
105169
"label": "channel - orderer join",
106170
"type": "shell",
107171
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh orderer-join-channel ${input:select-orderer} ${input:select-channel}",
108-
"problemMatcher": []
172+
"options": {
173+
"env": {
174+
"BTP_SERVICE_TOKEN": "${input:enter-access-token}"
175+
}
176+
}
109177
},
110178
{
111179
"label": "channel - orderer leave",
112180
"type": "shell",
113181
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh orderer-leave-channel ${input:select-orderer} ${input:select-channel}",
114-
"problemMatcher": []
182+
"options": {
183+
"env": {
184+
"BTP_SERVICE_TOKEN": "${input:enter-access-token}"
185+
}
186+
}
115187
},
116188
{
117189
"label": "channel - peer join",
118190
"type": "shell",
119191
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh peer-join-channel ${input:select-peer} ${input:select-channel}",
120-
"problemMatcher": []
192+
"options": {
193+
"env": {
194+
"BTP_SERVICE_TOKEN": "${input:enter-access-token}"
195+
}
196+
}
121197
},
122198
{
123199
"label": "channel - peer leave",
124200
"type": "shell",
125201
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh peer-leave-channel ${input:select-peer} ${input:select-channel}",
126-
"problemMatcher": []
202+
"options": {
203+
"env": {
204+
"BTP_SERVICE_TOKEN": "${input:enter-access-token}"
205+
}
206+
}
127207
},
128208
{
129209
"label": "help",
130210
"type": "shell",
131211
"command": "./lib/btp-chaincode-lifecycle/chaincode.sh help",
132-
"problemMatcher": []
133212
}
134213
],
135214
"inputs": [
215+
{
216+
"id": "enter-access-token",
217+
"description": "Enter your access token (application access token scoped atleast to a peer and orderer node, or a personal access token)",
218+
"type": "promptString",
219+
"password": true
220+
},
136221
{
137222
"id": "select-peer",
138223
"description": "Which peer do you want to use?",

0 commit comments

Comments
 (0)