Skip to content

Commit c0abc26

Browse files
committed
refactor(e2e): reduce the initial delay in local-network from one to half epoch
1 parent 4933352 commit c0abc26

File tree

2 files changed

+21
-22
lines changed

2 files changed

+21
-22
lines changed

packages/e2e/local-network/scripts/setup-new-delegator-keys.sh

-5
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,6 @@ AMOUNT_PER_DELEGATOR='500000000000' # 500K ADA
6363
mkdir -p "$TRANSACTIONS_DIR"
6464
mkdir -p "$DELEGATORS_DIR"
6565

66-
while [ ! -S "$CARDANO_NODE_SOCKET_PATH" ]; do
67-
echo "setup-new-delegator-keys.sh: CARDANO_NODE_SOCKET_PATH: $CARDANO_NODE_SOCKET_PATH file doesn't exist, waiting..."
68-
sleep 2
69-
done
70-
7166
# ----------------------
7267

7368
# GENERATE NEW PAYMENT KEYS

packages/e2e/local-network/scripts/start.sh

+21-17
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,9 @@ here="$(cd "$(dirname "$0")" >/dev/null 2>&1 && pwd)"
88
root="$(cd "$here/.." && pwd)"
99
cd "$root"
1010

11-
waitForEpoch1() {
12-
while [ `CARDANO_NODE_SOCKET_PATH=$PWD/network-files/node-sp1/node.sock cardano-cli query tip --testnet-magic 888 | jq -r .epoch` == "0" ] ; do
13-
sleep 5
14-
done
15-
}
16-
1711
healthy() {
18-
sleep 20
19-
waitForEpoch1
12+
# For some unknown reasons, if started before half of first epoch, db-sync doesn't sync
13+
while [ `cardano-cli query tip --testnet-magic 888 | jq .slot` -lt 500 ] ; do sleep 1 ; done
2014
touch ./network-files/run/healthy
2115
}
2216

@@ -33,19 +27,29 @@ trap 'kill 0' INT
3327
echo "Run"
3428
./scripts/make-babbage.sh
3529
./network-files/run/all.sh &
36-
CARDANO_NODE_SOCKET_PATH=$PWD/network-files/node-sp1/node.sock ./scripts/setup-new-delegator-keys.sh
30+
31+
export CARDANO_NODE_SOCKET_PATH=$PWD/network-files/node-sp1/node.sock
32+
33+
while [ ! -S "$CARDANO_NODE_SOCKET_PATH" ]; do
34+
echo "start.sh: CARDANO_NODE_SOCKET_PATH: $CARDANO_NODE_SOCKET_PATH file doesn't exist, waiting..."
35+
sleep 1
36+
done
37+
38+
while [ `cardano-cli query tip --testnet-magic 888 | jq .block` == null ] ; do
39+
echo "start.sh: WAIT_FOR_TIP: Waiting for a tip..."
40+
sleep 1
41+
done
42+
3743
healthy &
3844

45+
./scripts/setup-new-delegator-keys.sh
3946
./scripts/update-stake-pools.sh.sh "$SP_NODES_ID"
4047

41-
CARDANO_NODE_SOCKET_PATH=$PWD/network-files/node-sp1/node.sock ./scripts/plutus-transaction.sh
42-
CARDANO_NODE_SOCKET_PATH=$PWD/network-files/node-sp1/node.sock ./scripts/reference-input-transaction.sh
43-
CARDANO_NODE_SOCKET_PATH=$PWD/network-files/node-sp1/node.sock ./scripts/mint-tokens.sh
44-
CARDANO_NODE_SOCKET_PATH=$PWD/network-files/node-sp1/node.sock ./scripts/setup-wallets.sh
45-
CARDANO_NODE_SOCKET_PATH=$PWD/network-files/node-sp1/node.sock ./scripts/mint-handles.sh
46-
47-
waitForEpoch1
48-
sleep 50
48+
./scripts/plutus-transaction.sh
49+
./scripts/reference-input-transaction.sh
50+
./scripts/mint-tokens.sh
51+
./scripts/setup-wallets.sh
52+
./scripts/mint-handles.sh
4953

5054
touch ./network-files/run/done
5155

0 commit comments

Comments
 (0)