@cardano-sdk/e2e 0.17.2-patch.0 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/.env.example +1 -1
  2. package/CHANGELOG.md +29 -2
  3. package/dist/cjs/factories.d.ts.map +1 -1
  4. package/dist/cjs/factories.js +3 -6
  5. package/dist/cjs/factories.js.map +1 -1
  6. package/dist/cjs/tsconfig.tsbuildinfo +1 -1
  7. package/dist/esm/factories.d.ts.map +1 -1
  8. package/dist/esm/factories.js +3 -6
  9. package/dist/esm/factories.js.map +1 -1
  10. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  11. package/docker-compose.yml +8 -0
  12. package/local-network/README.md +1 -1
  13. package/local-network/scripts/cardano-node-ogmios.sh +1 -1
  14. package/local-network/scripts/get-epoch.sh +0 -1
  15. package/local-network/scripts/make-babbage.sh +61 -61
  16. package/local-network/scripts/mint-handles.sh +1 -1
  17. package/local-network/scripts/mint-tokens.sh +0 -1
  18. package/local-network/scripts/mnemonic_keys.sh +7 -7
  19. package/local-network/scripts/nodes-configuration.sh +1 -1
  20. package/local-network/scripts/plutus-transaction.sh +8 -10
  21. package/local-network/scripts/pools/update-node-utils.sh +221 -232
  22. package/local-network/scripts/reference-input-transaction.sh +30 -38
  23. package/local-network/scripts/start.sh +1 -2
  24. package/local-network/templates/babbage/byron-configuration.yaml +9 -14
  25. package/package.json +20 -20
  26. package/src/factories.ts +3 -14
  27. package/test/k6/README.md +3 -4
  28. package/test/long-running/delegation-rewards.test.ts +104 -58
  29. package/test/projection/offline-fork.test.ts +1 -1
  30. package/test/projection/single-tenant-utxo.test.ts +2 -2
  31. package/test/tsconfig.json +1 -0
  32. package/test/web-extension/extension/background/cip30.ts +5 -1
  33. package/test/web-extension/specs/wallet.spec.ts +2 -2
  34. package/test/tsconfig.tsbuildinfo +0 -1
@@ -15,24 +15,23 @@ clean() {
15
15
 
16
16
  getAddressBalance() {
17
17
  cardano-cli query utxo \
18
- --address "$1" \
19
- --testnet-magic 888 > fullUtxo.out
18
+ --address "$1" \
19
+ --testnet-magic 888 >fullUtxo.out
20
20
 
21
- tail -n +3 fullUtxo.out | sort -k3 -nr > balance.out
21
+ tail -n +3 fullUtxo.out | sort -k3 -nr >balance.out
22
22
 
23
23
  total_balance=0
24
24
  while read -r utxo; do
25
- utxo_balance=$(awk '{ print $3 }' <<< "${utxo}")
26
- total_balance=$(("$total_balance"+"$utxo_balance"))
27
- done < balance.out
25
+ utxo_balance=$(awk '{ print $3 }' <<<"${utxo}")
26
+ total_balance=$(("$total_balance" + "$utxo_balance"))
27
+ done <balance.out
28
28
 
29
29
  echo ${total_balance}
30
30
  }
31
31
 
32
32
  trap clean EXIT
33
33
 
34
- updatePool()
35
- {
34
+ updatePool() {
36
35
  # pool parameters
37
36
  SP_NODE_ID="$1"
38
37
  POOL_PLEDGE="$2"
@@ -48,8 +47,7 @@ updatePool()
48
47
  done
49
48
 
50
49
  # Pool metadata hash (only compute it if a metadata url has been given)
51
- if [ -n "$6" ]
52
- then
50
+ if [ -n "$6" ]; then
53
51
  METADATA_URL="$6"
54
52
  METADATA_HASH=$(cardano-cli stake-pool metadata-hash --pool-metadata-file <(curl -s -L -k "${METADATA_URL}"))
55
53
  fi
@@ -67,22 +65,22 @@ updatePool()
67
65
  coldKey=network-files/pools/cold"${SP_NODE_ID}".skey
68
66
  vrfKey=network-files/pools/vrf"${SP_NODE_ID}".vkey
69
67
  delegatorPaymentKey=network-files/stake-delegator-keys/payment"${SP_NODE_ID}".vkey
70
- delegatorStakingKey=network-files/stake-delegator-keys/staking"${SP_NODE_ID}".vkey
68
+ delegatorStakeKey=network-files/stake-delegator-keys/staking"${SP_NODE_ID}".vkey
71
69
  delegatorPaymentSKey=network-files/stake-delegator-keys/payment"${SP_NODE_ID}".skey
72
- delegatorStakingSKey=network-files/stake-delegator-keys/staking"${SP_NODE_ID}".skey
70
+ delegatorStakeSKey=network-files/stake-delegator-keys/staking"${SP_NODE_ID}".skey
73
71
 
74
72
  POOL_ID=$(cardano-cli stake-pool id --cold-verification-key-file "$coldVKey" --output-format "hex")
75
73
 
76
74
  # funding pool owner stake address
77
- stakingAddr=$(cardano-cli address build --payment-verification-key-file "$genesisVKey" --stake-verification-key-file "$stakeVKey" --testnet-magic 888)
78
- currentBalance=$(getAddressBalance "$stakingAddr")
75
+ stakeAddr=$(cardano-cli address build --payment-verification-key-file "$genesisVKey" --stake-verification-key-file "$stakeVKey" --testnet-magic 888)
76
+ currentBalance=$(getAddressBalance "$stakeAddr")
79
77
  utxo=$(cardano-cli query utxo --address "$genesisAddr" --testnet-magic 888 | awk 'NR == 3 {printf("%s#%s", $1, $2)}')
80
78
 
81
79
  cardano-cli transaction build \
82
80
  --babbage-era \
83
81
  --change-address "$genesisAddr" \
84
82
  --tx-in "$utxo" \
85
- --tx-out "$stakingAddr"+"$POOL_OWNER_STAKE" \
83
+ --tx-out "$stakeAddr"+"$POOL_OWNER_STAKE" \
86
84
  --testnet-magic 888 \
87
85
  --out-file wallets-tx.raw 2>&1
88
86
 
@@ -94,65 +92,63 @@ updatePool()
94
92
 
95
93
  cardano-cli transaction submit --testnet-magic 888 --tx-file wallets-tx.signed 2>&1
96
94
 
97
- updatedBalance=$(getAddressBalance "$stakingAddr")
95
+ updatedBalance=$(getAddressBalance "$stakeAddr")
98
96
 
99
- while [ "$currentBalance" -eq "$updatedBalance" ]
100
- do
101
- updatedBalance=$(getAddressBalance "$stakingAddr")
97
+ while [ "$currentBalance" -eq "$updatedBalance" ]; do
98
+ updatedBalance=$(getAddressBalance "$stakeAddr")
102
99
  sleep 1
103
100
  done
104
101
 
105
102
  # register pool owner stake address
106
103
  currentBalance=$(getAddressBalance "$genesisAddr")
107
104
  cardano-cli stake-address registration-certificate \
108
- --stake-verification-key-file "$stakeVKey" \
109
- --out-file pool-owner-registration.cert
105
+ --stake-verification-key-file "$stakeVKey" \
106
+ --out-file pool-owner-registration.cert
110
107
 
111
108
  utxo=$(cardano-cli query utxo --address "$genesisAddr" --testnet-magic 888 | awk 'NR == 3 {printf("%s#%s", $1, $2)}')
112
109
 
113
110
  cardano-cli transaction build-raw \
114
- --tx-in "$utxo" \
115
- --tx-out "$genesisAddr"+0 \
116
- --invalid-hereafter 5000000 \
117
- --fee 0 \
118
- --out-file tx.tmp \
119
- --certificate pool-owner-registration.cert
111
+ --tx-in "$utxo" \
112
+ --tx-out "$genesisAddr"+0 \
113
+ --invalid-hereafter 5000000 \
114
+ --fee 0 \
115
+ --out-file tx.tmp \
116
+ --certificate pool-owner-registration.cert
120
117
 
121
118
  fee=$(cardano-cli transaction calculate-min-fee \
122
- --tx-body-file tx.tmp \
123
- --tx-in-count 1 \
124
- --tx-out-count 1 \
125
- --testnet-magic 888 \
126
- --witness-count 2 \
127
- --byron-witness-count 0 \
128
- --protocol-params-file ./params.json | awk '{ print $1 }')
119
+ --tx-body-file tx.tmp \
120
+ --tx-in-count 1 \
121
+ --tx-out-count 1 \
122
+ --testnet-magic 888 \
123
+ --witness-count 2 \
124
+ --byron-witness-count 0 \
125
+ --protocol-params-file ./params.json | awk '{ print $1 }')
129
126
 
130
127
  initialBalance=$(getAddressBalance "$genesisAddr")
131
128
  txOut=$((initialBalance - fee))
132
129
 
133
130
  cardano-cli transaction build-raw \
134
- --tx-in "$utxo" \
135
- --tx-out "$genesisAddr"+"$txOut" \
136
- --invalid-hereafter 5000000 \
137
- --fee "$fee" \
138
- --certificate pool-owner-registration.cert \
139
- --out-file tx.raw
131
+ --tx-in "$utxo" \
132
+ --tx-out "$genesisAddr"+"$txOut" \
133
+ --invalid-hereafter 5000000 \
134
+ --fee "$fee" \
135
+ --certificate pool-owner-registration.cert \
136
+ --out-file tx.raw
140
137
 
141
138
  cardano-cli transaction sign \
142
- --tx-body-file tx.raw \
143
- --signing-key-file "$genesisSKey" \
144
- --signing-key-file "$stakeKey" \
145
- --testnet-magic 888 \
146
- --out-file tx.signed
139
+ --tx-body-file tx.raw \
140
+ --signing-key-file "$genesisSKey" \
141
+ --signing-key-file "$stakeKey" \
142
+ --testnet-magic 888 \
143
+ --out-file tx.signed
147
144
 
148
145
  cardano-cli transaction submit \
149
- --tx-file tx.signed \
150
- --testnet-magic 888
146
+ --tx-file tx.signed \
147
+ --testnet-magic 888
151
148
 
152
149
  updatedBalance=$(getAddressBalance "$genesisAddr")
153
150
 
154
- while [ "$currentBalance" -eq "$updatedBalance" ]
155
- do
151
+ while [ "$currentBalance" -eq "$updatedBalance" ]; do
156
152
  updatedBalance=$(getAddressBalance "$genesisAddr")
157
153
  sleep 1
158
154
  done
@@ -160,55 +156,54 @@ updatePool()
160
156
  # delegating pool owner stake
161
157
  currentBalance=$(getAddressBalance "$genesisAddr")
162
158
  cardano-cli stake-address delegation-certificate \
163
- --stake-verification-key-file "$stakeVKey" \
164
- --cold-verification-key-file "$coldVKey" \
165
- --out-file pool-owner-delegation.cert
159
+ --stake-verification-key-file "$stakeVKey" \
160
+ --cold-verification-key-file "$coldVKey" \
161
+ --out-file pool-owner-delegation.cert
166
162
 
167
163
  utxo=$(cardano-cli query utxo --address "$genesisAddr" --testnet-magic 888 | awk 'NR == 3 {printf("%s#%s", $1, $2)}')
168
164
 
169
165
  cardano-cli transaction build-raw \
170
- --tx-in "$utxo" \
171
- --tx-out "$genesisAddr"+0 \
172
- --invalid-hereafter 5000000 \
173
- --fee 0 \
174
- --out-file tx.tmp \
175
- --certificate pool-owner-delegation.cert \
166
+ --tx-in "$utxo" \
167
+ --tx-out "$genesisAddr"+0 \
168
+ --invalid-hereafter 5000000 \
169
+ --fee 0 \
170
+ --out-file tx.tmp \
171
+ --certificate pool-owner-delegation.cert
176
172
 
177
173
  fee=$(cardano-cli transaction calculate-min-fee \
178
- --tx-body-file tx.tmp \
179
- --tx-in-count 1 \
180
- --tx-out-count 1 \
181
- --testnet-magic 888 \
182
- --witness-count 2 \
183
- --byron-witness-count 0 \
184
- --protocol-params-file ./params.json | awk '{ print $1 }')
174
+ --tx-body-file tx.tmp \
175
+ --tx-in-count 1 \
176
+ --tx-out-count 1 \
177
+ --testnet-magic 888 \
178
+ --witness-count 2 \
179
+ --byron-witness-count 0 \
180
+ --protocol-params-file ./params.json | awk '{ print $1 }')
185
181
 
186
182
  initialBalance=$(getAddressBalance "$genesisAddr")
187
183
  txOut=$((initialBalance - fee))
188
184
 
189
185
  cardano-cli transaction build-raw \
190
- --tx-in "$utxo" \
191
- --tx-out "$genesisAddr"+"$txOut" \
192
- --invalid-hereafter 5000000 \
193
- --fee "$fee" \
194
- --certificate pool-owner-delegation.cert \
195
- --out-file tx.raw
186
+ --tx-in "$utxo" \
187
+ --tx-out "$genesisAddr"+"$txOut" \
188
+ --invalid-hereafter 5000000 \
189
+ --fee "$fee" \
190
+ --certificate pool-owner-delegation.cert \
191
+ --out-file tx.raw
196
192
 
197
193
  cardano-cli transaction sign \
198
- --tx-body-file tx.raw \
199
- --signing-key-file "$genesisSKey" \
200
- --signing-key-file "$stakeKey" \
201
- --testnet-magic 888 \
202
- --out-file tx.signed
194
+ --tx-body-file tx.raw \
195
+ --signing-key-file "$genesisSKey" \
196
+ --signing-key-file "$stakeKey" \
197
+ --testnet-magic 888 \
198
+ --out-file tx.signed
203
199
 
204
200
  cardano-cli transaction submit \
205
- --tx-file tx.signed \
206
- --testnet-magic 888
201
+ --tx-file tx.signed \
202
+ --testnet-magic 888
207
203
 
208
204
  updatedBalance=$(getAddressBalance "$genesisAddr")
209
205
 
210
- while [ "$currentBalance" -eq "$updatedBalance" ]
211
- do
206
+ while [ "$currentBalance" -eq "$updatedBalance" ]; do
212
207
  updatedBalance=$(getAddressBalance "$genesisAddr")
213
208
  sleep 1
214
209
  done
@@ -216,60 +211,59 @@ updatePool()
216
211
  # register delegator stake address
217
212
  echo "Registering delegator stake certificate ${SP_NODE_ID}..."
218
213
 
219
- paymentAddr=$(cardano-cli address build --payment-verification-key-file "$delegatorPaymentKey" --stake-verification-key-file "$delegatorStakingKey" --testnet-magic 888)
214
+ paymentAddr=$(cardano-cli address build --payment-verification-key-file "$delegatorPaymentKey" --stake-verification-key-file "$delegatorStakeKey" --testnet-magic 888)
220
215
  currentBalance=$(getAddressBalance "$paymentAddr")
221
216
 
222
217
  # create pool delegation certificate
223
218
  cardano-cli stake-address delegation-certificate \
224
- --stake-verification-key-file "$delegatorStakingKey" \
225
- --stake-pool-id "$POOL_ID" \
226
- --out-file deleg.cert
219
+ --stake-verification-key-file "$delegatorStakeKey" \
220
+ --stake-pool-id "$POOL_ID" \
221
+ --out-file deleg.cert
227
222
 
228
223
  utxo=$(cardano-cli query utxo --address "$paymentAddr" --testnet-magic 888 | awk 'NR == 3 {printf("%s#%s", $1, $2)}')
229
224
 
230
225
  cardano-cli transaction build-raw \
231
- --tx-in "$utxo" \
232
- --tx-out "$paymentAddr"+0 \
233
- --invalid-hereafter 5000000 \
234
- --fee 0 \
235
- --out-file tx.tmp \
236
- --certificate deleg.cert
226
+ --tx-in "$utxo" \
227
+ --tx-out "$paymentAddr"+0 \
228
+ --invalid-hereafter 5000000 \
229
+ --fee 0 \
230
+ --out-file tx.tmp \
231
+ --certificate deleg.cert
237
232
 
238
233
  fee=$(cardano-cli transaction calculate-min-fee \
239
- --tx-body-file tx.tmp \
240
- --tx-in-count 1 \
241
- --tx-out-count 1 \
242
- --testnet-magic 888 \
243
- --witness-count 2 \
244
- --byron-witness-count 0 \
245
- --protocol-params-file ./params.json | awk '{ print $1 }')
234
+ --tx-body-file tx.tmp \
235
+ --tx-in-count 1 \
236
+ --tx-out-count 1 \
237
+ --testnet-magic 888 \
238
+ --witness-count 2 \
239
+ --byron-witness-count 0 \
240
+ --protocol-params-file ./params.json | awk '{ print $1 }')
246
241
 
