Last active
March 30, 2023 10:01
-
-
Save Fible1/abc4317c4f381f9168210fac7f5350cf to your computer and use it in GitHub Desktop.
A self install script for Celestia Network. The script will update the node, install all dependencies, init and then start the node on systemd. Be sure to copy your Mnemonic!
This file contains 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
#!/bin/bash | |
#use on Ubuntu 20.04 | |
# Pre-Install | |
sudo apt update -y | |
sleep 2 | |
DEBIAN_FRONTEND=noninteractive sudo apt upgrade -y | |
sleep 2 | |
# Dependencies | |
sudo apt install curl tar wget clang pkg-config libssl-dev jq build-essential git make ncdu -y | |
# Install Go | |
ver="1.19.1" | |
cd $HOME | |
wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz" | |
sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz" | |
rm "go$ver.linux-amd64.tar.gz" | |
# Add Go BIN to PATH | |
sleep 1 | |
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile | |
sleep 2 | |
source $HOME/.bash_profile | |
# Ensure $GOPATH is set | |
if [ -z "$GOPATH" ]; then | |
export GOPATH="$HOME/go" | |
echo "export GOPATH=$GOPATH" >> $HOME/.bashrc | |
source $HOME/.bashrc | |
fi | |
# Install Celestia-Node | |
cd $HOME | |
rm -rf celestia-node | |
git clone https://github.com/celestiaorg/celestia-node.git | |
cd celestia-node/ | |
git checkout tags/v0.8.0-rc1 | |
make build | |
make install | |
# Init | |
celestia light init --p2p.network blockspacerace | |
sleep 5 | |
sudo tee <<EOF >/dev/null /etc/systemd/system/celestia-lightd.service | |
[Unit] | |
Description=celestia-lightd Light Node | |
After=network-online.target | |
[Service] | |
User=root | |
ExecStart=celestia light start --core.ip https://rpc-blockspacerace.pops.one --core.rpc.port 26657 --core.grpc.port 9090 --keyring.accname my_celes_key --metrics.tls=false --metrics --metrics.endpoint otel.celestia.tools:4318 --gateway --gateway.addr localhost --gateway.port 26659 --p2p.network blockspacerace --metrics.tls=false --metrics --metrics.endpoint otel.celestia.tools:4318 | |
Restart=on-failure | |
RestartSec=3 | |
LimitNOFILE=4096 | |
[Install] | |
WantedBy=multi-user.target | |
EOF | |
echo "Write down your seed or come back here after the script finishes!!! The script will now start the node, check that the node is syncing after a few minutes and you are done." | |
sleep 12 | |
sudo systemctl enable celestia-lightd | |
sleep 2 | |
sudo systemctl restart celestia-lightd | |
sleep 2 | |
sudo journalctl -u celestia-lightd.service -f |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment