A couple weekends ago I setup a bunch of decentralized projects on my computer for fun. As you might know I’m working on a project called RightMesh which aims to allow people to resell their extra network capacity. I’m super interested in reselling resources, so naturally I like the Golem project which lets you resell cpu / gpu resources, and IPFS / Filecoin which lets you resell storage. The tor project doesn’t allow you to sell anything, but I have a high bandwidth link and figured I might as well put it to good use. I also really like the Ethereum project, so I like to run a full node, and do a bit of GPU mining in a pool as a hobby.
I decided to nuke my entire setup — previously was running Windows 10 for gaming with a bunch of stuff running on Ubuntu in a VM. Haven’t gamed much on my computer lately so moving completely into Ubuntu. First step, get Ubuntu. I chose the server edition because I don’t need all the GUI stuff (I use my laptop for that).
First step, download Ubuntu. I chose version 16.04.3 LTS.
<center> ![file](/uploads/image-1599621087984.png)<br/>I used the startup disk creator tool in Ubuntu on another computer to setup an 8GB usb flash drive.</center>
After it downloaded, I used the startup disk creator tool in Ubuntu on another computer to setup an 8GB usb flash drive. There are similar tools in windows that you can find as well.
After this, reboot the computer with the USB stick inserted. You may need to press a button like f10 or something on your computer to change which device it boots from (otherwise it will use the previous Windows install).
After boot we can start installing things.
First, a few things for building and getting source code:
sudo apt-get install git build-essential python-twisted supervisor screen tmux python-pip golang-go supervisor
Next, since I have AMD RX 580 graphics cards, I had to get the drivers from this page:
Once they downloaded, I extracted the drivers, ran the installer and added myself to the video group (otherwise opencl devices will only be available to root user):
tar xvf amdgpu-pro-17.40–492261.tar.xz
sudo usermod -a -G video $LOGNAME
**Ethereum full node & miner**
Next is actually getting the Ethereum [full node](https://ethereum.gitbooks.io/frontier-guide/content/installing_linux.html) and GPU [mining software](https://ethereum.gitbooks.io/frontier-guide/content/gpu.html):
sudo apt-get install software-properties-common
sudo add-apt-repository -y ppa:ethereum/ethereum
sudo add-apt-repository -y ppa:ethereum/ethereum-dev
sudo apt-get update
sudo apt-get install ethereum ethminer
The ethereum full node software is called geth. First is [creating your account](https://github.com/ethereum/go-ethereum/wiki/Managing-your-accounts). You can do this with:
`geth account new`
This won’t actually run the full node — it just sets up the files for your account. You’ll want to save the public address that gets generated at this step. Next is actually running the full node. You can run it a couple of ways. One is to run it in “console” mode as follows:
This will show output about what geth is doing, and let you enter commands. It can get kind of annoying with the output coming out on the same screen you are trying to enter input in. Once its running, you can quit with the command exit.
The other way you can do it is run it as a deamon and then “attach” to it (we’ll see how to do this later on with supervisor, but another way you could do it is run geth in one process using screen, and then detach from the screen ctrl-d and attach with geth attach.
When geth is in either console mode or attached, you can check whether it is synced with the following command:
Another useful command is this one, which will list your account public address:
And another one which will list the balance in your account:
You can test that the miner is working with your GPU as follows:
which should just show your open-cl devices. You can also do a benchmark to make sure it works as follows:
`ethminer -G -M`
Next, I downloaded [eth-proxy](https://github.com/Atrides/eth-proxy) so that I could do some pooled mining (I use [dwarfpool](https://dwarfpool.com/eth/) — but this will also work with other pools).
`git clone https://github.com/Atrides/eth-proxy.git`
Next, setup the configuration file for eth-proxy:
You’ll want to make sure you fill in the wallet address you wish the mined tokens to go to (ie: the public address from setting up geth), and also setup the mirrors you wish to connect with (ie: us, europe, asia).
Once this is setup you can start the proxy:
Now run your miner with the proxy:
`ethminer --farm-recheck 200 -G -F http://127.0.0.1:8080/$HOSTNAME`
According to the [tor website](https://www.torproject.org/docs/debian.html.en), its best not to use the tor package in the Ubuntu universe repository because it doesn’t really get updated enough.
sudo add-apt-repository "deb http://deb.torproject.org/torproject.org $(lsb_release -s -c) main"
gpg --keyserver keys.gnupg.net --recv A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89
gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -
sudo apt-get update
sudo apt-get install tor deb.torproject.org-keyring
Next, edit the /etc/tor/torrc file using an editor like nano:
`sudo nano /etc/tor/torrc`
You probably want to disable being an exit relay. You can do this by uncommenting the line ExitPolicy reject *:* # no exits allowed. Its up to you whether you want to run as a bridge (non-public) node or not. I usually run as a public relay.
I usually uncomment the ORPort line: ORPort 9001 which will advertise the Tor service on that port. I also set the Nickname so that I can find my node easily in directories.
Lastly, I usually set the bandwidth I’m willing to provide.
After you make the changes, restart the tor service like this:
`sudo service tor restart`
You should be able to search for your public tor relay using the [atlas project site](https://atlas.torproject.org/).
** Golem Test Node **
First, get the install script and make it executable:
chmod +x install.sh
Similar to geth, you can run golem in a couple of different windows. First is the main app — you can run this with golemapp. You probably want to do this in screen. Then in another console, you can attach to it with golemcli -i which will attach to the existing golemapp instance. You can also set your options which are located at: `~/.local/share/golem/default/app.cfg.ini`
In the golemcli, there are a few useful commands. tasks stats will show how many tasks have been computed. There is also incomes show and payments show which show tasks that golem tokens are being paid for. Of course currently, it is all on the public testnet and worthless, but its still cool to try it out so that when it publicly launches you’ll be ready ;)
** IPFS **
Next is IPFS. This one is pretty simple — just [download](https://dist.ipfs.io/#go-ipfs) it, install it and init.
tar xvf go-ipfs_v0.4.13_linux-amd64.tar.gz
Init with ipfs init which will setup ~/.ipfs. You can then run ipfs as a daemon with ipfs daemon. You might wish to change the configuration in ~/.ipfs/config. You may notice that the gateway is trying to listen on the same port as the proxy for mining (8080). You may wish to set some of the listening ips to either the LAN address or the public address if you want to be able to access it from another computer (it defaults to showing most of the APIs through localhost only.
** Making Everything Start on Boot **
Theres a few different ways to make everything run on boot. If you wanted you could create service definitions for everything — but that’s kind of overkill for some of these.
The [supervisor tool](https://hiddentao.com/archives/2016/05/04/setting-up-geth-ethereum-node-to-run-automatically-on-ubuntu/) is something that we can use to make sure [all the things](https://github.com/pipermerriam/ipfs-persistence-consortium/blob/master/EC2_setup.md) start on boot.
command=/usr/bin/geth --fast --rpc --rpcaddr 127.0.0.1 --rpcport 8545 --rpccorsdomain * --rpcapi admin,db,eth,debug,miner,net,shh,txpool,personal,web3
command=/usr/local/bin/ipfs daemon --init --mount-ipfs /data/ipfs --mount-ipns /data/ipns --mount
command=ethminer --farm-recheck 200 -G -F http://127.0.0.1:8080/$HOSTNAME
Note above, fill in your username where it says `<insert user>`.
Tor should automatically start as a service in ubuntu so you don’t need to add anything to make that work.
In part II of this guide, I’ll show you how to add some things that let you monitor your setup and make sure its all still running.
[Originally posted on medium on November 28, 2017](https://medium.com/@compscidr/howto-install-all-the-decentralized-p2p-things-ethereum-full-node-gpu-miner-proxy-tor-relay-a4e962556af4).