247
242
  initialBalance=$(getAddressBalance "$paymentAddr")
248
243
  txOut=$((initialBalance - fee))
249
244
 
250
245
  cardano-cli transaction build-raw \
251
- --tx-in "$utxo" \
252
- --tx-out "$paymentAddr"+"$txOut" \
253
- --invalid-hereafter 5000000 \
254
- --fee "$fee" \
255
- --certificate-file deleg.cert \
256
- --out-file tx.raw
246
+ --tx-in "$utxo" \
247
+ --tx-out "$paymentAddr"+"$txOut" \
248
+ --invalid-hereafter 5000000 \
249
+ --fee "$fee" \
250
+ --certificate-file deleg.cert \
251
+ --out-file tx.raw
257
252
 
258
253
  cardano-cli transaction sign \
259
- --tx-body-file tx.raw \
260
- --signing-key-file "$delegatorPaymentSKey" \
261
- --signing-key-file "$delegatorStakingSKey" \
262
- --testnet-magic 888 \
263
- --out-file tx.signed
254
+ --tx-body-file tx.raw \
255
+ --signing-key-file "$delegatorPaymentSKey" \
256
+ --signing-key-file "$delegatorStakeSKey" \
257
+ --testnet-magic 888 \
258
+ --out-file tx.signed
264
259
 
