Skip to content

Instantly share code, notes, and snippets.

@whereyouatwimm
Forked from simoncos/golang_on_rpi.md
Last active November 16, 2018 16:11
Show Gist options
  • Save whereyouatwimm/0489c6da912acc2394f940fef0661cd7 to your computer and use it in GitHub Desktop.
Save whereyouatwimm/0489c6da912acc2394f940fef0661cd7 to your computer and use it in GitHub Desktop.
Install geth and creating a private network

Private Raspberry Pi Ethereum network

I started installing geth on a Raspberry Pi 3, and it sucked, So I figured I'd document it. Afterwards, I will be creating a private ethereum network for testing.

Installation instructions:

Install tools:

apt-get install git screen build-essential
If an older version of golang is installed with apt-get:
sudo apt remove golang
sudo apt-get autoremove

Install Golang 1.9.7:

wget https://dl.google.com/go/go1.9.7.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.9.7.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin # put into ~/.profile
SHA256: 88573008f4f6233b81f81d8ccf92234b4f67238df0f0ab173d75a302a1f3d6ee
original source for SHA256 sum: https://golang.org/dl/
Test:
go version

Add geth user and log as that user (i'd recommend using screen)

adduser geth
screen -S geth-user
sudo su geth

Set GOPATH and PATH

For Go to work properly, you need to set the following two environment variables:

echo "export PATH=$PATH:$HOME/go/bin:/usr/local/go/bin" >> ~/.bashrc

Read the environment variables into current session:

source ~/.bashrc

Checkout & install geth:

go get -d github.com/ethereum/go-ethereum

The above command will checkout the default version of Go Ethereum into your local GOPATH work space, but it will not build any executables for you. To do that you can either build one specifically:

go install github.com/ethereum/go-ethereum/cmd/geth

Create Genesis file.

I chose ~/genesis.json, you can choose whatever you want.

Creating ethereum addresses that sign

Unlocking those accounts

Resources:

https://github.com/ethereum/go-ethereum/wiki/Private-network

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment