Hey all,
In this tutorial I am going to walk you through rE-cycling your old pc units and turn them into something new! Today we will be focusing on:
- System Requirements
- Installing Ubuntu
- Router Setup
- Domain Name
- Geth
No, Not that geth!
To get started you will need/SYS REQ:
- 4 GB of RAM
- CPU with at least 2 cores
- 500 GB of storage, Either NAS or onboard
Got all that?! Good let's get started.
The first thing you will want to do is get a copy of Ubuntu.
You will want to burn this image to a disk. Do not attempt to mount it using ISO tools and installing. This is pretty straight forward. While installing you will want your computer connected to your router during this process. Setup will configure your connection settings.
At the end of your setup you should see a screen that will prompt you to name it. **Name it what you wish, however you will need to write down what your naming it, we will go more into that later.)
Router Setup
Log into your router. You will want to setup port forwarding, so navigate to port forwarding.
Once inside port forwarding you will want a table try to replicate your table with this one:
| Protocol | Port | TCP/UDP | IP Address |
|---|---|---|---|
| HTTP | 80 80 | TCP | Server IP |
| FTP | 21 21 | TCP/UDP | Server IP |
| SSH | 22 22 | TCP | Server IP |
| will use for ember | 8082 | TCP/UDP | Server IP |
Obviously, save settings...
Domain Name
You can get a domain name by using your server IP address, this is a free and simple website. http://www.no-ip.com
Test it, Enter the domain name into your browser. If it works! Success!! If not, try your server's IP address. If that doesn't work, then recheck your port forwarding.
Ok so after all this you will want to login as root. Next we will want to check for Ubuntu updates.
apt-get update
apt-get dist-upgrade
Setup SWAP
dd if=/dev/zero
of=/mnt/myswap.swap bs=1M
count=4000
mkswap /mnt/myswap.swap
swapon /mnt/myswap.swap
To make your server start at boot (recommended), we will want to enable fstab.
nano/etc/fstab
Now at the end of the file add this:
/mnt/myswap.swap none sw 0 0
Now save and exit (Ctrl+O and Ctrl+X)
Installing Required Packages
apt-get install git
apt-get install build-essential libtool
autotools-dev autoconf pkg-config libssl-dev
apt-get install libboost-all-dev git npm
nodejs nodejs-legacy libminiupnpc-dev
redis-server
apt-get update
apt-get install libdb4.8-dev libdb4.8++-dev
apt-get install golang
sudo apt-get update
sudo apt-get install nginx
Wallet Setup
There are two ways of setup, I will cover them both.
We are going to build Golang from source
`` git clone https://github.com/vaporry/go-ethereum``
Clone this to a convient directory for your
sudo apt-get install -y build-essential golang
cd go-ethereum
make geth
Option 2, installing from PPA
sudo apt-get install software-properties-common
sudo add-apt-repository -y
ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install ethereum
After setup has completed run commands to generate a new account. IT is important like always to write your information down and store it in a safe place. (sometimes in plain sight is safest).
geth account new
We are almost completed... now to fill up the pool!
git config --global
http.https://gopkg.in.followRedirects true
git clone https://github.com/sammy007/open-ethereum-pool.git
cd open-ethereum-pool
make
./build/bin/open-ethereum-pool config.json
For the front end we will be using ember.js its a program that polls the pool API to render miner stats.
cd www
You will change the API URL: to match your domain name should be path www/config/enviroment.js, both need to match your domain name.
Installing ember
npm install -g [email protected]
npm install -g bower
npm install
bower install
./build.sh
API using nginx
upstream api{
server 127.0.0.1:8080;
}
location /api{
proxy_pass http://api;
}
Ember
ember server --port 8082 --enviroment
development
Config
Using the default config file we will edit this to our liking. I would encourage everyone to think before finalizing this, also I will state here to setup the templates for web server production www/app/templates. dont use the built in ones
{
//set number of Cores for server
**"threads":2**
//Prefix for keys in redis store
"coin":"eth"
//Give unique name to each instance "name": "main",
"proxy":{
"enabled":true,
``//bind http mining endpoint to this
``SERVERIP:PORT``
``"listen":
``"0.0.0.0:8888"
//Allow only this header and body size of HTTP request from miners
"limitheadersize":1024
"limitbodysize": 256
Skip over cloudflare
//stratum mining endpoint
"stratum":{
"enabled":true
//bind stratum mining socket to SERVERIP:PORT
"listen":
"0.0.0.0:8008
"timeout": "120s"
"maxconn":8192
}
//Try to get new job from geth in this interval
"blockrefreshinterval": "120ms"
"stateUpdateinterval":"3s"
//require this share difficulty from miners
"difficulty": 2000000000
// reply error to miner instead if job redistribut is unavailable
"healtchcheck":true,
//mark pool sick after redis failures
"maxfails": 100,
//TTL for worker stats
"hashrateExpiration":"3h"
"policy":{
"workers": 8,
"60m",
"refreshinterval":
"1m"
"banning": {
"enabled": false
"ipset": "blacklist"
//remove ban after this amount of time
"timeout": 1800
//percent of invalid shares from all shares to ban miner
"invalidpercent": 30
//check after miner submitted this number of malformed requests
"malformedlimit": 5
},
//connection rate limit
"limits":{
"enablted": false
// number of initial connections
"limit": Whatever you want (30)
"grace": "5m"
//increase number of connections on each valid share
"limitjump": 10
}
}
},
// provides JSON data for front end
"api":{
"enabled": true
"listen":
"0.0.0.0:8080"
//collect miner stats
"statscollectintverval": "5s"
//purge stale stats
"purgeinterval": "10m"
// fast hashrate estimation window
"hashratewindow": "30m"
//long and precise hashrate from shares
"hashrateLargeWindow": "3h"
If you liked this post feel free to send me a tip:
0x1a2291fb940c72f32a31a398d5b2e89bd6fc06fb