265
260
  cardano-cli transaction submit \
266
- --tx-file tx.signed \
267
- --testnet-magic 888
261
+ --tx-file tx.signed \
262
+ --testnet-magic 888
268
263
 
269
264
  updatedBalance=$(getAddressBalance "$paymentAddr")
270
265
 
271
- while [ "$currentBalance" -eq "$updatedBalance" ]
272
- do
266
+ while [ "$currentBalance" -eq "$updatedBalance" ]; do
273
267
  updatedBalance=$(getAddressBalance "$paymentAddr")
274
268
  sleep 1
275
269
  done
@@ -279,83 +273,81 @@ updatePool()
279
273
  currentBalance=$(getAddressBalance "$paymentAddr")
280
274
 
281
275
  # Only add metadata if given.
282
- if [ -n "$6" ]
283
- then
276
+ if [ -n "$6" ]; then
284
277
  cardano-cli stake-pool registration-certificate \
285
- --cold-verification-key-file "$coldVKey" \
286
- --vrf-verification-key-file "$vrfKey" \
287
- --pool-pledge "$POOL_PLEDGE" \
288
- --pool-cost "$POOL_COST" \
289
- --pool-margin "$POOL_MARGIN" \
290
- --pool-reward-account-verification-key-file "$stakeVKey" \
291
- --pool-owner-stake-verification-key-file "$stakeVKey" \
292
- --testnet-magic 888 \
293
- --pool-relay-ipv4 127.0.0.1 \
294
- --pool-relay-port 300"$SP_NODE_ID" \
295
- --metadata-url "${METADATA_URL}" \
296
- --metadata-hash "${METADATA_HASH}" \
297
- --out-file pool.cert
278
+ --cold-verification-key-file "$coldVKey" \
279
+ --vrf-verification-key-file "$vrfKey" \
280
+ --pool-pledge "$POOL_PLEDGE" \
281
+ --pool-cost "$POOL_COST" \
282
+ --pool-margin "$POOL_MARGIN" \
283
+ --pool-reward-account-verification-key-file "$stakeVKey" \
284
+ --pool-owner-stake-verification-key-file "$stakeVKey" \
285
+ --testnet-magic 888 \
286
+ --pool-relay-ipv4 127.0.0.1 \
287
+ --pool-relay-port 300"$SP_NODE_ID" \
288
+ --metadata-url "${METADATA_URL}" \
289
+ --metadata-hash "${METADATA_HASH}" \
290
+ --out-file pool.cert
298
291
  else
