# Set node configuration
celestia-appd init $MONIKER --chain-id $CELESTIA_CHAIN_ID
celestia-appd config node tcp://localhost:$CELESTIA_PORT57
celestia-appd config keyring-backend os
# Set custom ports in client.toml
sed -i.bak -e "s%:26457%:${CELESTIA_PORT}57%g" $HOME/.celestia-app/config/client.toml
# Set custom ports in app.toml
sed -i.bak -e "s%:1317%:${CELESTIA_PORT}17%g;
s%:8080%:${CELESTIA_PORT}80%g;
s%:9090%:${CELESTIA_PORT}90%g;
s%:9091%:${CELESTIA_PORT}91%g;
s%:8545%:${CELESTIA_PORT}45%g;
s%:8546%:${CELESTIA_PORT}46%g;
s%:6065%:${CELESTIA_PORT}65%g" $HOME/.celestia-app/config/app.toml
# Set custom ports in config.toml file
sed -i.bak -e "s%:26658%:${CELESTIA_PORT}58%g;
s%:26657%:${CELESTIA_PORT}57%g;
s%:6060%:${CELESTIA_PORT}60%g;
s%:26656%:${CELESTIA_PORT}56%g;
s%^external_address = \"\"%external_address = \"$(wget -qO- eth0.me):${CELESTIA_PORT}56\"%;
s%:26660%:${CELESTIA_PORT}60%g" $HOME/.celestia-app/config/config.toml
# Download genesis and addrbook
wget -O $HOME/.celestia-app/config/genesis.json https://files.nodeshub.online/mainnet/celestia/genesis.json
wget -O $HOME/.celestia-app/config/addrbook.json https://files.nodeshub.online/mainnet/celestia/addrbook.json
# Add Seeds and Peers
SEEDS="6f6a3a908634b79b6fe7c4988efec2553f188234@celestia.test.seed.nodeshub.online:11656"
PEERS="daf2cecee2bd7f1b3bf94839f993f807c6b15fbf@celestia-testnet-peer.itrocket.net:11656,[email protected]:26679,[email protected]:26656,[email protected]:36656,[email protected]:11656,[email protected]:26656,[email protected]:11656,[email protected]:26630,[email protected]:26656,[email protected]:28656,[email protected]:26656,[email protected]:2400,[email protected]:11656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:36656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:27656"
sed -i -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.celestia-app/config/config.toml
# Set minimum gas price, Enable prometheus and disable indexing
sed -i -e "s|^minimum-gas-prices *=.*|minimum-gas-prices = \"0.002utia\"|" $HOME/.celestia-app/config/app.toml
sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $HOME/.celestia-app/config/config.toml
sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.celestia-app/config/config.toml
# Set pruning and indexer to Null
sed -i -e "s/^pruning *=.*/pruning = \"custom\"/" $HOME/.celestia-app/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"100\"/" $HOME/.celestia-app/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"50\"/" $HOME/.celestia-app/config/app.toml
sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $HOME/.celestia-app/config/config.toml