Setting up ethereum machine from scratch.

ConradJohnsonConradJohnson Member Posts: 130 ✭✭
So I'm writing this to help me understand how to setup an ethereum machine. I'm doing this as an exercise in helping me understand fully how to set one up (learn it, do it, teach it) and also because I find the information in many different places, and support for the releases doesn't always result in a stable PPA. This is also helpful for people like myself where you find posts like this https://forum.ethereum.org/discussion/1784/my-working-steps-go-ethereum-cli-json-rpc-chrome-browser-etherum-js-solidity, and step 1 is literally everything in this post summed up into one line with something like 'clone go-ethereum and build it' which isn't really helpful for people like myself.

True GPU mining support for the ethereum installation isn't ready yet, so I'll try and update this for miners as the genesis block approaches as they release.

I'm using an old mining rig for this setup - I'm starting from scratch with a clean OS installation. If anyone wants to use this guide, by all means, please do and let me know where I've not gotten this correct and used incorrect terminology.

It seems that the support for the latest will always be linux, particularly Ubuntu, so this might hurt other people out there wanting to setup an ethereum machine to mine or play with, but I'd suggest you bite the bullet and learn how to use Ubuntu if you don't already. Also, googling "install ubuntu from usb drive" will allow you to find information specific to the OS that you already have on how to create that USB file and flash it to the drive and boot from it.

I'm starting with a clean Ubuntu 14.04 installation - nothing else.

I've updated my drivers for my Nvidia graphics cards. In this case I'm using "old" 750ti cards (old as in 1 year old). I've downloaded the driver from Nvidia website and I now have a .run file in my downloads section. I've used the instructions in the answer here: askubuntu.com/questions/149206/how-to-install-nvidia-run to install the drivers. I used "sh [filename].run" to install on bullet point 3, 2nd part. I use the "lspci" command to confirm that the cards are all installed as they're in the PCI slots.

So now I have a clean Ubuntu 14.04 installation with my graphics cards, and I'm at a terminal session now.

Let's install some basics first.

Install "git"
sudo apt-get intstall git

We'll be using the "go" version of ethereum (as opposed to c++) as that seems to have more frequent updates and better support, so let's now install the "golang" support for compiling the code
sudo apt-get intstall golang

Now, from here the resource https://github.com/ethereum/go-ethereum/wiki/Instructions-for-getting-the-Go-implementation-of-Ethereum-and-the-Mist-browser-installed-on-Ubuntu-14.04-%28trusty%29 would have you believe that 5 more commands and you're done, but that's not true. Like I said the support for these are not always up to date, and frankly haven't been since they first posted those instructions.

Skip these commands until support gets better for PPA, again... these will not work just yet so skip them:
sudo apt-get install software-properties-common sudo add-apt-repository ppa:ethereum/ethereum sudo add-apt-repository ppa:ethereum/ethereum-dev sudo apt-get update sudo apt-get install go-ethereum

So let's build from source as the Automatic installation on that page as (option 2) also doesn't work in this instance.

We will need more (and more) prerequisites with the software-properties-common installation, so do this:
sudo apt-get install software-properties-common

and we're off to build from source.

You've already installed golang, but we need to set some variables Ubuntu needs to be able to compile stuff in 'go'.

Let's set these variables:
mkdir -p ~/go
This will make a directory 'go' in your home (~) directory.

Set the GOPATH variable:
echo "export GOPATH=$HOME/go" >> ~/.bashrc
This will tell 'go' where to look for packages and the such.

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

Then finally do this:
source ~/.bashrc
This will load those environment variables into the current session.

So 'Go' should be ready to do some compiling now.

Now more prerequisites:
sudo apt-get install -y libgmp3-dev libreadline6-dev
This will install the GMP and Readline requirements.

Qt (pronounced "Cute") is a necessary prerequisite. We'll also need a prerequisite for this prerequisite with g++ compiler so run this:
sudo apt-get install g++

Now run each of these lines one by one, selecting 'Y' when prompted:
sudo apt-get install mesa-common-dev libglu1-mesa-dev sudo apt-get install pkg-config sudo add-apt-repository ppa:beineri/opt-qt54-trusty sudo apt-get update sudo apt-get install -y qt54quickcontrols qt54webengine source /opt/qt54/bin/qt54-env.sh go get -u github.com/obscuren/qml cd $GOPATH/src/github.com/obscuren/qml && git checkout v1 source /opt/qt54/bin/qt54-env.sh go build
All of this should get you squared away with QT


Also, mercurial is used for some source so that's another dependency we'll need:
sudo apt-get install mercurial

NOW we're ready to actually go get ethereum and all of the goodies (MIST, etc..),

We'll use 'go' for that:

go get -u -v github.com/ethereum/go-ethereum/...
Note the 3 periods are required. We're actually getting the entire repository, not just the ethereum client.

Let's now build 'ethereum'
cd ~/go/src/github.com/ethereum/go-ethereum/ go install -v
First command changes to the directory, the second builds some of ethereum's pieces.

let's now go to build the ethereum CLI
cd ~/go/src/github.com/ethereum/go-ethereum/cmd/ethereum/ go build
First command again changes to the directory, the second builds the program. 'ls' command should now show the 'ethereum' program in the directory.

Let's run ethereum
./ethereum -mine
I've given this the '-mine' argument which will start to mine (give it a couple of minutes) and you should see mining starting. This guide does not include having your GPU cards do the mining yet as I don't think the support is ready for it yet. I've also noticed letting the miner run a bit, then canceling (CTRL-C) then restarting it with the command above will get you to the current block quicker as it has a better peer set with which to start. I'll try to update this when we have GPU support.

MIST
I've tried to go to mist in /go/src/github.com/ethereum/go-ethereum/cmd/mist to build but it seems I'm still missing other QT dependencies. I'll update this as I figure it out.

Again, I'm no Ubuntu expert and someone will probably just say something like "why not just use a vm and do x", which is inevitable. But hey, if this helps even just me with this process, it'll be worth it. Let me know if there's any questions and I'll try and answer them. I've wiped my machine 4 times and I'll run through these instructions again with a clean install to see if I've nailed it.




Comments

Sign In or Register to comment.