299
292
  cardano-cli stake-pool registration-certificate \
300
- --cold-verification-key-file "$coldVKey" \
301
- --vrf-verification-key-file "$vrfKey" \
302
- --pool-pledge "$POOL_PLEDGE" \
303
- --pool-cost "$POOL_COST" \
304
- --pool-margin "$POOL_MARGIN" \
305
- --pool-reward-account-verification-key-file "$stakeVKey" \
306
- --pool-owner-stake-verification-key-file "$stakeVKey" \
307
- --testnet-magic 888 \
308
- --pool-relay-ipv4 127.0.0.1 \
309
- --pool-relay-port 300"$SP_NODE_ID" \
310
- --out-file pool.cert
293
+ --cold-verification-key-file "$coldVKey" \
294
+ --vrf-verification-key-file "$vrfKey" \
295
+ --pool-pledge "$POOL_PLEDGE" \
296
+ --pool-cost "$POOL_COST" \
297
+ --pool-margin "$POOL_MARGIN" \
298
+ --pool-reward-account-verification-key-file "$stakeVKey" \
299
+ --pool-owner-stake-verification-key-file "$stakeVKey" \
300
+ --testnet-magic 888 \
301
+ --pool-relay-ipv4 127.0.0.1 \
302
+ --pool-relay-port 300"$SP_NODE_ID" \
303
+ --out-file pool.cert
311
304
  fi
