Development environment
This page will go over setting up your development environment to run Celestia software. This environment can be used for development, building binaries, and running nodes.
Install dependencies
If you are on Ubuntu, first update and upgrade your OS:
bashsudo apt update && sudo apt upgrade -y
sudo apt update && sudo apt upgrade -y
bashsudo yum update
sudo yum update
Install essential packages that are necessary to execute many tasks like downloading files, compiling, and monitoring the node:
bashsudo apt install curl tar wget clang pkg-config libssl-dev jq build-essential \ git make ncdu -y
sudo apt install curl tar wget clang pkg-config libssl-dev jq build-essential \ git make ncdu -y
bashsudo yum install curl tar wget clang pkg-config libssl-dev jq build-essential \ git make ncdu -y
sudo yum install curl tar wget clang pkg-config libssl-dev jq build-essential \ git make ncdu -y
bash# these commands are for installing Homebrew, wget and jq # follow the instructions from the output after running this command /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" # then install wget & jq brew install wget && brew install jq
# these commands are for installing Homebrew, wget and jq # follow the instructions from the output after running this command /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" # then install wget & jq brew install wget && brew install jq
Install Golang
celestia-node is written in Golang so we must install Golang to build and run our node.
Set the version for your desired network:
bashver="1.21.1"
ver="1.21.1"
bashver="1.21.1"
ver="1.21.1"
bashver="1.21.1"
ver="1.21.1"
Download and install Golang:
bashcd $HOME 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"
cd $HOME 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"
bashcd $HOME wget "https://golang.org/dl/go$ver.linux-arm64.tar.gz" sudo rm -rf /usr/local/go sudo tar -C /usr/local -xzf "go$ver.linux-arm64.tar.gz" rm "go$ver.linux-arm64.tar.gz"
cd $HOME wget "https://golang.org/dl/go$ver.linux-arm64.tar.gz" sudo rm -rf /usr/local/go sudo tar -C /usr/local -xzf "go$ver.linux-arm64.tar.gz" rm "go$ver.linux-arm64.tar.gz"
bashcd $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"
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"
bashcd $HOME wget "https://golang.org/dl/go$ver.darwin-amd64.tar.gz" sudo rm -rf /usr/local/go sudo tar -C /usr/local -xzf "go$ver.darwin-amd64.tar.gz" rm "go$ver.darwin-amd64.tar.gz"
cd $HOME wget "https://golang.org/dl/go$ver.darwin-amd64.tar.gz" sudo rm -rf /usr/local/go sudo tar -C /usr/local -xzf "go$ver.darwin-amd64.tar.gz" rm "go$ver.darwin-amd64.tar.gz"
Add your
/usr/local/go/bin
directory to your$PATH
if you have not already:bashecho "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile source $HOME/.bash_profile
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile source $HOME/.bash_profile
bashecho "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.zshrc source $HOME/.zshrc
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.zshrc source $HOME/.zshrc
To verify that the correct version of Go was installed correctly run:
bashgo version
go version
The output will show the version installed.