Light Node
Setting up a light node
Server preparation
sudo apt update && sudo apt upgrade -y
sudo apt install curl git wget htop tmux build-essential jq make gcc tar clang pkg-config libssl-dev ncdu -yGO 1.23.1
ver="1.23.1"
wget "https://golang.org/dl/go$ver.linux-amd64.tar.gz"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "go$ver.linux-amd64.tar.gz"
rm "go$ver.linux-amd64.tar.gz"
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile
source $HOME/.bash_profile
go versionInstall Celestia-node
cd $HOME
rm -rf celestia-node
git clone https://github.com/celestiaorg/celestia-node.git
cd celestia-node/
git checkout tags/v0.28.2
make build
sudo make install
make cel-keyConfig and init app
celestia light initCreate wallet
KEY_NAME="my_celes_key"
cd ~/celestia-node
./cel-key add $KEY_NAME --keyring-backend test --node.type light(Optional) Restore an existing cel_key
KEY_NAME="my_celes_key"
cd ~/celestia-node
./cel-key add $KEY_NAME --keyring-backend test --node.type lightYou can find the address by running the following command in the celestia-node directory
cd $HOME/celestia-node
./cel-key list --node.type light --keyring-backend testAdd Consensus node RPC and gRPC ports
CORE_IP="<PUT_CONSENSUS_NODE_IP>"
CORE_RPC_PORT="<PUT_CONSENSUS_NODE_RPC_PORT>"
CORE_GRPC_PORT="<PUT_CONSENSUS_NODE_GRPC_PORT>"
KEY_NAME="my_celes_key"Create Service file
sudo tee /etc/systemd/system/celestia-light.service > /dev/null <<EOF
[Unit]
Description=celestia light
After=network-online.target
[Service]
User=$USER
ExecStart=$(which celestia) light start \
--core.ip $CORE_IP \
--core.rpc.port $CORE_RPC_PORT \
--core.grpc.port $CORE_GRPC_PORT \
--keyring.accname $KEY_NAME \
--metrics.tls=true \
--metrics --metrics.endpoint otel.celestia.observer
Restart=on-failure
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOFEnable and start service
sudo systemctl daemon-reload
sudo systemctl enable celestia-light
sudo systemctl restart celestia-light && sudo journalctl -u celestia-light -fo catGet your node information
NOTE: You can only generate an auth token after initializing and starting your celestia-node.
NODE_TYPE=light
AUTH_TOKEN=$(celestia $NODE_TYPE auth admin)Then you can get the peerId of your node with the following curl command
curl -X POST \
-H "Authorization: Bearer $AUTH_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":0,"method":"p2p.Info","params":[]}' \
http://localhost:26658Last updated