|
2 | 2 | "version": "2.0.0", |
3 | 3 | "tasks": [ |
4 | 4 | { |
5 | | - "label": "package chaincode", |
| 5 | + "label": "chaincode lifecycle - 1. package", |
6 | 6 | "type": "shell", |
7 | 7 | "command": "./lib/btp-chaincode-lifecycle/chaincode.sh package", |
8 | 8 | "group": { |
|
12 | 12 | "problemMatcher": [] |
13 | 13 | }, |
14 | 14 | { |
15 | | - "label": "deploy chaincode", |
| 15 | + "label": "chaincode lifecycle - 2. deploy", |
16 | 16 | "type": "shell", |
17 | | - "command": "./lib/btp-chaincode-lifecycle/chaincode.sh install", |
| 17 | + "command": "./lib/btp-chaincode-lifecycle/chaincode.sh install ${input:select-peer}", |
18 | 18 | "problemMatcher": [] |
19 | 19 | }, |
20 | 20 | { |
21 | | - "label": "approve chaincode", |
| 21 | + "label": "chaincode lifecycle - 3. approve", |
22 | 22 | "type": "shell", |
23 | | - "command": "./lib/btp-chaincode-lifecycle/chaincode.sh approve", |
| 23 | + "command": "./lib/btp-chaincode-lifecycle/chaincode.sh approve ${input:select-peer}", |
24 | 24 | "problemMatcher": [] |
25 | 25 | }, |
26 | 26 | { |
27 | | - "label": "commit chaincode", |
| 27 | + "label": "chaincode lifecycle - 4. check commit readiness", |
28 | 28 | "type": "shell", |
29 | | - "command": "./lib/btp-chaincode-lifecycle/chaincode.sh commit", |
| 29 | + "command": "./lib/btp-chaincode-lifecycle/chaincode.sh commit-readiness ${input:select-peer}", |
30 | 30 | "problemMatcher": [] |
31 | 31 | }, |
32 | 32 | { |
33 | | - "label": "init chaincode", |
| 33 | + "label": "chaincode lifecycle - 5. commit", |
34 | 34 | "type": "shell", |
35 | | - "command": "./lib/btp-chaincode-lifecycle/chaincode.sh init", |
| 35 | + "command": "./lib/btp-chaincode-lifecycle/chaincode.sh commit ${input:select-peer}", |
36 | 36 | "problemMatcher": [] |
37 | 37 | }, |
38 | 38 | { |
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", |
40 | 76 | "type": "shell", |
41 | 77 | "command": "./lib/btp-chaincode-lifecycle/chaincode.sh peers", |
42 | 78 | "problemMatcher": [] |
43 | 79 | }, |
44 | 80 | { |
45 | | - "label": "list orderers", |
| 81 | + "label": "list - orderers", |
46 | 82 | "type": "shell", |
47 | 83 | "command": "./lib/btp-chaincode-lifecycle/chaincode.sh orderers", |
48 | 84 | "problemMatcher": [] |
49 | 85 | }, |
50 | 86 | { |
51 | | - "label": "list nodes", |
| 87 | + "label": "list - nodes", |
52 | 88 | "type": "shell", |
53 | 89 | "command": "./lib/btp-chaincode-lifecycle/chaincode.sh nodes", |
54 | 90 | "problemMatcher": [] |
55 | 91 | }, |
56 | 92 | { |
57 | | - "label": "list channels", |
| 93 | + "label": "list - channels", |
58 | 94 | "type": "shell", |
59 | 95 | "command": "./lib/btp-chaincode-lifecycle/chaincode.sh channels", |
60 | 96 | "problemMatcher": [] |
61 | 97 | }, |
| 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 | + }, |
62 | 128 | { |
63 | 129 | "label": "help", |
64 | 130 | "type": "shell", |
65 | 131 | "command": "./lib/btp-chaincode-lifecycle/chaincode.sh help", |
66 | 132 | "problemMatcher": [] |
67 | 133 | } |
68 | 134 | ], |
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 | + ] |
70 | 204 | } |
0 commit comments