312
305
 
313
306
  utxo=$(cardano-cli query utxo --address "$paymentAddr" --testnet-magic 888 | awk 'NR == 3 {printf("%s#%s", $1, $2)}')
314
307
 
315
308
  cardano-cli transaction build-raw \
316
- --tx-in "$utxo" \
317
- --tx-out "$paymentAddr"+"$txOut"\
318
- --invalid-hereafter 500000 \
319
- --fee 0 \
320
- --certificate-file pool.cert \
321
- --out-file tx.tmp
309
+ --tx-in "$utxo" \
310
+ --tx-out "$paymentAddr"+"$txOut" \
311
+ --invalid-hereafter 500000 \
312
+ --fee 0 \
313
+ --certificate-file pool.cert \
314
+ --out-file tx.tmp
322
315
 
323
316
  fee=$(cardano-cli transaction calculate-min-fee \
324
- --tx-body-file tx.tmp \
325
- --tx-in-count 1 \
326
- --tx-out-count 1 \
327
- --testnet-magic 888 \
328
- --witness-count 3 \
329
- --byron-witness-count 0 \
330
- --protocol-params-file ./params.json | awk '{ print $1 }')
317
+ --tx-body-file tx.tmp \
318
+ --tx-in-count 1 \
319
+ --tx-out-count 1 \
320
+ --testnet-magic 888 \
321
+ --witness-count 3 \
322
+ --byron-witness-count 0 \
323
+ --protocol-params-file ./params.json | awk '{ print $1 }')
331
324
 
332
325
  initialBalance=$(getAddressBalance "$paymentAddr")
333
326
  txOut=$((initialBalance - fee))
334
327
 
335
328
  cardano-cli transaction build-raw \
336
- --tx-in "$utxo" \
337
- --tx-out "$paymentAddr"+"$txOut"\
338
- --invalid-hereafter 500000 \
339
- --fee "$fee" \
340
- --certificate-file pool.cert \
341
- --out-file tx.raw
329
+ --tx-in "$utxo" \
330
+ --tx-out "$paymentAddr"+"$txOut" \
331
+ --invalid-hereafter 500000 \
332
+ --fee "$fee" \
333
+ --certificate-file pool.cert \
334
+ --out-file tx.raw
342
335
 
343
336
  cardano-cli transaction sign \
344
- --tx-body-file tx.raw \
345
- --signing-key-file "$delegatorPaymentSKey" \
346
- --signing-key-file "$coldKey" \
347
- --signing-key-file "$stakeKey" \
348
- --testnet-magic 888 \
349
- --out-file tx.signed
337
+ --tx-body-file tx.raw \
338
+ --signing-key-file "$delegatorPaymentSKey" \
339
+ --signing-key-file "$coldKey" \
340
+ --signing-key-file "$stakeKey" \
341
+ --testnet-magic 888 \
342
+ --out-file tx.signed
350
343
 
351
344
  cardano-cli transaction submit \
352
- --tx-file tx.signed \
353
- --testnet-magic 888
345
+ --tx-file tx.signed \
346
+ --testnet-magic 888
354
347
 
355
348
  updatedBalance=$(getAddressBalance "$paymentAddr")
356
349
 
357
- while [ "$currentBalance" -eq "$updatedBalance" ]
358
- do
350
+ while [ "$currentBalance" -eq "$updatedBalance" ]; do
359
351
  updatedBalance=$(getAddressBalance "$paymentAddr")
360
352
  sleep 1
361
353
  done
@@ -363,8 +355,7 @@ updatePool()
363
355
  echo "Done!"
364
356
  }
365
357
 
366
- deregisterPool()
367
- {
358
+ deregisterPool() {
368
359
  # pool parameters
369
360
  SP_NODE_ID="$1"
370
361
  RETIRING_EPOCH="$2"
@@ -384,69 +375,68 @@ deregisterPool()
384
375
  coldVKey=network-files/pools/cold"${SP_NODE_ID}".vkey
385
376
  coldKey=network-files/pools/cold"${SP_NODE_ID}".skey
386
377
  delegatorPaymentKey=network-files/stake-delegator-keys/payment"${SP_NODE_ID}".vkey
387
- delegatorStakingKey=network-files/stake-delegator-keys/staking"${SP_NODE_ID}".vkey
378
+ delegatorStakeKey=network-files/stake-delegator-keys/staking"${SP_NODE_ID}".vkey
388
379
  delegatorPaymentSKey=network-files/stake-delegator-keys/payment"${SP_NODE_ID}".skey
389
- delegatorStakingSKey=network-files/stake-delegator-keys/staking"${SP_NODE_ID}".skey
380
+ delegatorStakeSKey=network-files/stake-delegator-keys/staking"${SP_NODE_ID}".skey
390
381
 
391
382
  # We are going to redelegate this stake to dbSync can index it properly.
392
383
  echo "Registering delegator stake certificate ${SP_NODE_ID}..."
393
384
 
394
- paymentAddr=$(cardano-cli address build --payment-verification-key-file "$delegatorPaymentKey" --stake-verification-key-file "$delegatorStakingKey" --testnet-magic 888)
385
+ paymentAddr=$(cardano-cli address build --payment-verification-key-file "$delegatorPaymentKey" --stake-verification-key-file "$delegatorStakeKey" --testnet-magic 888)
395
386
  currentBalance=$(getAddressBalance "$paymentAddr")
396
387
 
397
388
  POOL_ID=$(cardano-cli stake-pool id --cold-verification-key-file "$coldVKey" --output-format "hex")
398
389
 
399
390
  # create pool delegation certificate
400
391
  cardano-cli stake-address delegation-certificate \
401
- --stake-verification-key-file "$delegatorStakingKey" \
402
- --stake-pool-id "$POOL_ID" \
403
- --out-file deleg.cert
392
+ --stake-verification-key-file "$delegatorStakeKey" \
393
+ --stake-pool-id "$POOL_ID" \
394
+ --out-file deleg.cert
404
395
 
405
396
  utxo=$(cardano-cli query utxo --address "$paymentAddr" --testnet-magic 888 | awk 'NR == 3 {printf("%s#%s", $1, $2)}')
406
397
 
407
398
  cardano-cli transaction build-raw \
408
- --tx-in "$utxo" \
409
- --tx-out "$paymentAddr"+0 \
410
- --invalid-hereafter 5000000 \
411
- --fee 0 \
412
- --out-file tx.tmp \
413
- --certificate deleg.cert
399
+ --tx-in "$utxo" \
400
+ --tx-out "$paymentAddr"+0 \
401
+ --invalid-hereafter 5000000 \
402
+ --fee 0 \
403
+ --out-file tx.tmp \
404
+ --certificate deleg.cert
414
405
 
415
406
  fee=$(cardano-cli transaction calculate-min-fee \
416
- --tx-body-file tx.tmp \
417
- --tx-in-count 1 \
418
- --tx-out-count 1 \
419
- --testnet-magic 888 \
420
- --witness-count 2 \
421
- --byron-witness-count 0 \
422
- --protocol-params-file ./params.json | awk '{ print $1 }')
407
+ --tx-body-file tx.tmp \
408
+ --tx-in-count 1 \
409
+ --tx-out-count 1 \
410
+ --testnet-magic 888 \
411
+ --witness-count 2 \
412
+ --byron-witness-count 0 \
413
+ --protocol-params-file ./params.json | awk '{ print $1 }')
423
414
 
424
415
  initialBalance=$(getAddressBalance "$paymentAddr")
425
416
  txOut=$((initialBalance - fee))
426
417
 
427
418
  cardano-cli transaction build-raw \
428
- --tx-in "$utxo" \
429
- --tx-out "$paymentAddr"+"$txOut" \
430
- --invalid-hereafter 5000000 \
431
- --fee "$fee" \
432
- --certificate-file deleg.cert \
433
- --out-file tx.raw
419
+ --tx-in "$utxo" \
420
+ --tx-out "$paymentAddr"+"$txOut" \
421
+ --invalid-hereafter 5000000 \
422
+ --fee "$fee" \
423
+ --certificate-file deleg.cert \
424
+ --out-file tx.raw
434
425
 
435
426
  cardano-cli transaction sign \
436
- --tx-body-file tx.raw \
437
- --signing-key-file "$delegatorPaymentSKey" \
438
- --signing-key-file "$delegatorStakingSKey" \
439
- --testnet-magic 888 \
440
- --out-file tx.signed
427
+ --tx-body-file tx.raw \
428
+ --signing-key-file "$delegatorPaymentSKey" \
429
+ --signing-key-file "$delegatorStakeSKey" \
430
+ --testnet-magic 888 \
431
+ --out-file tx.signed
441
432
 
442
433
  cardano-cli transaction submit \
443
- --tx-file tx.signed \
444
- --testnet-magic 888
434
+ --tx-file tx.signed \
435
+ --testnet-magic 888
445
436
 
446
437
  updatedBalance=$(getAddressBalance "$paymentAddr")
447
438
 
448
- while [ "$currentBalance" -eq "$updatedBalance" ]
449
- do
439
+ while [ "$currentBalance" -eq "$updatedBalance" ]; do
450
440
  updatedBalance=$(getAddressBalance "$paymentAddr")
451
441
  sleep 1
452
442
  done
@@ -463,49 +453,48 @@ deregisterPool()
463
453
  utxo=$(cardano-cli query utxo --address "$genesisAddr" --testnet-magic 888 | awk 'NR == 3 {printf("%s#%s", $1, $2)}')
464
454
 
465
455
  cardano-cli transaction build-raw \
466
- --tx-in "$utxo" \
467
- --tx-out "$genesisAddr"+0 \
468
- --invalid-hereafter 500000 \
469
- --fee 0 \
470
- --certificate-file pool.dereg \
471
- --out-file tx.tmp
456
+ --tx-in "$utxo" \
457
+ --tx-out "$genesisAddr"+0 \
458
+ --invalid-hereafter 500000 \
459
+ --fee 0 \
460
+ --certificate-file pool.dereg \
461
+ --out-file tx.tmp
472
462
 
473
463
  fee=$(cardano-cli transaction calculate-min-fee \
474
- --tx-body-file tx.tmp \
475
- --tx-in-count 1 \
476
- --tx-out-count 1 \
477
- --testnet-magic 888 \
478
- --witness-count 3 \
479
- --byron-witness-count 0 \
480
- --protocol-params-file ./params.json | awk '{ print $1 }')
464
+ --tx-body-file tx.tmp \
465
+ --tx-in-count 1 \
466
+ --tx-out-count 1 \
467
+ --testnet-magic 888 \
468
+ --witness-count 3 \
469
+ --byron-witness-count 0 \
470
+ --protocol-params-file ./params.json | awk '{ print $1 }')
481
471
 
