-
Notifications
You must be signed in to change notification settings - Fork 417
refactor(scripts): combine block sync scripts #4833
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
rootulp
merged 8 commits into
celestiaorg:main
from
Arya-A-Nair:consolidate-block-sync-and-state-scripts
Jun 4, 2025
+71
−92
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
b1d78f9
refactor: combine block-sync scripts
Arya-A-Nair ac32ddd
fix: update block-sync script to support mainnet
Arya-A-Nair a97d041
fix: remove eval from block-sync script for cleaner execution
Arya-A-Nair f59b77a
fix: update block-sync script usage instructions for network names
Arya-A-Nair 9702395
Merge branch 'main' into consolidate-block-sync-and-state-scripts
Arya-A-Nair a2a1c15
fix: standardize network name to "Mainnet" in block-sync script
Arya-A-Nair 69e7802
Merge branch 'main' into consolidate-block-sync-and-state-scripts
rootulp abeb6b0
refactor: convert uppercase to lowercase network name
rootulp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#!/bin/sh | ||
|
||
# Start a consensus node and block sync from genesis to tip for Celestia networks (Arabica, Mocha, Mainnet) | ||
# Usage: ./scripts/block-sync.sh --network <Arabica | Mocha | Mainnet> | ||
|
||
set -o errexit | ||
set -o nounset | ||
|
||
# Default values | ||
NODE_NAME="${NODE_NAME:-node-name}" | ||
|
||
usage() { | ||
echo "Usage: $0 --network <arabica|mocha|mainnet>" | ||
exit 1 | ||
} | ||
|
||
if [ $# -ne 2 ] || [ "$1" != "--network" ]; then | ||
echo "No network provided, defaulting to mainnet" | ||
NETWORK="mainnet" | ||
else | ||
# Convert to lowercase | ||
NETWORK=$(echo "$2" | tr '[:upper:]' '[:lower:]') | ||
fi | ||
|
||
case "$NETWORK" in | ||
arabica) | ||
CHAIN_ID="arabica-11" | ||
SEEDS="827583022cc6ce65cf762115642258f937c954cd@validator-1.celestia-arabica-11.com:26656,74e42b39f512f844492ff09e30af23d54579b7bc@validator-2.celestia-arabica-11.com:26656,00d577159b2eb1f524ef9c37cb389c020a2c38d2@validator-3.celestia-arabica-11.com:26656,b2871b6dc2e18916d07264af0e87c456c2bba04f@validator-4.celestia-arabica-11.com:26656" | ||
;; | ||
mocha) | ||
CHAIN_ID="mocha-4" | ||
SEEDS="[email protected]:26656,258f523c96efde50d5fe0a9faeea8a3e83be22ca@seed.mocha-4.celestia.aviaone.com:20279,5d0bf034d6e6a8b5ee31a2f42f753f1107b3a00e@celestia-testnet-seed.itrocket.net:11656,7da0fb48d6ef0823bc9770c0c8068dd7c89ed4ee@celest-test-seed.theamsolutions.info:443" | ||
;; | ||
mainnet) | ||
CHAIN_ID="celestia" | ||
SEEDS="e6116822e1a5e283d8a85d3ec38f4d232274eaf3@consensus-full-seed-1.celestia-bootstrap.net:26656,cf7ac8b19ff56a9d47c75551bd4864883d1e24b5@consensus-full-seed-2.celestia-bootstrap.net:26656" | ||
;; | ||
*) | ||
echo "Unknown network: $NETWORK" | ||
usage | ||
;; | ||
esac | ||
|
||
CELESTIA_APP_HOME="${HOME}/.celestia-app" | ||
CELESTIA_APP_VERSION=$(celestia-appd version 2>&1) | ||
|
||
echo "celestia-app home: ${CELESTIA_APP_HOME}" | ||
echo "celestia-app version: ${CELESTIA_APP_VERSION}" | ||
echo "chain id: ${CHAIN_ID}" | ||
echo "" | ||
|
||
read -p "Are you sure you want to delete: $CELESTIA_APP_HOME? [y/n] " response | ||
if [ "$response" != "y" ]; then | ||
echo "You must delete $CELESTIA_APP_HOME to continue." | ||
exit 1 | ||
fi | ||
|
||
echo "Deleting $CELESTIA_APP_HOME..." | ||
rm -rf "$CELESTIA_APP_HOME" | ||
|
||
echo "Initializing config files..." | ||
celestia-appd init ${NODE_NAME} --chain-id ${CHAIN_ID} > /dev/null 2>&1 | ||
|
||
echo "Setting seeds in config.toml..." | ||
sed -i.bak -e "s/^seeds *=.*/seeds = \"$SEEDS\"/" $CELESTIA_APP_HOME/config/config.toml | ||
|
||
echo "Downloading genesis file..." | ||
celestia-appd download-genesis ${CHAIN_ID} > /dev/null 2>&1 # Hide output to reduce terminal noise | ||
|
||
echo "Starting celestia-appd..." | ||
celestia-appd start --force-no-bbr |
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.