To prepare the system type the following.
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install -y build-essential
To get the Go package type the following.
cd ~
wget https://dl.google.com/go/go1.9.2.linux-amd64.tar.gz
Then verify the download by checking that the sha256sum results from the following command match that of the relevant sha256 checksum section on the < https://golang.org/dl/ > website.
sha256sum go1.9.2.linux-amd64.tar.gz
To unpack the package, type the following (using sudo).
sudo tar -C /usr/local -xzf go1.9.2.linux-amd64.tar.gz
To ensure that the Go path is set for your user profile. Add the following line to the end of your ~/.profile file.
export PATH="$PATH:/usr/local/go/bin"
Log out and in (or reboot) to ensure the environment variables have taken. Test Go with the following command (confirm the version).
go version
The output should show the version.
go version go1.9.2 linux/amd64
As this will be a private network, we do not want the Ethereum installation to constantly increase the difficulty setting. We are just performing some testing, in a closed and private network, and as such want the quickest mining time available.
To set the difficulty at 1 statically, we need to open the following file in the source code (before compiling).
go-ethereum/consensus/ethash/consensus.go
Once we have this file open for editing, we need to go to the calcDifficulty function (currently on line 298).
https://github.com/ethereum/go-ethereum/blob/02aeb3d76652a4c0451e5c3734e6881aefe46249/consensus/ethash/consensus.go#L298
This function controls which difficulty adjustment function is called.
In order to guarantee the lowest difficulty level (on an ongoing basis), we will need to strip out the case statement and simply return big.NewInt(1) for the entire function's execution.
return big.NewInt(1)
NOTE: Additional configuration and commands are required in relation to accounts, networks and configuration. Please hold off running any commands until reading the next few paragraphs.