[Node] Run your CELESTIA Light Node
Celestia is the first modular blockchain network designed to address the scalability, security, and decentralization challenges of traditional blockchains by separating consensus, data availability, and execution layers. This approach allows for greater flexibility, enabling developers to build customized blockchains and applications with improved efficiency and lower costs. By supporting features like optimistic rollups and interoperability, Celestia aims to become a foundational infrastructure layer for the next generation of decentralized applications, paving the way for a more scalable and connected blockchain ecosystem.
They released a guide on setting up a Celestia light node with a wallet, enabling you to perform data availability sampling (DAS) within Celestia’s data availability (DA) network. Light nodes ensure data availability : this is the most common way to interact with Celestia networks ! Running a node during the incentivized testnet was very profitable : participants earned several thousand TIA (>100,000$ at ATH), so many of you have asked me how to set up a light node ! So in this guide, we will explore and understand how to launch a light node on Celestia.
Welcome to 0x5cience ! Here, you will learn and understand how to set up your node easily and quickly, without any prior technical knowledge.
Feel free to follow us on Twitter to stay updated on everything related to nodes and join our Discord with more than 700 members for further discussion or any questions with our community !
VPS configuration
To run a node you’ll need a VPS (Virtual Private Server) and one of the most reliable and cheapest solutions is Contabo. It’s a cost-effective German VPS solution built in 2003, known for its robust performance and reliability, catering to a wide range of computing needs and budgets.
The following minimum hardware requirements are recommended for running a light node:
Memory: 500 MB RAM (minimum)
CPU: Single Core
Disk: 100 GB SSD Storage
Bandwidth: 56 Kbps for Download/56 Kbps for Upload
You can choose the CLOUD VPS 2 by clicking here. Note that you can opt for a more powerful server (VPS 3 or 4) to run multiple different nodes on it more economically.
Once payment is complete, you’ll receive an e-mail with your IP address entitled “Your login data!”. To connect to your VPS and securely run your node, you must download and install the Putty software, which enables a secure connection.
Ensure you copy each command line using (Ctrl+C), and then paste it into your terminal by right-clicking your mouse. Execute them sequentially, pressing Enter after each, if required.
I) Install dependencies
Start by updating and upgrading your OS.
sudo apt update && sudo apt upgrade -y
Then install essential packages that are necessary to execute many tasks like downloading files, compiling, and monitoring the node:
sudo apt install curl tar wget aria2 clang pkg-config libssl-dev jq build-essential \
git make ncdu -y
curl
: A tool to transfer data from or to a server, supporting various protocols.tar
: A utility to create, maintain, and extract archives.wget
: A utility to download files from the web via HTTP, HTTPS, and FTP.aria2
: A command-line utility for downloading files, which supports multiple protocols and concurrent connections.clang
: A compiler for C, C++, and other languages, part of the LLVM project.pkg-config
: A tool to help in compiling applications and managing library dependencies.libssl-dev
: Development files for SSL (Secure Sockets Layer) and TLS (Transport Layer Security) libraries, necessary for building software that uses SSL/TLS.jq
: A command-line tool for parsing and manipulating JSON data.build-essential
: A package containing essential tools for compiling software, including the GNU Compiler Collection (GCC), libraries, and other necessary tools.git
: A distributed version control system used to track changes in source code during software development.make
: A build automation tool that automatically builds executable programs and libraries from source code.ncdu
: A disk usage analyzer with an ncurses interface, useful for finding and analyzing disk space usage.
The -y
flag at the end of the apt install
command means that the installation of these packages will proceed without asking for confirmation, just like with apt-get upgrade
.
II) Install Golang
Celestia-node is written in Golang so we must install Golang to build and run our node. Set the version 1.22.0 for your desired network, download and install Golang.
cd $HOME
wget "https://golang.org/dl/go1.22.0.linux-amd64.tar.gz"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "go1.22.0.linux-amd64.tar.gz"
rm "go1.22.0.linux-amd64.tar.gz"
#1
: Changes your current directory to your home directory.#2
: Downloads the Go programming language binary package.#3
: Removes any existing Go installation.#4
: Extracts the downloaded Go archive to/usr/local
.#5
: Deletes the downloaded Go tarball after extraction.
Now let’s configure your environment so that the Go programming language’s executables are easily accessible from the command line.
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile
source $HOME/.bash_profile
#1
: Adds the Go binary directories to the user’sPATH
environment variable.#2
: Applies the changes made to.bash_profile
immediately in the current shell session without needing to log out and back in.
Verify the version.
go version
III) Installing from source
cd $HOME
rm -rf celestia-node
git clone https://github.com/celestiaorg/celestia-node.git
cd celestia-node/
#1
: Changes your current directory to your home directory.#2
: Removes any existingcelestia-node
directory.#3
: Downloads thecelestia-node
repository from GitHub.#4
: Changes the current directory to the newly clonedcelestia-node
directory.
git checkout tags/v0.14.1
- Switches your working directory to the version of the code that is associated with the
v0.14.1
tag.
Build and install the celestia binary then build the cel-key utility.
make build && make install && make cel-key
IV) Initialize the light node
Let’s initialize your light node.
celestia light init
This will show the location of your node store and config. It will also show confirmation that the node store has been initialized.
V) Start the light node
You can create a wallet for your node by running the following command. Do not forget to replace <key-name> by the name of your choice such as 0x5cience.
./cel-key add 0x5cience --keyring-backend test \
--node.type light --p2p.network celestia
#1
: creates a new key named0x5cience
using thecel-key
tool. Stores the key in a plaintext format using thetest
keyring backend (not secure for production).#2
: Configures the node as a light node, which is a less resource-intensive version of a blockchain node. Connects the node to the Celestia P2P network.
For the next part of the guide, you will need to get testnet tokens by using this command on the official Discord, where <CELESTIA-ADDRESS>
is the celestia1******
address generated when you created the wallet.
$request <CELESTIA-ADDRESS>
Let’s start your node by replacing <key-name> by the name you chose previously.
sudo tee /etc/systemd/system/celestia.service > /dev/null <<EOF
[Unit]
Description=Celestia Node
After=network.target
[Service]
User=root
ExecStart=/root/celestia-node/build/celestia light start --keyring.accname <key-name> \
--core.ip consensus.lunaroasis.net
Restart=always
RestartSec=3
LimitNOFILE=infinity
[Install]
WantedBy=multi-user.target
EOF
This set of commands creates a systemd service file for running a Celestia light node. The service is configured to start after the network is up, run the Celestia light node under the root
user, automatically restart if it fails, with no file descriptor limits.
Let’s initiate your Celestia light node as a systemd service, meaning it will continue running in the background, restart automatically on failure, and start up automatically when the system reboots.
systemctl daemon-reload
systemctl enable celestia
systemctl start celestia
#1
: reloads the systemd manager configuration. It is necessary to run this command after creating or modifying any service files (like thecelestia.service
file you created) because systemd needs to recognize the changes.#2
: enables thecelestia
service to start automatically at boot time.#3
: starts thecelestia
service immediately.
You can display the logs with :
journalctl -fu celestia
Congratulations, you’ve successfully run your Celestia light node !