@cardano-sdk/e2e 0.45.0 → 0.45.2
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.
- package/.env.example +12 -13
- package/CHANGELOG.md +8 -0
- package/dist/cjs/factories.d.ts.map +1 -1
- package/dist/cjs/factories.js +8 -0
- package/dist/cjs/factories.js.map +1 -1
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/factories.d.ts.map +1 -1
- package/dist/esm/factories.js +9 -1
- package/dist/esm/factories.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/docker-compose.yml +0 -1
- package/local-network/Dockerfile +2 -2
- package/local-network/scripts/clean.sh +2 -0
- package/local-network/scripts/make-babbage.sh +4 -20
- package/local-network/scripts/mint-handles.sh +9 -7
- package/local-network/scripts/mint-tokens.sh +4 -4
- package/local-network/scripts/plutus-transaction.sh +6 -6
- package/local-network/scripts/pools/update-node-utils.sh +72 -72
- package/local-network/scripts/reference-input-transaction.sh +21 -21
- package/local-network/scripts/setup-new-delegator-keys.sh +99 -34
- package/local-network/scripts/setup-wallets.sh +3 -3
- package/local-network/scripts/start.sh +2 -1
- package/local-network/templates/babbage/db-sync-config.json +5 -1
- package/package.json +20 -20
- package/src/factories.ts +16 -0
- package/test/blockfrost/getAsset.test.ts +13 -3
- package/test/blockfrost-providers/networkInfo.test.ts +1 -1
- package/test/wallet_epoch_0/PersonalWallet/nft.test.ts +29 -72
|
@@ -18,7 +18,7 @@ clean() {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
getAddressBalance() {
|
|
21
|
-
cardano-cli
|
|
21
|
+
cardano-cli query utxo \
|
|
22
22
|
--address "$1" \
|
|
23
23
|
--testnet-magic 888 > ${SP_NODE_ID}/fullUtxo.out
|
|
24
24
|
|
|
@@ -53,15 +53,15 @@ updatePool() {
|
|
|
53
53
|
# Pool metadata hash (only compute it if a metadata url has been given)
|
|
54
54
|
if [ -n "$6" ]; then
|
|
55
55
|
METADATA_URL="$6"
|
|
56
|
-
METADATA_HASH=$(cardano-cli
|
|
56
|
+
METADATA_HASH=$(cardano-cli latest stake-pool metadata-hash --pool-metadata-file <(curl -s -L -k "${METADATA_URL}"))
|
|
57
57
|
fi
|
|
58
58
|
|
|
59
59
|
# get the protocol parameters
|
|
60
|
-
cardano-cli
|
|
60
|
+
cardano-cli latest query protocol-parameters --testnet-magic 888 --out-file ${SP_NODE_ID}/params.json
|
|
61
61
|
|
|
62
62
|
genesisVKey=network-files/utxo-keys/utxo${SP_NODE_ID}.vkey
|
|
63
63
|
genesisSKey=network-files/utxo-keys/utxo${SP_NODE_ID}.skey
|
|
64
|
-
genesisAddr=$(cardano-cli
|
|
64
|
+
genesisAddr=$(cardano-cli latest address build --payment-verification-key-file "$genesisVKey" --testnet-magic 888)
|
|
65
65
|
|
|
66
66
|
stakeVKey=network-files/pools/staking-reward"${SP_NODE_ID}".vkey
|
|
67
67
|
stakeKey=network-files/pools/staking-reward"${SP_NODE_ID}".skey
|
|
@@ -75,27 +75,27 @@ updatePool() {
|
|
|
75
75
|
|
|
76
76
|
keyDeposit=2000000
|
|
77
77
|
|
|
78
|
-
POOL_ID=$(cardano-cli
|
|
78
|
+
POOL_ID=$(cardano-cli latest stake-pool id --cold-verification-key-file "$coldVKey" --output-format "hex")
|
|
79
79
|
|
|
80
80
|
# funding pool owner stake address
|
|
81
|
-
stakeAddr=$(cardano-cli
|
|
81
|
+
stakeAddr=$(cardano-cli latest address build --payment-verification-key-file "$genesisVKey" --stake-verification-key-file "$stakeVKey" --testnet-magic 888)
|
|
82
82
|
currentBalance=$(getAddressBalance "$stakeAddr")
|
|
83
|
-
utxo=$(cardano-cli
|
|
83
|
+
utxo=$(cardano-cli query utxo --address "$genesisAddr" --testnet-magic 888 | awk 'NR == 3 {printf("%s#%s", $1, $2)}')
|
|
84
84
|
|
|
85
|
-
cardano-cli
|
|
85
|
+
cardano-cli latest transaction build \
|
|
86
86
|
--change-address "$genesisAddr" \
|
|
87
87
|
--tx-in "$utxo" \
|
|
88
88
|
--tx-out "$stakeAddr"+"$POOL_OWNER_STAKE" \
|
|
89
89
|
--testnet-magic 888 \
|
|
90
90
|
--out-file ${SP_NODE_ID}/wallets-tx.raw 2>&1
|
|
91
91
|
|
|
92
|
-
cardano-cli
|
|
92
|
+
cardano-cli latest transaction sign \
|
|
93
93
|
--tx-body-file ${SP_NODE_ID}/wallets-tx.raw \
|
|
94
94
|
--signing-key-file "$genesisSKey" \
|
|
95
95
|
--testnet-magic 888 \
|
|
96
96
|
--out-file ${SP_NODE_ID}/wallets-tx.signed 2>&1
|
|
97
97
|
|
|
98
|
-
cardano-cli
|
|
98
|
+
cardano-cli latest transaction submit --testnet-magic 888 --tx-file ${SP_NODE_ID}/wallets-tx.signed 2>&1
|
|
99
99
|
|
|
100
100
|
updatedBalance=$(getAddressBalance "$stakeAddr")
|
|
101
101
|
|
|
@@ -106,14 +106,14 @@ updatePool() {
|
|
|
106
106
|
|
|
107
107
|
# register pool owner stake address
|
|
108
108
|
currentBalance=$(getAddressBalance "$genesisAddr")
|
|
109
|
-
cardano-cli
|
|
109
|
+
cardano-cli latest stake-address registration-certificate \
|
|
110
110
|
--key-reg-deposit-amt ${keyDeposit} \
|
|
111
111
|
--stake-verification-key-file "$stakeVKey" \
|
|
112
112
|
--out-file ${SP_NODE_ID}/pool-owner-registration.cert
|
|
113
113
|
|
|
114
|
-
utxo=$(cardano-cli
|
|
114
|
+
utxo=$(cardano-cli query utxo --address "$genesisAddr" --testnet-magic 888 | awk 'NR == 3 {printf("%s#%s", $1, $2)}')
|
|
115
115
|
|
|
116
|
-
cardano-cli
|
|
116
|
+
cardano-cli latest transaction build-raw \
|
|
117
117
|
--tx-in "$utxo" \
|
|
118
118
|
--tx-out "$genesisAddr"+0 \
|
|
119
119
|
--invalid-hereafter 5000000 \
|
|
@@ -121,16 +121,16 @@ updatePool() {
|
|
|
121
121
|
--out-file ${SP_NODE_ID}/tx.raw \
|
|
122
122
|
--certificate ${SP_NODE_ID}/pool-owner-registration.cert
|
|
123
123
|
|
|
124
|
-
refScriptSize=$(cardano-cli
|
|
124
|
+
refScriptSize=$(cardano-cli latest query ref-script-size \
|
|
125
125
|
--tx-in "$utxo" \
|
|
126
126
|
--testnet-magic 888 \
|
|
127
127
|
--output-json | jq '.refInputScriptSize')
|
|
128
128
|
|
|
129
129
|
# Upon applying the fee, the tx size could increase, rendering the fee insuficient
|
|
130
|
-
# Calculate it twice, once with fee 0, then with the calculated fee, to minimise the
|
|
130
|
+
# Calculate it twice, once with fee 0, then with the calculated fee, to minimise the
|
|
131
131
|
# chance that the tx size increases the second time
|
|
132
132
|
for i in {1..2}; do
|
|
133
|
-
fee=$(cardano-cli
|
|
133
|
+
fee=$(cardano-cli latest transaction calculate-min-fee \
|
|
134
134
|
--reference-script-size $refScriptSize \
|
|
135
135
|
--tx-body-file ${SP_NODE_ID}/tx.raw \
|
|
136
136
|
--tx-in-count 1 \
|
|
@@ -143,7 +143,7 @@ updatePool() {
|
|
|
143
143
|
initialBalance=$(getAddressBalance "$genesisAddr")
|
|
144
144
|
txOut=$((initialBalance - fee - keyDeposit))
|
|
145
145
|
|
|
146
|
-
cardano-cli
|
|
146
|
+
cardano-cli latest transaction build-raw \
|
|
147
147
|
--tx-in "$utxo" \
|
|
148
148
|
--tx-out "$genesisAddr"+"$txOut" \
|
|
149
149
|
--invalid-hereafter 5000000 \
|
|
@@ -152,14 +152,14 @@ updatePool() {
|
|
|
152
152
|
--out-file ${SP_NODE_ID}/tx.raw
|
|
153
153
|
done
|
|
154
154
|
|
|
155
|
-
cardano-cli
|
|
155
|
+
cardano-cli latest transaction sign \
|
|
156
156
|
--tx-body-file ${SP_NODE_ID}/tx.raw \
|
|
157
157
|
--signing-key-file "$genesisSKey" \
|
|
158
158
|
--signing-key-file "$stakeKey" \
|
|
159
159
|
--testnet-magic 888 \
|
|
160
160
|
--out-file ${SP_NODE_ID}/tx.signed
|
|
161
161
|
|
|
162
|
-
cardano-cli
|
|
162
|
+
cardano-cli latest transaction submit \
|
|
163
163
|
--tx-file ${SP_NODE_ID}/tx.signed \
|
|
164
164
|
--testnet-magic 888
|
|
165
165
|
|
|
@@ -172,14 +172,14 @@ updatePool() {
|
|
|
172
172
|
|
|
173
173
|
# delegating pool owner stake
|
|
174
174
|
currentBalance=$(getAddressBalance "$genesisAddr")
|
|
175
|
-
cardano-cli
|
|
175
|
+
cardano-cli latest stake-address stake-delegation-certificate \
|
|
176
176
|
--stake-verification-key-file "$stakeVKey" \
|
|
177
177
|
--cold-verification-key-file "$coldVKey" \
|
|
178
178
|
--out-file ${SP_NODE_ID}/pool-owner-delegation.cert
|
|
179
179
|
|
|
180
|
-
utxo=$(cardano-cli
|
|
180
|
+
utxo=$(cardano-cli query utxo --address "$genesisAddr" --testnet-magic 888 | awk 'NR == 3 {printf("%s#%s", $1, $2)}')
|
|
181
181
|
|
|
182
|
-
cardano-cli
|
|
182
|
+
cardano-cli latest transaction build-raw \
|
|
183
183
|
--tx-in "$utxo" \
|
|
184
184
|
--tx-out "$genesisAddr"+0 \
|
|
185
185
|
--invalid-hereafter 5000000 \
|
|
@@ -187,16 +187,16 @@ updatePool() {
|
|
|
187
187
|
--out-file ${SP_NODE_ID}/tx.raw \
|
|
188
188
|
--certificate ${SP_NODE_ID}/pool-owner-delegation.cert
|
|
189
189
|
|
|
190
|
-
refScriptSize=$(cardano-cli
|
|
190
|
+
refScriptSize=$(cardano-cli latest query ref-script-size \
|
|
191
191
|
--tx-in "$utxo" \
|
|
192
192
|
--testnet-magic 888 \
|
|
193
193
|
--output-json | jq '.refInputScriptSize')
|
|
194
|
-
|
|
194
|
+
|
|
195
195
|
# Upon applying the fee, the tx size could increase, rendering the fee insuficient
|
|
196
|
-
# Calculate it twice, once with fee 0, then with the calculated fee, to minimise the
|
|
196
|
+
# Calculate it twice, once with fee 0, then with the calculated fee, to minimise the
|
|
197
197
|
# chance that the tx size increases the second time
|
|
198
198
|
for i in {1..2}; do
|
|
199
|
-
fee=$(cardano-cli
|
|
199
|
+
fee=$(cardano-cli latest transaction calculate-min-fee \
|
|
200
200
|
--reference-script-size $refScriptSize \
|
|
201
201
|
--tx-body-file ${SP_NODE_ID}/tx.raw \
|
|
202
202
|
--tx-in-count 1 \
|
|
@@ -209,7 +209,7 @@ updatePool() {
|
|
|
209
209
|
initialBalance=$(getAddressBalance "$genesisAddr")
|
|
210
210
|
txOut=$((initialBalance - fee))
|
|
211
211
|
|
|
212
|
-
cardano-cli
|
|
212
|
+
cardano-cli latest transaction build-raw \
|
|
213
213
|
--tx-in "$utxo" \
|
|
214
214
|
--tx-out "$genesisAddr"+"$txOut" \
|
|
215
215
|
--invalid-hereafter 5000000 \
|
|
@@ -218,14 +218,14 @@ updatePool() {
|
|
|
218
218
|
--out-file ${SP_NODE_ID}/tx.raw
|
|
219
219
|
done
|
|
220
220
|
|
|
221
|
-
cardano-cli
|
|
221
|
+
cardano-cli latest transaction sign \
|
|
222
222
|
--tx-body-file ${SP_NODE_ID}/tx.raw \
|
|
223
223
|
--signing-key-file "$genesisSKey" \
|
|
224
224
|
--signing-key-file "$stakeKey" \
|
|
225
225
|
--testnet-magic 888 \
|
|
226
226
|
--out-file ${SP_NODE_ID}/tx.signed
|
|
227
227
|
|
|
228
|
-
cardano-cli
|
|
228
|
+
cardano-cli latest transaction submit \
|
|
229
229
|
--tx-file ${SP_NODE_ID}/tx.signed \
|
|
230
230
|
--testnet-magic 888
|
|
231
231
|
|
|
@@ -239,18 +239,18 @@ updatePool() {
|
|
|
239
239
|
# register delegator stake address
|
|
240
240
|
echo "Registering delegator stake certificate ${SP_NODE_ID}..."
|
|
241
241
|
|
|
242
|
-
paymentAddr=$(cardano-cli
|
|
242
|
+
paymentAddr=$(cardano-cli latest address build --payment-verification-key-file "$delegatorPaymentKey" --stake-verification-key-file "$delegatorStakeKey" --testnet-magic 888)
|
|
243
243
|
currentBalance=$(getAddressBalance "$paymentAddr")
|
|
244
244
|
|
|
245
245
|
# create pool delegation certificate
|
|
246
|
-
cardano-cli
|
|
246
|
+
cardano-cli latest stake-address stake-delegation-certificate \
|
|
247
247
|
--stake-verification-key-file "$delegatorStakeKey" \
|
|
248
248
|
--stake-pool-id "$POOL_ID" \
|
|
249
249
|
--out-file ${SP_NODE_ID}/deleg.cert
|
|
250
250
|
|
|
251
|
-
utxo=$(cardano-cli
|
|
251
|
+
utxo=$(cardano-cli query utxo --address "$paymentAddr" --testnet-magic 888 | awk 'NR == 3 {printf("%s#%s", $1, $2)}')
|
|
252
252
|
|
|
253
|
-
cardano-cli
|
|
253
|
+
cardano-cli latest transaction build-raw \
|
|
254
254
|
--tx-in "$utxo" \
|
|
255
255
|
--tx-out "$paymentAddr"+0 \
|
|
256
256
|
--invalid-hereafter 5000000 \
|
|
@@ -258,16 +258,16 @@ updatePool() {
|
|
|
258
258
|
--out-file ${SP_NODE_ID}/tx.raw \
|
|
259
259
|
--certificate ${SP_NODE_ID}/deleg.cert
|
|
260
260
|
|
|
261
|
-
refScriptSize=$(cardano-cli
|
|
261
|
+
refScriptSize=$(cardano-cli latest query ref-script-size \
|
|
262
262
|
--tx-in "$utxo" \
|
|
263
263
|
--testnet-magic 888 \
|
|
264
264
|
--output-json | jq '.refInputScriptSize')
|
|
265
265
|
|
|
266
266
|
# Upon applying the fee, the tx size could increase, rendering the fee insuficient
|
|
267
|
-
# Calculate it twice, once with fee 0, then with the calculated fee, to minimise the
|
|
267
|
+
# Calculate it twice, once with fee 0, then with the calculated fee, to minimise the
|
|
268
268
|
# chance that the tx size increases the second time
|
|
269
269
|
for i in {1..2}; do
|
|
270
|
-
fee=$(cardano-cli
|
|
270
|
+
fee=$(cardano-cli latest transaction calculate-min-fee \
|
|
271
271
|
--reference-script-size $refScriptSize \
|
|
272
272
|
--tx-body-file ${SP_NODE_ID}/tx.raw \
|
|
273
273
|
--tx-in-count 1 \
|
|
@@ -280,7 +280,7 @@ updatePool() {
|
|
|
280
280
|
initialBalance=$(getAddressBalance "$paymentAddr")
|
|
281
281
|
txOut=$((initialBalance - fee))
|
|
282
282
|
|
|
283
|
-
cardano-cli
|
|
283
|
+
cardano-cli latest transaction build-raw \
|
|
284
284
|
--tx-in "$utxo" \
|
|
285
285
|
--tx-out "$paymentAddr"+"$txOut" \
|
|
286
286
|
--invalid-hereafter 5000000 \
|
|
@@ -289,14 +289,14 @@ updatePool() {
|
|
|
289
289
|
--out-file ${SP_NODE_ID}/tx.raw
|
|
290
290
|
done
|
|
291
291
|
|
|
292
|
-
cardano-cli
|
|
292
|
+
cardano-cli latest transaction sign \
|
|
293
293
|
--tx-body-file ${SP_NODE_ID}/tx.raw \
|
|
294
294
|
--signing-key-file "$delegatorPaymentSKey" \
|
|
295
295
|
--signing-key-file "$delegatorStakeSKey" \
|
|
296
296
|
--testnet-magic 888 \
|
|
297
297
|
--out-file ${SP_NODE_ID}/tx.signed
|
|
298
298
|
|
|
299
|
-
cardano-cli
|
|
299
|
+
cardano-cli latest transaction submit \
|
|
300
300
|
--tx-file ${SP_NODE_ID}/tx.signed \
|
|
301
301
|
--testnet-magic 888
|
|
302
302
|
|
|
@@ -313,7 +313,7 @@ updatePool() {
|
|
|
313
313
|
|
|
314
314
|
# Only add metadata if given.
|
|
315
315
|
if [ -n "$6" ]; then
|
|
316
|
-
cardano-cli
|
|
316
|
+
cardano-cli latest stake-pool registration-certificate \
|
|
317
317
|
--cold-verification-key-file "$coldVKey" \
|
|
318
318
|
--vrf-verification-key-file "$vrfKey" \
|
|
319
319
|
--pool-pledge "$POOL_PLEDGE" \
|
|
@@ -328,7 +328,7 @@ updatePool() {
|
|
|
328
328
|
--metadata-hash "${METADATA_HASH}" \
|
|
329
329
|
--out-file ${SP_NODE_ID}/pool.cert
|
|
330
330
|
else
|
|
331
|
-
cardano-cli
|
|
331
|
+
cardano-cli latest stake-pool registration-certificate \
|
|
332
332
|
--cold-verification-key-file "$coldVKey" \
|
|
333
333
|
--vrf-verification-key-file "$vrfKey" \
|
|
334
334
|
--pool-pledge "$POOL_PLEDGE" \
|
|
@@ -342,9 +342,9 @@ updatePool() {
|
|
|
342
342
|
--out-file ${SP_NODE_ID}/pool.cert
|
|
343
343
|
fi
|
|
344
344
|
|
|
345
|
-
utxo=$(cardano-cli
|
|
345
|
+
utxo=$(cardano-cli query utxo --address "$paymentAddr" --testnet-magic 888 | awk 'NR == 3 {printf("%s#%s", $1, $2)}')
|
|
346
346
|
|
|
347
|
-
cardano-cli
|
|
347
|
+
cardano-cli latest transaction build-raw \
|
|
348
348
|
--tx-in "$utxo" \
|
|
349
349
|
--tx-out "$paymentAddr"+"$txOut" \
|
|
350
350
|
--invalid-hereafter 500000 \
|
|
@@ -352,16 +352,16 @@ updatePool() {
|
|
|
352
352
|
--certificate-file ${SP_NODE_ID}/pool.cert \
|
|
353
353
|
--out-file ${SP_NODE_ID}/tx.raw
|
|
354
354
|
|
|
355
|
-
refScriptSize=$(cardano-cli
|
|
355
|
+
refScriptSize=$(cardano-cli latest query ref-script-size \
|
|
356
356
|
--tx-in "$utxo" \
|
|
357
357
|
--testnet-magic 888 \
|
|
358
358
|
--output-json | jq '.refInputScriptSize')
|
|
359
359
|
|
|
360
360
|
# Upon applying the fee, the tx size could increase, rendering the fee insuficient
|
|
361
|
-
# Calculate it twice, once with fee 0, then with the calculated fee, to minimise the
|
|
361
|
+
# Calculate it twice, once with fee 0, then with the calculated fee, to minimise the
|
|
362
362
|
# chance that the tx size increases the second time
|
|
363
363
|
for i in {1..2}; do
|
|
364
|
-
fee=$(cardano-cli
|
|
364
|
+
fee=$(cardano-cli latest transaction calculate-min-fee \
|
|
365
365
|
--reference-script-size $refScriptSize \
|
|
366
366
|
--tx-body-file ${SP_NODE_ID}/tx.raw \
|
|
367
367
|
--tx-in-count 1 \
|
|
@@ -374,7 +374,7 @@ updatePool() {
|
|
|
374
374
|
initialBalance=$(getAddressBalance "$paymentAddr")
|
|
375
375
|
txOut=$((initialBalance - fee))
|
|
376
376
|
|
|
377
|
-
cardano-cli
|
|
377
|
+
cardano-cli latest transaction build-raw \
|
|
378
378
|
--tx-in "$utxo" \
|
|
379
379
|
--tx-out "$paymentAddr"+"$txOut" \
|
|
380
380
|
--invalid-hereafter 500000 \
|
|
@@ -383,7 +383,7 @@ updatePool() {
|
|
|
383
383
|
--out-file ${SP_NODE_ID}/tx.raw
|
|
384
384
|
done
|
|
385
385
|
|
|
386
|
-
cardano-cli
|
|
386
|
+
cardano-cli latest transaction sign \
|
|
387
387
|
--tx-body-file ${SP_NODE_ID}/tx.raw \
|
|
388
388
|
--signing-key-file "$delegatorPaymentSKey" \
|
|
389
389
|
--signing-key-file "$coldKey" \
|
|
@@ -391,7 +391,7 @@ updatePool() {
|
|
|
391
391
|
--testnet-magic 888 \
|
|
392
392
|
--out-file ${SP_NODE_ID}/tx.signed
|
|
393
393
|
|
|
394
|
-
cardano-cli
|
|
394
|
+
cardano-cli latest transaction submit \
|
|
395
395
|
--tx-file ${SP_NODE_ID}/tx.signed \
|
|
396
396
|
--testnet-magic 888
|
|
397
397
|
|
|
@@ -416,11 +416,11 @@ deregisterPool() {
|
|
|
416
416
|
done
|
|
417
417
|
|
|
418
418
|
# get the protocol parameters
|
|
419
|
-
cardano-cli
|
|
419
|
+
cardano-cli latest query protocol-parameters --testnet-magic 888 --out-file ${SP_NODE_ID}/params.json
|
|
420
420
|
|
|
421
421
|
genesisVKey=network-files/utxo-keys/utxo${SP_NODE_ID}.vkey
|
|
422
422
|
genesisSKey=network-files/utxo-keys/utxo${SP_NODE_ID}.skey
|
|
423
|
-
genesisAddr=$(cardano-cli
|
|
423
|
+
genesisAddr=$(cardano-cli latest address build --payment-verification-key-file "$genesisVKey" --testnet-magic 888)
|
|
424
424
|
stakeKey=network-files/pools/staking-reward"${SP_NODE_ID}".skey
|
|
425
425
|
coldVKey=network-files/pools/cold"${SP_NODE_ID}".vkey
|
|
426
426
|
coldKey=network-files/pools/cold"${SP_NODE_ID}".skey
|
|
@@ -432,20 +432,20 @@ deregisterPool() {
|
|
|
432
432
|
# We are going to redelegate this stake to dbSync can index it properly.
|
|
433
433
|
echo "Registering delegator stake certificate ${SP_NODE_ID}..."
|
|
434
434
|
|
|
435
|
-
paymentAddr=$(cardano-cli
|
|
435
|
+
paymentAddr=$(cardano-cli latest address build --payment-verification-key-file "$delegatorPaymentKey" --stake-verification-key-file "$delegatorStakeKey" --testnet-magic 888)
|
|
436
436
|
currentBalance=$(getAddressBalance "$paymentAddr")
|
|
437
437
|
|
|
438
|
-
POOL_ID=$(cardano-cli
|
|
438
|
+
POOL_ID=$(cardano-cli latest stake-pool id --cold-verification-key-file "$coldVKey" --output-format "hex")
|
|
439
439
|
|
|
440
440
|
# create pool delegation certificate
|
|
441
|
-
cardano-cli
|
|
441
|
+
cardano-cli latest stake-address stake-delegation-certificate \
|
|
442
442
|
--stake-verification-key-file "$delegatorStakeKey" \
|
|
443
443
|
--stake-pool-id "$POOL_ID" \
|
|
444
444
|
--out-file ${SP_NODE_ID}/deleg.cert
|
|
445
445
|
|
|
446
|
-
utxo=$(cardano-cli
|
|
446
|
+
utxo=$(cardano-cli query utxo --address "$paymentAddr" --testnet-magic 888 | awk 'NR == 3 {printf("%s#%s", $1, $2)}')
|
|
447
447
|
|
|
448
|
-
cardano-cli
|
|
448
|
+
cardano-cli latest transaction build-raw \
|
|
449
449
|
--tx-in "$utxo" \
|
|
450
450
|
--tx-out "$paymentAddr"+0 \
|
|
451
451
|
--invalid-hereafter 5000000 \
|
|
@@ -453,16 +453,16 @@ deregisterPool() {
|
|
|
453
453
|
--out-file ${SP_NODE_ID}/tx.raw \
|
|
454
454
|
--certificate ${SP_NODE_ID}/deleg.cert
|
|
455
455
|
|
|
456
|
-
refScriptSize=$(cardano-cli
|
|
456
|
+
refScriptSize=$(cardano-cli latest query ref-script-size \
|
|
457
457
|
--tx-in "$utxo" \
|
|
458
458
|
--testnet-magic 888 \
|
|
459
459
|
--output-json | jq '.refInputScriptSize')
|
|
460
460
|
|
|
461
461
|
# Upon applying the fee, the tx size could increase, rendering the fee insuficient
|
|
462
|
-
# Calculate it twice, once with fee 0, then with the calculated fee, to minimise the
|
|
462
|
+
# Calculate it twice, once with fee 0, then with the calculated fee, to minimise the
|
|
463
463
|
# chance that the tx size increases the second time
|
|
464
464
|
for i in {1..2}; do
|
|
465
|
-
fee=$(cardano-cli
|
|
465
|
+
fee=$(cardano-cli latest transaction calculate-min-fee \
|
|
466
466
|
--reference-script-size $refScriptSize \
|
|
467
467
|
--tx-body-file ${SP_NODE_ID}/tx.raw \
|
|
468
468
|
--tx-in-count 1 \
|
|
@@ -475,7 +475,7 @@ deregisterPool() {
|
|
|
475
475
|
initialBalance=$(getAddressBalance "$paymentAddr")
|
|
476
476
|
txOut=$((initialBalance - fee))
|
|
477
477
|
|
|
478
|
-
cardano-cli
|
|
478
|
+
cardano-cli latest transaction build-raw \
|
|
479
479
|
--tx-in "$utxo" \
|
|
480
480
|
--tx-out "$paymentAddr"+"$txOut" \
|
|
481
481
|
--invalid-hereafter 5000000 \
|
|
@@ -484,14 +484,14 @@ deregisterPool() {
|
|
|
484
484
|
--out-file ${SP_NODE_ID}/tx.raw
|
|
485
485
|
done
|
|
486
486
|
|
|
487
|
-
cardano-cli
|
|
487
|
+
cardano-cli latest transaction sign \
|
|
488
488
|
--tx-body-file ${SP_NODE_ID}/tx.raw \
|
|
489
489
|
--signing-key-file "$delegatorPaymentSKey" \
|
|
490
490
|
--signing-key-file "$delegatorStakeSKey" \
|
|
491
491
|
--testnet-magic 888 \
|
|
492
492
|
--out-file ${SP_NODE_ID}/tx.signed
|
|
493
493
|
|
|
494
|
-
cardano-cli
|
|
494
|
+
cardano-cli latest transaction submit \
|
|
495
495
|
--tx-file ${SP_NODE_ID}/tx.signed \
|
|
496
496
|
--testnet-magic 888
|
|
497
497
|
|
|
@@ -506,14 +506,14 @@ deregisterPool() {
|
|
|
506
506
|
echo "Deregister stake pool ${SP_NODE_ID}..."
|
|
507
507
|
currentBalance=$(getAddressBalance "$genesisAddr")
|
|
508
508
|
|
|
509
|
-
cardano-cli
|
|
509
|
+
cardano-cli latest stake-pool deregistration-certificate \
|
|
510
510
|
--cold-verification-key-file "$coldVKey" \
|
|
511
511
|
--epoch "$RETIRING_EPOCH" \
|
|
512
512
|
--out-file ${SP_NODE_ID}/pool.dereg
|
|
513
513
|
|
|
514
|
-
utxo=$(cardano-cli
|
|
514
|
+
utxo=$(cardano-cli query utxo --address "$genesisAddr" --testnet-magic 888 | awk 'NR == 3 {printf("%s#%s", $1, $2)}')
|
|
515
515
|
|
|
516
|
-
cardano-cli
|
|
516
|
+
cardano-cli latest transaction build-raw \
|
|
517
517
|
--tx-in "$utxo" \
|
|
518
518
|
--tx-out "$genesisAddr"+0 \
|
|
519
519
|
--invalid-hereafter 500000 \
|
|
@@ -521,16 +521,16 @@ deregisterPool() {
|
|
|
521
521
|
--certificate-file ${SP_NODE_ID}/pool.dereg \
|
|
522
522
|
--out-file ${SP_NODE_ID}/tx.raw
|
|
523
523
|
|
|
524
|
-
refScriptSize=$(cardano-cli
|
|
524
|
+
refScriptSize=$(cardano-cli latest query ref-script-size \
|
|
525
525
|
--tx-in "$utxo" \
|
|
526
526
|
--testnet-magic 888 \
|
|
527
527
|
--output-json | jq '.refInputScriptSize')
|
|
528
|
-
|
|
528
|
+
|
|
529
529
|
# Upon applying the fee, the tx size could increase, rendering the fee insuficient
|
|
530
|
-
# Calculate it twice, once with fee 0, then with the calculated fee, to minimise the
|
|
530
|
+
# Calculate it twice, once with fee 0, then with the calculated fee, to minimise the
|
|
531
531
|
# chance that the tx size increases the second time
|
|
532
532
|
for i in {1..2}; do
|
|
533
|
-
fee=$(cardano-cli
|
|
533
|
+
fee=$(cardano-cli latest transaction calculate-min-fee \
|
|
534
534
|
--reference-script-size $refScriptSize \
|
|
535
535
|
--tx-body-file ${SP_NODE_ID}/tx.raw \
|
|
536
536
|
--tx-in-count 1 \
|
|
@@ -543,7 +543,7 @@ deregisterPool() {
|
|
|
543
543
|
initialBalance=$(getAddressBalance "$genesisAddr")
|
|
544
544
|
txOut=$((initialBalance - fee))
|
|
545
545
|
|
|
546
|
-
cardano-cli
|
|
546
|
+
cardano-cli latest transaction build-raw \
|
|
547
547
|
--tx-in "$utxo" \
|
|
548
548
|
--tx-out "$genesisAddr"+"$txOut" \
|
|
549
549
|
--invalid-hereafter 500000 \
|
|
@@ -552,7 +552,7 @@ deregisterPool() {
|
|
|
552
552
|
--out-file ${SP_NODE_ID}/tx.raw
|
|
553
553
|
done
|
|
554
554
|
|
|
555
|
-
cardano-cli
|
|
555
|
+
cardano-cli latest transaction sign \
|
|
556
556
|
--tx-body-file ${SP_NODE_ID}/tx.raw \
|
|
557
557
|
--signing-key-file "$genesisSKey" \
|
|
558
558
|
--signing-key-file "$coldKey" \
|
|
@@ -560,7 +560,7 @@ deregisterPool() {
|
|
|
560
560
|
--testnet-magic 888 \
|
|
561
561
|
--out-file ${SP_NODE_ID}/tx.signed
|
|
562
562
|
|
|
563
|
-
cardano-cli
|
|
563
|
+
cardano-cli latest transaction submit \
|
|
564
564
|
--tx-file ${SP_NODE_ID}/tx.signed \
|
|
565
565
|
--testnet-magic 888
|
|
566
566
|
|
|
@@ -75,7 +75,7 @@ cardano-cli query protocol-parameters \
|
|
|
75
75
|
--testnet-magic 888 \
|
|
76
76
|
--out-file pparams.json
|
|
77
77
|
|
|
78
|
-
cardano-cli
|
|
78
|
+
cardano-cli latest transaction build \
|
|
79
79
|
--testnet-magic 888 \
|
|
80
80
|
--change-address "$genesisAddr" \
|
|
81
81
|
--tx-in "$utxo" \
|
|
@@ -83,13 +83,13 @@ cardano-cli conway transaction build \
|
|
|
83
83
|
--tx-out-inline-datum-value 42 \
|
|
84
84
|
--out-file tx-script.build
|
|
85
85
|
|
|
86
|
-
cardano-cli transaction sign \
|
|
86
|
+
cardano-cli latest transaction sign \
|
|
87
87
|
--tx-body-file tx-script.build \
|
|
88
88
|
--signing-key-file network-files/utxo-keys/utxo2.skey \
|
|
89
89
|
--testnet-magic 888 \
|
|
90
90
|
--out-file tx-script.signed
|
|
91
91
|
|
|
92
|
-
cardano-cli transaction submit --testnet-magic 888 --tx-file tx-script.signed
|
|
92
|
+
cardano-cli latest transaction submit --testnet-magic 888 --tx-file tx-script.signed
|
|
93
93
|
|
|
94
94
|
updatedBalance=$(getAddressBalance "$REFERENCE_INPUT_ADDR")
|
|
95
95
|
|
|
@@ -107,7 +107,7 @@ currentBalance=$(getAddressBalance "$REFERENCE_SCRIPT_ADDR")
|
|
|
107
107
|
|
|
108
108
|
echo "Locking reference script UTXO (Multisignature)..."
|
|
109
109
|
|
|
110
|
-
cardano-cli
|
|
110
|
+
cardano-cli latest transaction build \
|
|
111
111
|
--testnet-magic 888 \
|
|
112
112
|
--change-address "$genesisAddr" \
|
|
113
113
|
--tx-in "$utxo" \
|
|
@@ -115,13 +115,13 @@ cardano-cli conway transaction build \
|
|
|
115
115
|
--tx-out-reference-script-file scripts/contracts/multisignature.json \
|
|
116
116
|
--out-file tx-script.build
|
|
117
117
|
|
|
118
|
-
cardano-cli transaction sign \
|
|
118
|
+
cardano-cli latest transaction sign \
|
|
119
119
|
--tx-body-file tx-script.build \
|
|
120
120
|
--signing-key-file network-files/utxo-keys/utxo2.skey \
|
|
121
121
|
--testnet-magic 888 \
|
|
122
122
|
--out-file tx-script.signed
|
|
123
123
|
|
|
124
|
-
cardano-cli transaction submit --testnet-magic 888 --tx-file tx-script.signed
|
|
124
|
+
cardano-cli latest transaction submit --testnet-magic 888 --tx-file tx-script.signed
|
|
125
125
|
|
|
126
126
|
updatedBalance=$(getAddressBalance "$REFERENCE_SCRIPT_ADDR")
|
|
127
127
|
|
|
@@ -137,7 +137,7 @@ currentBalance=$(getAddressBalance "$REFERENCE_SCRIPT_ADDR")
|
|
|
137
137
|
|
|
138
138
|
echo "Locking reference script UTXO (Timelock)..."
|
|
139
139
|
|
|
140
|
-
cardano-cli
|
|
140
|
+
cardano-cli latest transaction build \
|
|
141
141
|
--testnet-magic 888 \
|
|
142
142
|
--change-address "$genesisAddr" \
|
|
143
143
|
--tx-in "$utxo" \
|
|
@@ -145,13 +145,13 @@ cardano-cli conway transaction build \
|
|
|
145
145
|
--tx-out-reference-script-file scripts/contracts/timelock.json \
|
|
146
146
|
--out-file tx-script.build
|
|
147
147
|
|
|
148
|
-
cardano-cli transaction sign \
|
|
148
|
+
cardano-cli latest transaction sign \
|
|
149
149
|
--tx-body-file tx-script.build \
|
|
150
150
|
--signing-key-file network-files/utxo-keys/utxo2.skey \
|
|
151
151
|
--testnet-magic 888 \
|
|
152
152
|
--out-file tx-script.signed
|
|
153
153
|
|
|
154
|
-
cardano-cli transaction submit --testnet-magic 888 --tx-file tx-script.signed
|
|
154
|
+
cardano-cli latest transaction submit --testnet-magic 888 --tx-file tx-script.signed
|
|
155
155
|
|
|
156
156
|
updatedBalance=$(getAddressBalance "$REFERENCE_SCRIPT_ADDR")
|
|
157
157
|
|
|
@@ -167,7 +167,7 @@ currentBalance=$(getAddressBalance "$REFERENCE_SCRIPT_ADDR")
|
|
|
167
167
|
|
|
168
168
|
echo "Locking reference script UTXO (Plutus V1)..."
|
|
169
169
|
|
|
170
|
-
cardano-cli
|
|
170
|
+
cardano-cli latest transaction build \
|
|
171
171
|
--testnet-magic 888 \
|
|
172
172
|
--change-address "$genesisAddr" \
|
|
173
173
|
--tx-in "$utxo" \
|
|
@@ -175,13 +175,13 @@ cardano-cli conway transaction build \
|
|
|
175
175
|
--tx-out-reference-script-file scripts/contracts/alwayssucceeds.plutus \
|
|
176
176
|
--out-file tx-script.build
|
|
177
177
|
|
|
178
|
-
cardano-cli transaction sign \
|
|
178
|
+
cardano-cli latest transaction sign \
|
|
179
179
|
--tx-body-file tx-script.build \
|
|
180
180
|
--signing-key-file network-files/utxo-keys/utxo2.skey \
|
|
181
181
|
--testnet-magic 888 \
|
|
182
182
|
--out-file tx-script.signed
|
|
183
183
|
|
|
184
|
-
cardano-cli transaction submit --testnet-magic 888 --tx-file tx-script.signed
|
|
184
|
+
cardano-cli latest transaction submit --testnet-magic 888 --tx-file tx-script.signed
|
|
185
185
|
|
|
186
186
|
updatedBalance=$(getAddressBalance "$REFERENCE_SCRIPT_ADDR")
|
|
187
187
|
|
|
@@ -197,7 +197,7 @@ currentBalance=$(getAddressBalance "$REFERENCE_SCRIPT_ADDR")
|
|
|
197
197
|
|
|
198
198
|
echo "Locking reference script UTXO (Plutus V2)..."
|
|
199
199
|
|
|
200
|
-
cardano-cli
|
|
200
|
+
cardano-cli latest transaction build \
|
|
201
201
|
--testnet-magic 888 \
|
|
202
202
|
--change-address "$genesisAddr" \
|
|
203
203
|
--tx-in "$utxo" \
|
|
@@ -205,13 +205,13 @@ cardano-cli conway transaction build \
|
|
|
205
205
|
--tx-out-reference-script-file scripts/contracts/reference-input.plutus \
|
|
206
206
|
--out-file tx-script.build
|
|
207
207
|
|
|
208
|
-
cardano-cli transaction sign \
|
|
208
|
+
cardano-cli latest transaction sign \
|
|
209
209
|
--tx-body-file tx-script.build \
|
|
210
210
|
--signing-key-file network-files/utxo-keys/utxo2.skey \
|
|
211
211
|
--testnet-magic 888 \
|
|
212
212
|
--out-file tx-script.signed
|
|
213
213
|
|
|
214
|
-
cardano-cli transaction submit --testnet-magic 888 --tx-file tx-script.signed
|
|
214
|
+
cardano-cli latest transaction submit --testnet-magic 888 --tx-file tx-script.signed
|
|
215
215
|
|
|
216
216
|
updatedBalance=$(getAddressBalance "$REFERENCE_SCRIPT_ADDR")
|
|
217
217
|
|
|
@@ -226,7 +226,7 @@ echo "Locking funds in script..."
|
|
|
226
226
|
utxo=$(awk '{printf("%s", $1)}' <<<"$(getBiggestUtxo "$genesisAddr")")
|
|
227
227
|
currentBalance=$(getAddressBalance "$REFERENCE_INPUT_SCRIPT_ADDR")
|
|
228
228
|
|
|
229
|
-
cardano-cli
|
|
229
|
+
cardano-cli latest transaction build \
|
|
230
230
|
--testnet-magic 888 \
|
|
231
231
|
--tx-in "$utxo" \
|
|
232
232
|
--tx-out "$REFERENCE_INPUT_SCRIPT_ADDR"+"$AMOUNT" \
|
|
@@ -234,13 +234,13 @@ cardano-cli conway transaction build \
|
|
|
234
234
|
--change-address "$genesisAddr" \
|
|
235
235
|
--out-file test-babbage.tx
|
|
236
236
|
|
|
237
|
-
cardano-cli transaction sign \
|
|
237
|
+
cardano-cli latest transaction sign \
|
|
238
238
|
--tx-body-file test-babbage.tx \
|
|
239
239
|
--signing-key-file network-files/utxo-keys/utxo2.skey \
|
|
240
240
|
--testnet-magic 888 \
|
|
241
241
|
--out-file test-babbage.signed
|
|
242
242
|
|
|
243
|
-
cardano-cli transaction submit --testnet-magic 888 --tx-file test-babbage.signed
|
|
243
|
+
cardano-cli latest transaction submit --testnet-magic 888 --tx-file test-babbage.signed
|
|
244
244
|
|
|
245
245
|
updatedBalance=$(getAddressBalance "$REFERENCE_INPUT_SCRIPT_ADDR")
|
|
246
246
|
|
|
@@ -259,7 +259,7 @@ scriptUtxo=$(awk '{printf("%s", $1)}' <<<"$(getBiggestUtxo "$REFERENCE_INPUT_SCR
|
|
|
259
259
|
currentBalance=$(getAddressBalance "$REFERENCE_INPUT_SCRIPT_ADDR")
|
|
260
260
|
returnCollateralVal=$(("$utxoVal" - 1450000))
|
|
261
261
|
|
|
262
|
-
cardano-cli
|
|
262
|
+
cardano-cli latest transaction build \
|
|
263
263
|
--testnet-magic 888 \
|
|
264
264
|
--tx-in-collateral "$utxo" \
|
|
265
265
|
--tx-in "$utxo" \
|
|
@@ -273,13 +273,13 @@ cardano-cli conway transaction build \
|
|
|
273
273
|
--tx-total-collateral 1450000 \
|
|
274
274
|
--out-file test-babbage2.tx
|
|
275
275
|
|
|
276
|
-
cardano-cli transaction sign \
|
|
276
|
+
cardano-cli latest transaction sign \
|
|
277
277
|
--tx-body-file test-babbage2.tx \
|
|
278
278
|
--signing-key-file network-files/utxo-keys/utxo2.skey \
|
|
279
279
|
--testnet-magic 888 \
|
|
280
280
|
--out-file test-babbage2.signed
|
|
281
281
|
|
|
282
|
-
cardano-cli transaction submit --testnet-magic 888 --tx-file test-babbage2.signed
|
|
282
|
+
cardano-cli latest transaction submit --testnet-magic 888 --tx-file test-babbage2.signed
|
|
283
283
|
|
|
284
284
|
updatedBalance=$(getAddressBalance "$REFERENCE_INPUT_SCRIPT_ADDR")
|
|
285
285
|
|