@cardano-sdk/e2e 0.35.0 → 0.36.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 +4 -0
- package/CHANGELOG.md +24 -0
- package/dist/cjs/environment.d.ts +3 -2
- package/dist/cjs/environment.d.ts.map +1 -1
- package/dist/cjs/environment.js +3 -1
- package/dist/cjs/environment.js.map +1 -1
- package/dist/cjs/factories.d.ts.map +1 -1
- package/dist/cjs/factories.js +5 -1
- package/dist/cjs/factories.js.map +1 -1
- package/dist/cjs/scripts/is-local-network-ready.js +3 -5
- package/dist/cjs/scripts/is-local-network-ready.js.map +1 -1
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/cjs/util/util.d.ts +1 -1
- package/dist/cjs/util/util.d.ts.map +1 -1
- package/dist/cjs/util/util.js +7 -2
- package/dist/cjs/util/util.js.map +1 -1
- package/dist/esm/environment.d.ts +3 -2
- package/dist/esm/environment.d.ts.map +1 -1
- package/dist/esm/environment.js +3 -1
- package/dist/esm/environment.js.map +1 -1
- package/dist/esm/factories.d.ts.map +1 -1
- package/dist/esm/factories.js +5 -1
- package/dist/esm/factories.js.map +1 -1
- package/dist/esm/scripts/is-local-network-ready.js +3 -5
- package/dist/esm/scripts/is-local-network-ready.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/util/util.d.ts +1 -1
- package/dist/esm/util/util.d.ts.map +1 -1
- package/dist/esm/util/util.js +8 -3
- package/dist/esm/util/util.js.map +1 -1
- package/docker-compose.yml +1 -5
- package/jest.config.js +3 -2
- package/local-network/Dockerfile +1 -1
- package/local-network/scripts/make-babbage.sh +24 -17
- package/local-network/scripts/pools/update-node-sp1.sh +1 -1
- package/local-network/scripts/pools/update-node-sp10.sh +1 -1
- package/local-network/scripts/pools/update-node-sp11.sh +1 -1
- package/local-network/scripts/pools/update-node-sp2.sh +1 -1
- package/local-network/scripts/pools/update-node-sp3.sh +1 -1
- package/local-network/scripts/pools/update-node-sp4.sh +1 -1
- package/local-network/scripts/pools/update-node-sp5.sh +1 -1
- package/local-network/scripts/pools/update-node-sp6.sh +1 -1
- package/local-network/scripts/pools/update-node-sp7.sh +1 -1
- package/local-network/scripts/pools/update-node-sp8.sh +1 -1
- package/local-network/scripts/pools/update-node-sp9.sh +1 -1
- package/local-network/scripts/pools/update-node-utils.sh +82 -76
- package/local-network/scripts/start.sh +9 -5
- package/local-network/scripts/update-stake-pools.sh.sh +13 -0
- package/local-network/scripts/wait-local-network-init.sh +11 -0
- package/local-network/templates/babbage/alonzo-babbage-test-genesis.json +154 -154
- package/package.json +24 -21
- package/src/environment.ts +3 -1
- package/src/factories.ts +6 -1
- package/src/scripts/is-local-network-ready.ts +4 -8
- package/src/util/util.ts +12 -4
- package/test/long-running/multisig-wallet/MultiSigWallet.ts +5 -2
- package/test/long-running/shared-wallet-delegation-rewards.test.ts +2 -2
- package/test/long-running/simple-delegation-rewards.test.ts +1 -1
- package/test/{wallet → wallet_epoch_0}/PersonalWallet/byron.test.ts +1 -1
- package/test/{wallet → wallet_epoch_0}/PersonalWallet/handle.test.ts +1 -1
- package/test/{wallet → wallet_epoch_0}/PersonalWallet/mint.test.ts +7 -6
- package/test/{wallet → wallet_epoch_0}/PersonalWallet/multiAddress.test.ts +1 -1
- package/test/{wallet → wallet_epoch_0}/PersonalWallet/multisignature.test.ts +14 -11
- package/test/{wallet → wallet_epoch_0}/PersonalWallet/nft.test.ts +1 -1
- package/test/{wallet → wallet_epoch_0}/PersonalWallet/phase2validation.test.ts +2 -1
- package/test/wallet_epoch_0/PersonalWallet/plutusTest.test.ts +346 -0
- package/test/{wallet → wallet_epoch_0}/PersonalWallet/txChainHistory.test.ts +1 -1
- package/test/{wallet → wallet_epoch_0}/PersonalWallet/unspendableUtxos.test.ts +2 -2
- package/test/{wallet → wallet_epoch_0}/SharedWallet/simpleTx.test.ts +2 -2
- package/test/{wallet → wallet_epoch_3}/PersonalWallet/delegationDistribution.test.ts +2 -3
- package/test/{wallet → wallet_epoch_3}/SharedWallet/delegation.test.ts +2 -2
- package/local-network/scripts/is-db-synced.sh +0 -24
- /package/test/{wallet → wallet_epoch_0}/PersonalWallet/metadata.test.ts +0 -0
- /package/test/{wallet → wallet_epoch_0}/PersonalWallet/pouchDbWalletStores.test.ts +0 -0
- /package/test/{wallet → wallet_epoch_0}/PersonalWallet/txChaining.test.ts +0 -0
- /package/test/{wallet/SharedWallet/ultils.ts → wallet_epoch_0/SharedWallet/utils.ts} +0 -0
- /package/test/{wallet → wallet_epoch_3}/PersonalWallet/delegation.test.ts +0 -0
|
@@ -9,22 +9,26 @@ cd "$root"
|
|
|
9
9
|
|
|
10
10
|
export PATH=$PWD/bin:$PATH
|
|
11
11
|
|
|
12
|
+
SP_NODE_ID="$1"
|
|
13
|
+
|
|
14
|
+
mkdir ${SP_NODE_ID}
|
|
15
|
+
|
|
12
16
|
clean() {
|
|
13
|
-
rm -rf
|
|
17
|
+
rm -rf ${SP_NODE_ID}
|
|
14
18
|
}
|
|
15
19
|
|
|
16
20
|
getAddressBalance() {
|
|
17
21
|
cardano-cli query utxo \
|
|
18
22
|
--address "$1" \
|
|
19
|
-
--testnet-magic 888 >fullUtxo.out
|
|
23
|
+
--testnet-magic 888 > ${SP_NODE_ID}/fullUtxo.out
|
|
20
24
|
|
|
21
|
-
tail -n +3 fullUtxo.out | sort -k3 -nr >balance.out
|
|
25
|
+
tail -n +3 ${SP_NODE_ID}/fullUtxo.out | sort -k3 -nr > ${SP_NODE_ID}/balance.out
|
|
22
26
|
|
|
23
27
|
total_balance=0
|
|
24
28
|
while read -r utxo; do
|
|
25
29
|
utxo_balance=$(awk '{ print $3 }' <<<"${utxo}")
|
|
26
30
|
total_balance=$(("$total_balance" + "$utxo_balance"))
|
|
27
|
-
done <balance.out
|
|
31
|
+
done < ${SP_NODE_ID}/balance.out
|
|
28
32
|
|
|
29
33
|
echo ${total_balance}
|
|
30
34
|
}
|
|
@@ -53,10 +57,10 @@ updatePool() {
|
|
|
53
57
|
fi
|
|
54
58
|
|
|
55
59
|
# get the protocol parameters
|
|
56
|
-
cardano-cli query protocol-parameters --testnet-magic 888 --out-file params.json
|
|
60
|
+
cardano-cli query protocol-parameters --testnet-magic 888 --out-file ${SP_NODE_ID}/params.json
|
|
57
61
|
|
|
58
|
-
genesisVKey=network-files/utxo-keys/
|
|
59
|
-
genesisSKey=network-files/utxo-keys/
|
|
62
|
+
genesisVKey=network-files/utxo-keys/utxo${SP_NODE_ID}.vkey
|
|
63
|
+
genesisSKey=network-files/utxo-keys/utxo${SP_NODE_ID}.skey
|
|
60
64
|
genesisAddr=$(cardano-cli address build --payment-verification-key-file "$genesisVKey" --testnet-magic 888)
|
|
61
65
|
|
|
62
66
|
stakeVKey=network-files/pools/staking-reward"${SP_NODE_ID}".vkey
|
|
@@ -69,6 +73,8 @@ updatePool() {
|
|
|
69
73
|
delegatorPaymentSKey=network-files/stake-delegator-keys/payment"${SP_NODE_ID}".skey
|
|
70
74
|
delegatorStakeSKey=network-files/stake-delegator-keys/staking"${SP_NODE_ID}".skey
|
|
71
75
|
|
|
76
|
+
keyDeposit=2000000
|
|
77
|
+
|
|
72
78
|
POOL_ID=$(cardano-cli stake-pool id --cold-verification-key-file "$coldVKey" --output-format "hex")
|
|
73
79
|
|
|
74
80
|
# funding pool owner stake address
|
|
@@ -82,15 +88,15 @@ updatePool() {
|
|
|
82
88
|
--tx-in "$utxo" \
|
|
83
89
|
--tx-out "$stakeAddr"+"$POOL_OWNER_STAKE" \
|
|
84
90
|
--testnet-magic 888 \
|
|
85
|
-
--out-file wallets-tx.raw 2>&1
|
|
91
|
+
--out-file ${SP_NODE_ID}/wallets-tx.raw 2>&1
|
|
86
92
|
|
|
87
93
|
cardano-cli transaction sign \
|
|
88
|
-
--tx-body-file wallets-tx.raw \
|
|
94
|
+
--tx-body-file ${SP_NODE_ID}/wallets-tx.raw \
|
|
89
95
|
--signing-key-file "$genesisSKey" \
|
|
90
96
|
--testnet-magic 888 \
|
|
91
|
-
--out-file wallets-tx.signed 2>&1
|
|
97
|
+
--out-file ${SP_NODE_ID}/wallets-tx.signed 2>&1
|
|
92
98
|
|
|
93
|
-
cardano-cli transaction submit --testnet-magic 888 --tx-file wallets-tx.signed 2>&1
|
|
99
|
+
cardano-cli transaction submit --testnet-magic 888 --tx-file ${SP_NODE_ID}/wallets-tx.signed 2>&1
|
|
94
100
|
|
|
95
101
|
updatedBalance=$(getAddressBalance "$stakeAddr")
|
|
96
102
|
|
|
@@ -103,7 +109,7 @@ updatePool() {
|
|
|
103
109
|
currentBalance=$(getAddressBalance "$genesisAddr")
|
|
104
110
|
cardano-cli stake-address registration-certificate \
|
|
105
111
|
--stake-verification-key-file "$stakeVKey" \
|
|
106
|
-
--out-file pool-owner-registration.cert
|
|
112
|
+
--out-file ${SP_NODE_ID}/pool-owner-registration.cert
|
|
107
113
|
|
|
108
114
|
utxo=$(cardano-cli query utxo --address "$genesisAddr" --testnet-magic 888 | awk 'NR == 3 {printf("%s#%s", $1, $2)}')
|
|
109
115
|
|
|
@@ -112,38 +118,38 @@ updatePool() {
|
|
|
112
118
|
--tx-out "$genesisAddr"+0 \
|
|
113
119
|
--invalid-hereafter 5000000 \
|
|
114
120
|
--fee 0 \
|
|
115
|
-
--out-file tx.tmp \
|
|
116
|
-
--certificate pool-owner-registration.cert
|
|
121
|
+
--out-file ${SP_NODE_ID}/tx.tmp \
|
|
122
|
+
--certificate ${SP_NODE_ID}/pool-owner-registration.cert
|
|
117
123
|
|
|
118
124
|
fee=$(cardano-cli transaction calculate-min-fee \
|
|
119
|
-
--tx-body-file tx.tmp \
|
|
125
|
+
--tx-body-file ${SP_NODE_ID}/tx.tmp \
|
|
120
126
|
--tx-in-count 1 \
|
|
121
127
|
--tx-out-count 1 \
|
|
122
128
|
--testnet-magic 888 \
|
|
123
129
|
--witness-count 2 \
|
|
124
130
|
--byron-witness-count 0 \
|
|
125
|
-
--protocol-params-file
|
|
131
|
+
--protocol-params-file ${SP_NODE_ID}/params.json | awk '{ print $1 }')
|
|
126
132
|
|
|
127
133
|
initialBalance=$(getAddressBalance "$genesisAddr")
|
|
128
|
-
txOut=$((initialBalance - fee))
|
|
134
|
+
txOut=$((initialBalance - fee - keyDeposit))
|
|
129
135
|
|
|
130
136
|
cardano-cli transaction build-raw \
|
|
131
137
|
--tx-in "$utxo" \
|
|
132
138
|
--tx-out "$genesisAddr"+"$txOut" \
|
|
133
139
|
--invalid-hereafter 5000000 \
|
|
134
140
|
--fee "$fee" \
|
|
135
|
-
--certificate pool-owner-registration.cert \
|
|
136
|
-
--out-file tx.raw
|
|
141
|
+
--certificate ${SP_NODE_ID}/pool-owner-registration.cert \
|
|
142
|
+
--out-file ${SP_NODE_ID}/tx.raw
|
|
137
143
|
|
|
138
144
|
cardano-cli transaction sign \
|
|
139
|
-
--tx-body-file tx.raw \
|
|
145
|
+
--tx-body-file ${SP_NODE_ID}/tx.raw \
|
|
140
146
|
--signing-key-file "$genesisSKey" \
|
|
141
147
|
--signing-key-file "$stakeKey" \
|
|
142
148
|
--testnet-magic 888 \
|
|
143
|
-
--out-file tx.signed
|
|
149
|
+
--out-file ${SP_NODE_ID}/tx.signed
|
|
144
150
|
|
|
145
151
|
cardano-cli transaction submit \
|
|
146
|
-
--tx-file tx.signed \
|
|
152
|
+
--tx-file ${SP_NODE_ID}/tx.signed \
|
|
147
153
|
--testnet-magic 888
|
|
148
154
|
|
|
149
155
|
updatedBalance=$(getAddressBalance "$genesisAddr")
|
|
@@ -158,7 +164,7 @@ updatePool() {
|
|
|
158
164
|
cardano-cli stake-address delegation-certificate \
|
|
159
165
|
--stake-verification-key-file "$stakeVKey" \
|
|
160
166
|
--cold-verification-key-file "$coldVKey" \
|
|
161
|
-
--out-file pool-owner-delegation.cert
|
|
167
|
+
--out-file ${SP_NODE_ID}/pool-owner-delegation.cert
|
|
162
168
|
|
|
163
169
|
utxo=$(cardano-cli query utxo --address "$genesisAddr" --testnet-magic 888 | awk 'NR == 3 {printf("%s#%s", $1, $2)}')
|
|
164
170
|
|
|
@@ -167,17 +173,17 @@ updatePool() {
|
|
|
167
173
|
--tx-out "$genesisAddr"+0 \
|
|
168
174
|
--invalid-hereafter 5000000 \
|
|
169
175
|
--fee 0 \
|
|
170
|
-
--out-file tx.tmp \
|
|
171
|
-
--certificate pool-owner-delegation.cert
|
|
176
|
+
--out-file ${SP_NODE_ID}/tx.tmp \
|
|
177
|
+
--certificate ${SP_NODE_ID}/pool-owner-delegation.cert
|
|
172
178
|
|
|
173
179
|
fee=$(cardano-cli transaction calculate-min-fee \
|
|
174
|
-
--tx-body-file tx.tmp \
|
|
180
|
+
--tx-body-file ${SP_NODE_ID}/tx.tmp \
|
|
175
181
|
--tx-in-count 1 \
|
|
176
182
|
--tx-out-count 1 \
|
|
177
183
|
--testnet-magic 888 \
|
|
178
184
|
--witness-count 2 \
|
|
179
185
|
--byron-witness-count 0 \
|
|
180
|
-
--protocol-params-file
|
|
186
|
+
--protocol-params-file ${SP_NODE_ID}/params.json | awk '{ print $1 }')
|
|
181
187
|
|
|
182
188
|
initialBalance=$(getAddressBalance "$genesisAddr")
|
|
183
189
|
txOut=$((initialBalance - fee))
|
|
@@ -187,18 +193,18 @@ updatePool() {
|
|
|
187
193
|
--tx-out "$genesisAddr"+"$txOut" \
|
|
188
194
|
--invalid-hereafter 5000000 \
|
|
189
195
|
--fee "$fee" \
|
|
190
|
-
--certificate pool-owner-delegation.cert \
|
|
191
|
-
--out-file tx.raw
|
|
196
|
+
--certificate ${SP_NODE_ID}/pool-owner-delegation.cert \
|
|
197
|
+
--out-file ${SP_NODE_ID}/tx.raw
|
|
192
198
|
|
|
193
199
|
cardano-cli transaction sign \
|
|
194
|
-
--tx-body-file tx.raw \
|
|
200
|
+
--tx-body-file ${SP_NODE_ID}/tx.raw \
|
|
195
201
|
--signing-key-file "$genesisSKey" \
|
|
196
202
|
--signing-key-file "$stakeKey" \
|
|
197
203
|
--testnet-magic 888 \
|
|
198
|
-
--out-file tx.signed
|
|
204
|
+
--out-file ${SP_NODE_ID}/tx.signed
|
|
199
205
|
|
|
200
206
|
cardano-cli transaction submit \
|
|
201
|
-
--tx-file tx.signed \
|
|
207
|
+
--tx-file ${SP_NODE_ID}/tx.signed \
|
|
202
208
|
--testnet-magic 888
|
|
203
209
|
|
|
204
210
|
updatedBalance=$(getAddressBalance "$genesisAddr")
|
|
@@ -218,7 +224,7 @@ updatePool() {
|
|
|
218
224
|
cardano-cli stake-address delegation-certificate \
|
|
219
225
|
--stake-verification-key-file "$delegatorStakeKey" \
|
|
220
226
|
--stake-pool-id "$POOL_ID" \
|
|
221
|
-
--out-file deleg.cert
|
|
227
|
+
--out-file ${SP_NODE_ID}/deleg.cert
|
|
222
228
|
|
|
223
229
|
utxo=$(cardano-cli query utxo --address "$paymentAddr" --testnet-magic 888 | awk 'NR == 3 {printf("%s#%s", $1, $2)}')
|
|
224
230
|
|
|
@@ -227,17 +233,17 @@ updatePool() {
|
|
|
227
233
|
--tx-out "$paymentAddr"+0 \
|
|
228
234
|
--invalid-hereafter 5000000 \
|
|
229
235
|
--fee 0 \
|
|
230
|
-
--out-file tx.tmp \
|
|
231
|
-
--certificate deleg.cert
|
|
236
|
+
--out-file ${SP_NODE_ID}/tx.tmp \
|
|
237
|
+
--certificate ${SP_NODE_ID}/deleg.cert
|
|
232
238
|
|
|
233
239
|
fee=$(cardano-cli transaction calculate-min-fee \
|
|
234
|
-
--tx-body-file tx.tmp \
|
|
240
|
+
--tx-body-file ${SP_NODE_ID}/tx.tmp \
|
|
235
241
|
--tx-in-count 1 \
|
|
236
242
|
--tx-out-count 1 \
|
|
237
243
|
--testnet-magic 888 \
|
|
238
244
|
--witness-count 2 \
|
|
239
245
|
--byron-witness-count 0 \
|
|
240
|
-
--protocol-params-file
|
|
246
|
+
--protocol-params-file ${SP_NODE_ID}/params.json | awk '{ print $1 }')
|
|
241
247
|
|
|
242
248
|
initialBalance=$(getAddressBalance "$paymentAddr")
|
|
243
249
|
txOut=$((initialBalance - fee))
|
|
@@ -247,18 +253,18 @@ updatePool() {
|
|
|
247
253
|
--tx-out "$paymentAddr"+"$txOut" \
|
|
248
254
|
--invalid-hereafter 5000000 \
|
|
249
255
|
--fee "$fee" \
|
|
250
|
-
--certificate-file deleg.cert \
|
|
251
|
-
--out-file tx.raw
|
|
256
|
+
--certificate-file ${SP_NODE_ID}/deleg.cert \
|
|
257
|
+
--out-file ${SP_NODE_ID}/tx.raw
|
|
252
258
|
|
|
253
259
|
cardano-cli transaction sign \
|
|
254
|
-
--tx-body-file tx.raw \
|
|
260
|
+
--tx-body-file ${SP_NODE_ID}/tx.raw \
|
|
255
261
|
--signing-key-file "$delegatorPaymentSKey" \
|
|
256
262
|
--signing-key-file "$delegatorStakeSKey" \
|
|
257
263
|
--testnet-magic 888 \
|
|
258
|
-
--out-file tx.signed
|
|
264
|
+
--out-file ${SP_NODE_ID}/tx.signed
|
|
259
265
|
|
|
260
266
|
cardano-cli transaction submit \
|
|
261
|
-
--tx-file tx.signed \
|
|
267
|
+
--tx-file ${SP_NODE_ID}/tx.signed \
|
|
262
268
|
--testnet-magic 888
|
|
263
269
|
|
|
264
270
|
updatedBalance=$(getAddressBalance "$paymentAddr")
|
|
@@ -287,7 +293,7 @@ updatePool() {
|
|
|
287
293
|
--pool-relay-port 300"$SP_NODE_ID" \
|
|
288
294
|
--metadata-url "${METADATA_URL}" \
|
|
289
295
|
--metadata-hash "${METADATA_HASH}" \
|
|
290
|
-
--out-file pool.cert
|
|
296
|
+
--out-file ${SP_NODE_ID}/pool.cert
|
|
291
297
|
else
|
|
292
298
|
cardano-cli stake-pool registration-certificate \
|
|
293
299
|
--cold-verification-key-file "$coldVKey" \
|
|
@@ -300,7 +306,7 @@ updatePool() {
|
|
|
300
306
|
--testnet-magic 888 \
|
|
301
307
|
--pool-relay-ipv4 127.0.0.1 \
|
|
302
308
|
--pool-relay-port 300"$SP_NODE_ID" \
|
|
303
|
-
--out-file pool.cert
|
|
309
|
+
--out-file ${SP_NODE_ID}/pool.cert
|
|
304
310
|
fi
|
|
305
311
|
|
|
306
312
|
utxo=$(cardano-cli query utxo --address "$paymentAddr" --testnet-magic 888 | awk 'NR == 3 {printf("%s#%s", $1, $2)}')
|
|
@@ -310,17 +316,17 @@ updatePool() {
|
|
|
310
316
|
--tx-out "$paymentAddr"+"$txOut" \
|
|
311
317
|
--invalid-hereafter 500000 \
|
|
312
318
|
--fee 0 \
|
|
313
|
-
--certificate-file pool.cert \
|
|
314
|
-
--out-file tx.tmp
|
|
319
|
+
--certificate-file ${SP_NODE_ID}/pool.cert \
|
|
320
|
+
--out-file ${SP_NODE_ID}/tx.tmp
|
|
315
321
|
|
|
316
322
|
fee=$(cardano-cli transaction calculate-min-fee \
|
|
317
|
-
--tx-body-file tx.tmp \
|
|
323
|
+
--tx-body-file ${SP_NODE_ID}/tx.tmp \
|
|
318
324
|
--tx-in-count 1 \
|
|
319
325
|
--tx-out-count 1 \
|
|
320
326
|
--testnet-magic 888 \
|
|
321
327
|
--witness-count 3 \
|
|
322
328
|
--byron-witness-count 0 \
|
|
323
|
-
--protocol-params-file
|
|
329
|
+
--protocol-params-file ${SP_NODE_ID}/params.json | awk '{ print $1 }')
|
|
324
330
|
|
|
325
331
|
initialBalance=$(getAddressBalance "$paymentAddr")
|
|
326
332
|
txOut=$((initialBalance - fee))
|
|
@@ -330,19 +336,19 @@ updatePool() {
|
|
|
330
336
|
--tx-out "$paymentAddr"+"$txOut" \
|
|
331
337
|
--invalid-hereafter 500000 \
|
|
332
338
|
--fee "$fee" \
|
|
333
|
-
--certificate-file pool.cert \
|
|
334
|
-
--out-file tx.raw
|
|
339
|
+
--certificate-file ${SP_NODE_ID}/pool.cert \
|
|
340
|
+
--out-file ${SP_NODE_ID}/tx.raw
|
|
335
341
|
|
|
336
342
|
cardano-cli transaction sign \
|
|
337
|
-
--tx-body-file tx.raw \
|
|
343
|
+
--tx-body-file ${SP_NODE_ID}/tx.raw \
|
|
338
344
|
--signing-key-file "$delegatorPaymentSKey" \
|
|
339
345
|
--signing-key-file "$coldKey" \
|
|
340
346
|
--signing-key-file "$stakeKey" \
|
|
341
347
|
--testnet-magic 888 \
|
|
342
|
-
--out-file tx.signed
|
|
348
|
+
--out-file ${SP_NODE_ID}/tx.signed
|
|
343
349
|
|
|
344
350
|
cardano-cli transaction submit \
|
|
345
|
-
--tx-file tx.signed \
|
|
351
|
+
--tx-file ${SP_NODE_ID}/tx.signed \
|
|
346
352
|
--testnet-magic 888
|
|
347
353
|
|
|
348
354
|
updatedBalance=$(getAddressBalance "$paymentAddr")
|
|
@@ -366,10 +372,10 @@ deregisterPool() {
|
|
|
366
372
|
done
|
|
367
373
|
|
|
368
374
|
# get the protocol parameters
|
|
369
|
-
cardano-cli query protocol-parameters --testnet-magic 888 --out-file params.json
|
|
375
|
+
cardano-cli query protocol-parameters --testnet-magic 888 --out-file ${SP_NODE_ID}/params.json
|
|
370
376
|
|
|
371
|
-
genesisVKey=network-files/utxo-keys/
|
|
372
|
-
genesisSKey=network-files/utxo-keys/
|
|
377
|
+
genesisVKey=network-files/utxo-keys/utxo${SP_NODE_ID}.vkey
|
|
378
|
+
genesisSKey=network-files/utxo-keys/utxo${SP_NODE_ID}.skey
|
|
373
379
|
genesisAddr=$(cardano-cli address build --payment-verification-key-file "$genesisVKey" --testnet-magic 888)
|
|
374
380
|
stakeKey=network-files/pools/staking-reward"${SP_NODE_ID}".skey
|
|
375
381
|
coldVKey=network-files/pools/cold"${SP_NODE_ID}".vkey
|
|
@@ -391,7 +397,7 @@ deregisterPool() {
|
|
|
391
397
|
cardano-cli stake-address delegation-certificate \
|
|
392
398
|
--stake-verification-key-file "$delegatorStakeKey" \
|
|
393
399
|
--stake-pool-id "$POOL_ID" \
|
|
394
|
-
--out-file deleg.cert
|
|
400
|
+
--out-file ${SP_NODE_ID}/deleg.cert
|
|
395
401
|
|
|
396
402
|
utxo=$(cardano-cli query utxo --address "$paymentAddr" --testnet-magic 888 | awk 'NR == 3 {printf("%s#%s", $1, $2)}')
|
|
397
403
|
|
|
@@ -400,17 +406,17 @@ deregisterPool() {
|
|
|
400
406
|
--tx-out "$paymentAddr"+0 \
|
|
401
407
|
--invalid-hereafter 5000000 \
|
|
402
408
|
--fee 0 \
|
|
403
|
-
--out-file tx.tmp \
|
|
404
|
-
--certificate deleg.cert
|
|
409
|
+
--out-file ${SP_NODE_ID}/tx.tmp \
|
|
410
|
+
--certificate ${SP_NODE_ID}/deleg.cert
|
|
405
411
|
|
|
406
412
|
fee=$(cardano-cli transaction calculate-min-fee \
|
|
407
|
-
--tx-body-file tx.tmp \
|
|
413
|
+
--tx-body-file ${SP_NODE_ID}/tx.tmp \
|
|
408
414
|
--tx-in-count 1 \
|
|
409
415
|
--tx-out-count 1 \
|
|
410
416
|
--testnet-magic 888 \
|
|
411
417
|
--witness-count 2 \
|
|
412
418
|
--byron-witness-count 0 \
|
|
413
|
-
--protocol-params-file
|
|
419
|
+
--protocol-params-file ${SP_NODE_ID}/params.json | awk '{ print $1 }')
|
|
414
420
|
|
|
415
421
|
initialBalance=$(getAddressBalance "$paymentAddr")
|
|
416
422
|
txOut=$((initialBalance - fee))
|
|
@@ -420,18 +426,18 @@ deregisterPool() {
|
|
|
420
426
|
--tx-out "$paymentAddr"+"$txOut" \
|
|
421
427
|
--invalid-hereafter 5000000 \
|
|
422
428
|
--fee "$fee" \
|
|
423
|
-
--certificate-file deleg.cert \
|
|
424
|
-
--out-file tx.raw
|
|
429
|
+
--certificate-file ${SP_NODE_ID}/deleg.cert \
|
|
430
|
+
--out-file ${SP_NODE_ID}/tx.raw
|
|
425
431
|
|
|
426
432
|
cardano-cli transaction sign \
|
|
427
|
-
--tx-body-file tx.raw \
|
|
433
|
+
--tx-body-file ${SP_NODE_ID}/tx.raw \
|
|
428
434
|
--signing-key-file "$delegatorPaymentSKey" \
|
|
429
435
|
--signing-key-file "$delegatorStakeSKey" \
|
|
430
436
|
--testnet-magic 888 \
|
|
431
|
-
--out-file tx.signed
|
|
437
|
+
--out-file ${SP_NODE_ID}/tx.signed
|
|
432
438
|
|
|
433
439
|
cardano-cli transaction submit \
|
|
434
|
-
--tx-file tx.signed \
|
|
440
|
+
--tx-file ${SP_NODE_ID}/tx.signed \
|
|
435
441
|
--testnet-magic 888
|
|
436
442
|
|
|
437
443
|
updatedBalance=$(getAddressBalance "$paymentAddr")
|
|
@@ -448,7 +454,7 @@ deregisterPool() {
|
|
|
448
454
|
cardano-cli stake-pool deregistration-certificate \
|
|
449
455
|
--cold-verification-key-file "$coldVKey" \
|
|
450
456
|
--epoch "$RETIRING_EPOCH" \
|
|
451
|
-
--out-file pool.dereg
|
|
457
|
+
--out-file ${SP_NODE_ID}/pool.dereg
|
|
452
458
|
|
|
453
459
|
utxo=$(cardano-cli query utxo --address "$genesisAddr" --testnet-magic 888 | awk 'NR == 3 {printf("%s#%s", $1, $2)}')
|
|
454
460
|
|
|
@@ -457,17 +463,17 @@ deregisterPool() {
|
|
|
457
463
|
--tx-out "$genesisAddr"+0 \
|
|
458
464
|
--invalid-hereafter 500000 \
|
|
459
465
|
--fee 0 \
|
|
460
|
-
--certificate-file pool.dereg \
|
|
461
|
-
--out-file tx.tmp
|
|
466
|
+
--certificate-file ${SP_NODE_ID}/pool.dereg \
|
|
467
|
+
--out-file ${SP_NODE_ID}/tx.tmp
|
|
462
468
|
|
|
463
469
|
fee=$(cardano-cli transaction calculate-min-fee \
|
|
464
|
-
--tx-body-file tx.tmp \
|
|
470
|
+
--tx-body-file ${SP_NODE_ID}/tx.tmp \
|
|
465
471
|
--tx-in-count 1 \
|
|
466
472
|
--tx-out-count 1 \
|
|
467
473
|
--testnet-magic 888 \
|
|
468
474
|
--witness-count 3 \
|
|
469
475
|
--byron-witness-count 0 \
|
|
470
|
-
--protocol-params-file
|
|
476
|
+
--protocol-params-file ${SP_NODE_ID}/params.json | awk '{ print $1 }')
|
|
471
477
|
|
|
472
478
|
initialBalance=$(getAddressBalance "$genesisAddr")
|
|
473
479
|
txOut=$((initialBalance - fee))
|
|
@@ -477,19 +483,19 @@ deregisterPool() {
|
|
|
477
483
|
--tx-out "$genesisAddr"+"$txOut" \
|
|
478
484
|
--invalid-hereafter 500000 \
|
|
479
485
|
--fee "$fee" \
|
|
480
|
-
--certificate-file pool.dereg \
|
|
481
|
-
--out-file tx.raw
|
|
486
|
+
--certificate-file ${SP_NODE_ID}/pool.dereg \
|
|
487
|
+
--out-file ${SP_NODE_ID}/tx.raw
|
|
482
488
|
|
|
483
489
|
cardano-cli transaction sign \
|
|
484
|
-
--tx-body-file tx.raw \
|
|
490
|
+
--tx-body-file ${SP_NODE_ID}/tx.raw \
|
|
485
491
|
--signing-key-file "$genesisSKey" \
|
|
486
492
|
--signing-key-file "$coldKey" \
|
|
487
493
|
--signing-key-file "$stakeKey" \
|
|
488
494
|
--testnet-magic 888 \
|
|
489
|
-
--out-file tx.signed
|
|
495
|
+
--out-file ${SP_NODE_ID}/tx.signed
|
|
490
496
|
|
|
491
497
|
cardano-cli transaction submit \
|
|
492
|
-
--tx-file tx.signed \
|
|
498
|
+
--tx-file ${SP_NODE_ID}/tx.signed \
|
|
493
499
|
--testnet-magic 888
|
|
494
500
|
|
|
495
501
|
updatedBalance=$(getAddressBalance "$genesisAddr")
|
|
@@ -8,6 +8,11 @@ here="$(cd "$(dirname "$0")" >/dev/null 2>&1 && pwd)"
|
|
|
8
8
|
root="$(cd "$here/.." && pwd)"
|
|
9
9
|
cd "$root"
|
|
10
10
|
|
|
11
|
+
healthy() {
|
|
12
|
+
sleep 20
|
|
13
|
+
touch ./network-files/run/healthy
|
|
14
|
+
}
|
|
15
|
+
|
|
11
16
|
export PATH=$PWD/bin:$PATH
|
|
12
17
|
|
|
13
18
|
source ./scripts/nodes-configuration.sh
|
|
@@ -21,12 +26,9 @@ trap 'kill 0' INT
|
|
|
21
26
|
echo "Run"
|
|
22
27
|
./scripts/make-babbage.sh
|
|
23
28
|
./network-files/run/all.sh &
|
|
29
|
+
healthy &
|
|
24
30
|
|
|
25
|
-
|
|
26
|
-
if [ -f "./scripts/pools/update-node-sp$ID.sh" ]; then # Only update the pool if a script exists for that pool.
|
|
27
|
-
CARDANO_NODE_SOCKET_PATH=$PWD/network-files/node-sp"$ID"/node.sock ./scripts/pools/update-node-sp"$ID".sh
|
|
28
|
-
fi
|
|
29
|
-
done
|
|
31
|
+
./scripts/update-stake-pools.sh.sh "$SP_NODES_ID"
|
|
30
32
|
|
|
31
33
|
CARDANO_NODE_SOCKET_PATH=$PWD/network-files/node-sp1/node.sock ./scripts/plutus-transaction.sh
|
|
32
34
|
CARDANO_NODE_SOCKET_PATH=$PWD/network-files/node-sp1/node.sock ./scripts/reference-input-transaction.sh
|
|
@@ -34,4 +36,6 @@ CARDANO_NODE_SOCKET_PATH=$PWD/network-files/node-sp1/node.sock ./scripts/mint-to
|
|
|
34
36
|
CARDANO_NODE_SOCKET_PATH=$PWD/network-files/node-sp1/node.sock ./scripts/setup-wallets.sh
|
|
35
37
|
CARDANO_NODE_SOCKET_PATH=$PWD/network-files/node-sp1/node.sock ./scripts/mint-handles.sh
|
|
36
38
|
|
|
39
|
+
touch ./network-files/run/done
|
|
40
|
+
|
|
37
41
|
wait
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
|
|
5
|
+
SP_NODES_ID="$1"
|
|
6
|
+
|
|
7
|
+
for ID in ${SP_NODES_ID}; do
|
|
8
|
+
if [ -f "./scripts/pools/update-node-sp$ID.sh" ]; then # Only update the pool if a script exists for that pool.
|
|
9
|
+
CARDANO_NODE_SOCKET_PATH=$PWD/network-files/node-sp"$ID"/node.sock ./scripts/pools/update-node-sp"$ID".sh &
|
|
10
|
+
fi
|
|
11
|
+
done
|
|
12
|
+
|
|
13
|
+
wait
|