@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.
- package/.env.example +1 -1
- package/CHANGELOG.md +29 -2
- package/dist/cjs/factories.d.ts.map +1 -1
- package/dist/cjs/factories.js +3 -6
- 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 +3 -6
- package/dist/esm/factories.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/docker-compose.yml +8 -0
- package/local-network/README.md +1 -1
- package/local-network/scripts/cardano-node-ogmios.sh +1 -1
- package/local-network/scripts/get-epoch.sh +0 -1
- package/local-network/scripts/make-babbage.sh +61 -61
- package/local-network/scripts/mint-handles.sh +1 -1
- package/local-network/scripts/mint-tokens.sh +0 -1
- package/local-network/scripts/mnemonic_keys.sh +7 -7
- package/local-network/scripts/nodes-configuration.sh +1 -1
- package/local-network/scripts/plutus-transaction.sh +8 -10
- package/local-network/scripts/pools/update-node-utils.sh +221 -232
- package/local-network/scripts/reference-input-transaction.sh +30 -38
- package/local-network/scripts/start.sh +1 -2
- package/local-network/templates/babbage/byron-configuration.yaml +9 -14
- package/package.json +20 -20
- package/src/factories.ts +3 -14
- package/test/k6/README.md +3 -4
- package/test/long-running/delegation-rewards.test.ts +104 -58
- package/test/projection/offline-fork.test.ts +1 -1
- package/test/projection/single-tenant-utxo.test.ts +2 -2
- package/test/tsconfig.json +1 -0
- package/test/web-extension/extension/background/cip30.ts +5 -1
- package/test/web-extension/specs/wallet.spec.ts +2 -2
- package/test/tsconfig.tsbuildinfo +0 -1
|
@@ -15,24 +15,23 @@ clean() {
|
|
|
15
15
|
|
|
16
16
|
getAddressBalance() {
|
|
17
17
|
cardano-cli query utxo \
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
--address "$1" \
|
|
19
|
+
--testnet-magic 888 >fullUtxo.out
|
|
20
20
|
|
|
21
|
-
tail -n +3 fullUtxo.out | sort -k3 -nr >
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
done <
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
78
|
-
currentBalance=$(getAddressBalance "$
|
|
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 "$
|
|
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 "$
|
|
95
|
+
updatedBalance=$(getAddressBalance "$stakeAddr")
|
|
98
96
|
|
|
99
|
-
while [ "$currentBalance" -eq "$updatedBalance" ]
|
|
100
|
-
|
|
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
|
-
|
|
109
|
-
|
|
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
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
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
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
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
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
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
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
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
|
-
|
|
150
|
-
|
|
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
|
-
|
|
164
|
-
|
|
165
|
-
|
|
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
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
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
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
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
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
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
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
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
|
-
|
|
206
|
-
|
|
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 "$
|
|
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
|
-
|
|
225
|
-
|
|
226
|
-
|
|
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
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
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
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
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
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
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
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
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
|
-
|
|
267
|
-
|
|
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
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
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
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
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
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
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
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
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
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
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
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
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
|
-
|
|
353
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 "$
|
|
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
|
-
|
|
402
|
-
|
|
403
|
-
|
|
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
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
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
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
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
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
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
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
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
|
-
|
|
444
|
-
|
|
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
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
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
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
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
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
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
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
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
|
-
|
|
503
|
-
|
|
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
|