482
472
  initialBalance=$(getAddressBalance "$genesisAddr")
483
473
  txOut=$((initialBalance - fee))
484
474
 
485
475
  cardano-cli transaction build-raw \
486
- --tx-in "$utxo" \
487
- --tx-out "$genesisAddr"+"$txOut"\
488
- --invalid-hereafter 500000 \
489
- --fee "$fee" \
490
- --certificate-file pool.dereg \
491
- --out-file tx.raw
476
+ --tx-in "$utxo" \
477
+ --tx-out "$genesisAddr"+"$txOut" \
478
+ --invalid-hereafter 500000 \
479
+ --fee "$fee" \
480
+ --certificate-file pool.dereg \
481
+ --out-file tx.raw
492
482
 
493
483
  cardano-cli transaction sign \
494
- --tx-body-file tx.raw \
495
- --signing-key-file "$genesisSKey" \
496
- --signing-key-file "$coldKey" \
497
- --signing-key-file "$stakeKey" \
498
- --testnet-magic 888 \
499
- --out-file tx.signed
484
+ --tx-body-file tx.raw \
485
+ --signing-key-file "$genesisSKey" \
486
+ --signing-key-file "$coldKey" \
487
+ --signing-key-file "$stakeKey" \
488
+ --testnet-magic 888 \
489
+ --out-file tx.signed
500
490
 
501
491
  cardano-cli transaction submit \
502
- --tx-file tx.signed \
503
- --testnet-magic 888
492
+ --tx-file tx.signed \
493
+ --testnet-magic 888
504
494
 
505
495
  updatedBalance=$(getAddressBalance "$genesisAddr")
506
496
 
507
- while [ "$currentBalance" -eq "$updatedBalance" ]
508
- do
497
+ while [ "$currentBalance" -eq "$updatedBalance" ]; do
509
498
  updatedBalance=$(getAddressBalance "$genesisAddr")
510
499
  sleep 1
511
500
  done