Staking Guide for Celestia using the CLI
This guide will take you through a step-by-step journey on how to stake on Celestia using the CLI through the Celestia App.
Prerequisites:
a) Installing Golang on Mac:
Before we begin, ensure Golang is installed on your system. If it's already installed, skip to the next step.
b) Installing Dependencies:
First and foremost, we need Homebrew to install Golang. If you already have Homebrew, skip this step. If not, install it with the following command:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Then, set the Homebrew environment for your user profile:
echo '# Set PATH, MANPATH, etc., for Homebrew.' >> /Users/YOUR_USERNAME/.zprofile
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/YOUR_USERNAME/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
With Homebrew set up, let’s install the necessary tools: wget, jq, and git:
brew install wget jq git
c) Installing Golang:
To install Golang, use the following set of commands:
ver="1.21.3"
cd $HOME
wget "https://golang.org/dl/go$ver.darwin-arm64.tar.gz"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "go$ver.darwin-arm64.tar.gz"
rm "go$ver.darwin-arm64.tar.gz"
Next, add the Golang binaries to your system path:
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile
source $HOME/.bash_profile
Verify your installation by running:
go version
Expected output:
go version go1.21.1 darwin/arm64
1. Installing the Celestia App:
To communicate with the Celestia network, we'll install the `celestia-app`:
cd $HOME
rm -rf celestia-app
git clone https://github.com/celestiaorg/celestia-app.git
cd celestia-app/
git checkout tags/v1.3.0 -b v1.3.0
make install
Check if the binary was installed correctly:
celestia-appd --help
2. Creating a Wallet with Celestia App:
a) Setting up the Wallet:
Start by creating a CLI configuration file:
celestia-appd config keyring-backend os
Then, generate keys for your wallet. While you can choose any name, for this guide, we'll use celestia-staking-keys:
celestia-appd keys add celestia-staking-keys --interactive
Follow the instructions, and by the end, you should see a confirmation with your wallet's details. You can verify all added wallets using:
celestia-appd keys list
b) Funding the Wallet:
To start staking, your wallet needs funds. Please assing the desired amounnt of Tia to your wallet.
3. Delegating Tokens via CLI:
Before you delegate, ensure you've updated your configuration file's node value to `https://public-celestia-rpc.numia.xyz
:26657` located at `/celestia-app/config/client.toml`.
To delegate:
First, decide on the validator you wish to stake with. Their `celesvaloper` address can be found on the Celestia Staking page.
Go to Celestia Staking page, and find XPRV ( or go to XPRV’s page directly - XPRV NodeStake page )
Find the celesvaloper for XPRV on the page ( XPRV celesvaloper - celestiavaloper1nwu3ugynh8m6r7aphv0uxnca84t7gnruvyye9c )
Once you have the validator's address, execute:
celestia-appd tx staking delegate <VALIDATOR-ADDRESS> <AMOUNT> --from=<YOUR-WALLET-NAME> --chain-id=celestia --fees 21000utia
** (replacing <VALIDATOR-ADDRESS>, <AMOUNT>, and <YOUR-WALLET-NAME> with your values)
Approve the transaction when prompted, and upon confirmation, you've successfully staked your tokens on Celestia.
With that, you're all set! Happy staking on Celestia using the CLI