Skip to content

Commit

Permalink
test state sync
Browse files Browse the repository at this point in the history
  • Loading branch information
dasanchez committed Jan 3, 2025
1 parent dc86dca commit 2a19c4e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 25 deletions.
4 changes: 0 additions & 4 deletions scripts/setup_state_sync_node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,3 @@ echo "> Restarting nodes."
sleep 15
./start.sh
sleep 15
echo "> Val 1:"
tail -n 200 ${logs[0]}
echo "> Val n:"
tail -n 200 ${logs[-1]}
22 changes: 1 addition & 21 deletions tests/test_state_sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ $CHAIN_BINARY init statesync --chain-id $CHAIN_ID --home $home &> /dev/null
echo "> Copying genesis"
cp ${homes[0]}/config/genesis.json $home/config/genesis.json

echo "> Peer app.toml:"
cat ${homes[0]}/config/app.toml
echo "> Peer config.toml:"
cat ${homes[0]}/config/config.toml

echo "> Wait for state sync snapshot ($[ $TIMEOUT_COMMIT*$STATE_SYNC_INTERVAL ]s)"
sleep $[ $TIMEOUT_COMMIT*$STATE_SYNC_INTERVAL ]

Expand Down Expand Up @@ -82,8 +77,6 @@ toml set --toml-path $home/config/config.toml statesync.enable true
toml set --toml-path $home/config/config.toml statesync.rpc_servers "http://127.0.0.1:${rpc_ports[-1]},http://127.0.0.1:${rpc_ports[-1]}"
toml set --toml-path $home/config/config.toml statesync.trust_height $height
toml set --toml-path $home/config/config.toml statesync.trust_hash $hash
echo "> Test node config.toml:"
cat $home/config/config.toml

echo "> Starting state sync node"
tmux new-session -d -s statesync "$CHAIN_BINARY start --home $home 2>&1 | tee $log"
Expand All @@ -92,20 +85,7 @@ sleep 120
catching_up=$(curl -s http://localhost:$rpc_port/status | jq -r .result.sync_info.catching_up)
echo "> Catching up: $catching_up"


# tail -n 10 $log
# tail -n 10 ${logs[-1]}

# until [ "$catching_up" = "false" ]
# do
# sleep $TIMEOUT_COMMIT
# catching_up=$(curl -s http://localhost:$rpc_port/status | jq -r .result.sync_info.catching_up)
# echo "> Catching up: $catching_up"
# echo "> Test node log:"
# tail -n 10 $log
# # echo "> State sync node log:"
# # tail -n 10 ${logs[-1]}
# done
tmux send-keys -t statesync C-c

if [ $catching_up != "false" ]; then
echo "Node did not sync."
Expand Down

0 comments on commit 2a19c4e

Please sign in to comment.