Skip to content

Instantly share code, notes, and snippets.

@soos3d
Last active October 5, 2022 16:21
Show Gist options
  • Save soos3d/f6e9f2ff7bef3bf1504bfe5afa4ee627 to your computer and use it in GitHub Desktop.
Save soos3d/f6e9f2ff7bef3bf1504bfe5afa4ee627 to your computer and use it in GitHub Desktop.

Install Go lang and the Bor client

Install Go lang and the Bor client on Ubuntu 20.04 lts.

Intall Go lang

We need at least version 1.19 of Go.

Install ubuntu updates

sudo apt-get update
sudo apt-get -y upgrade

Download Go binary

mkdir temp
cd temp
wget https://dl.google.com/go/go1.19.linux-amd64.tar.gz

Extract the downloaded tar and install it into the desired location in the system.

sudo tar -xvf go1.19.linux-amd64.tar.gz
sudo mv go /usr/local

Environment setup

The Go language environment variables we need are GOROOT , GOPATH and PATH.

  1. Export directly from the terminal; keep in mind that using this method, you'll need to declare them again every time you restart the terminal.
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
  1. Place the environment variables in the .bashrc file. This way, you don't need to declare them every time you restart the terminal.

Open the .bashrc file.

/bin/nano ~/.bashrc

Add the environment variables at the end of the file.

export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH

Close and save the file.

Ctrl + x y enter

Source the .bashrc file.

source ~/.bashrc

Now verify that go was installed correctly with the `go version`` command.

go version

Should return something similar to the following.

go version go1.19 linux/amd64

Install the Bor client

git clone https://github.com/maticnetwork/bor
cd bor
git checkout master
make bor

Verify that Bor was installed correctly.

bor version

It should display the client info.

Bor
Version: 0.2.16-stable
Git Commit: 783f93b1d7ef5e10fcca5a59399ad8b397368e96
Git Commit Date: 20220531
Architecture: amd64
Go Version: go1.19
Operating System: linux
GOPATH=/home/user/go
GOROOT=/usr/local/go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment