Part 2 - Software Installation
1. Install Dependencies
At this point you should be logged in via SSH as the pocket
user that we set up in a previous step. Before we install the Pocket software, we need to update the existing system packages and add a few dependencies:
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.
Installing dependencies
Some of the following dependencies might already be installed so if one of the them exists, you can just move on to the next one.
git
sudo apt-get install git -y
build tools
sudo apt-get install build-essential -y
curl
sudo apt-get install curl -y
file
sudo apt-get install file -y
nginx
sudo apt install nginx -y
certbot
sudo apt install certbot -y
python3-certbot-nginx
sudo apt-get install python3-certbot-nginx -y
jq
sudo apt install jq -y
2. Install Go
After installing the dependencies above, there is one more we'll need to add, and that's Go tools. Go (sometimes referred to 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.cd ~
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.)
wget https://go.dev/dl/go1.22.2.linux-amd64.tar.gz
Extract the archive:
sudo tar -xvf go1.22.2.linux-amd64.tar.gz
Set permissions on the extracted files:
sudo chown -R pocket ./go
Add Go to the
PATH
environment variableecho 'export PATH=$PATH:$HOME/go/bin' >> ~/.profile
Set the
GOPATH
andGOBIN
environment variables:echo 'export GOPATH=$HOME/go' >> ~/.profile
echo 'export GOBIN=$HOME/go/bin' >> ~/.profile
Reload your
.profile
:source ~/.profile
Verify the installation:
go version
Ensure this outputs the correct version number. If this doesn't work, try logging out and logging back in.
Verify the
GOPATH
andGOBIN
variables are set correctly:go env
3. Install Pocket
After verifying 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
Move to the project directory:
cd $GOPATH/src/github.com/pokt-network
Clone the Pocket Core repository:
sudo git clone https://github.com/pokt-network/pocket-core.git
Move to the code directory:
cd pocket-core
Checkout the latest released version. You can find this by going to the Pocket Core releases on GitHub.
sudo git checkout tags/<pocket-version>
Note: 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:
pocket version
That’s it for the software installation. Now let’s move on to the Pocket Core configuration.
Last updated