Skip to content

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

  1. If you are on Ubuntu, first update and upgrade your OS:

    bash
    sudo apt update && sudo apt upgrade -y
    sudo apt update && sudo apt upgrade -y
    bash
    sudo yum update
    sudo yum update
  2. Install essential packages that are necessary to execute many tasks like downloading files, compiling, and monitoring the node:

    bash
    sudo apt install curl tar wget aria2 clang pkg-config libssl-dev jq build-essential \
    git make ncdu -y
    sudo apt install curl tar wget aria2 clang pkg-config libssl-dev jq build-essential \
    git make ncdu -y
    bash
    sudo yum install curl tar wget aria2 clang pkg-config libssl-dev jq build-essential \
    git make ncdu -y
    sudo yum install curl tar wget aria2 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.

  1. Set the version for your desired network:

    bash
    ver="1.23.0"
    ver="1.23.0"
    bash
    ver="1.23.2"
    ver="1.23.2"
    bash
    ver="1.23.2"
    ver="1.23.2"
  2. Download and install Golang:

    bash
    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"
    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"
    bash
    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"
    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"
    bash
    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"
    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"
    bash
    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"
    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"
  3. Add your /usr/local/go/bin directory to your $PATH if you have not already:

    bash
    echo "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
    bash
    echo "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

    TIP

    Use echo $SHELL to figure out what type of shell you are using!

  4. To verify that the correct version of Go was installed correctly run:

    bash
    go version
    go version

The output will show the version installed.