Part 2 – Software installation
This section will help you install all the necessary software for your node.
Now let’s move on to the Pocket CLI installation.
At this point you should be logged in via SSH as the
Updating system packages
- Update the repository index with the following command:
sudo apt update
- Update the distribution with the following command:
sudo apt dist-upgrade -y
After the update completes, we’re ready to install the dependencies.
There are a handful of dependencies but installing them won’t take long. Also, some might already be installed. So if one of the dependencies exists, you can just move on to the next one.
sudo apt-get install git -y
sudo apt-get install build-essential -y
sudo apt-get install curl -y
sudo apt-get install file -y
sudo apt install nginx -y
sudo apt install certbot -y
sudo apt-get install python3-certbot-nginx -y
sudo apt install jq -y
After installing the dependencies, there is one more dependency we’ll need to add, and that’s Go. Go (sometimes known as “Golang”) is the programming language that the Pocket software was written in.
We could install Go using
apt, but we want to get the latest stable version which probably isn’t available by default in the
apt repository. So, we’ll use the steps below to install Go.
- Make sure you’re in the pocket home directory.
- Find the latest version of Go from https://golang.org/dl/ then download it with the following command. (Make sure to change the link below to point to the correct version of Go.)
- Extract the archive:
sudo tar -xvf go1.19.2.linux-amd64.tar.gz
- Set permissions on the extracted files:
sudo chown -R pocket ./go
- Add Go to the
echo 'export PATH=$PATH:$HOME/go/bin' >> ~/.profile
- Set the
echo 'export GOPATH=$HOME/go' >> ~/.profile
echo 'export GOBIN=$HOME/go/bin' >> ~/.profile
- Reload your
- Verify the installation:
go version go1.19.2 linux/amd64Info
Make sure the version number matches the version you downloaded. If the
go versioncommand doesn’t work, try logging out and logging back in.
- Verify the
GOBINvariables are set correctly:
After you can verify that you have the latest stable version of Go, we’re ready to install the Pocket software.
We’ll be downloading Pocket Core from GitHub and then compiling it with Go to get it fully installed.
To download and install Pocket Core, do the following:
Create a project directory:
sudo mkdir -p $GOPATH/src/github.com/pokt-network
Change to the project directory:
Clone the Pocket Core repository:
sudo git clone https://github.com/pokt-network/pocket-core.git
Change to the code directory:
Checkout the latest version. You can find the latest tag by going to https://github.com/pokt-network/pocket-core/tags:
sudo git checkout tags/RC-0.9.2Info
You may see a warning about being in a “detached HEAD” state. This is normal.
Build project code:
go build -o $GOPATH/bin/pocket $GOPATH/src/github.com/pokt-network/pocket-core/app/cmd/pocket_core/main.go
Test that the build succeeded:
That’s it for the software installation. Now let’s move on to the Pocket core configuration.