Skip to content

Commit a75a7ab

Browse files
Allow to start syncing from slot 0
1 parent 15e76b1 commit a75a7ab

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

scripts/genesis-benchmarks/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ $ NUM_SLOTS=155000 ENABLE_GENESIS=1 ./run-syncing-node.sh 30
7979
The initial slot of the range is harder to change because the startup of the
8080
node is optimized with a snapshot of the ledger at slot 100007913. Generating a
8181
snapshot for a different slot would make it possible to start the range from
82-
it.
82+
it. But one can start syncing from slot 0 with,
83+
84+
```
85+
$ SYNC_FROM_0=1 NUM_SLOTS=155000 ./run-syncing-node.sh 1
86+
```
8387

8488
### How to collect the eventlog of the syncing node
8589

scripts/genesis-benchmarks/run-syncing-node.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,14 @@ generate_topology_json_legacy() {
8080
echo '{"localRoots": [], "publicRoots": [], "Producers": [' ${TOPOLOGY_ARR[*]} ']}' > $OUTPUT
8181
}
8282

83-
truncate_chaindb
83+
START_SLOT=100007913
84+
if [ -v SYNC_FROM_0 ]
85+
then
86+
START_SLOT=0
87+
rm -rf $NODE_DB
88+
else
89+
truncate_chaindb
90+
fi
8491
generate_topology_json_p2p $TOPOLOGY_JSON
8592

8693
CABAL_FLAGS=${CABAL_FLAGS:-}
@@ -92,7 +99,7 @@ CABAL_FLAGS=${CABAL_FLAGS:-}
9299
--topology $TOPOLOGY_JSON \
93100
--host-addr 0.0.0.0 --port 3002 \
94101
--socket-path $NODE_DIR/node.socket \
95-
--shutdown-on-slot-synced $((100007913 + ${NUM_SLOTS:-50000})) \
102+
--shutdown-on-slot-synced $((${START_SLOT} + ${NUM_SLOTS:-50000})) \
96103
+RTS -s ${CARDANO_NODE_RTS_FLAGS:-} \
97104
| tee $NODE_DIR/logs/sync-$(date -Iseconds).json" \
98105
)

0 commit comments

Comments
 (0)