Install Musicoin Pool Using open-ethereum-pool by Sammy007

Jared Griego
3 min readSep 28, 2017

https://github.com/sammy007/open-ethereum-pool

Setup Ubuntu 16.04 Stable

Set static IP

sudo nano /etc/network/interfaces

change dhcp to static

ADD

address x.x.x.x

netmask x.x.x.x

gateway x.x.x.x

dns-nameserver 8.8.8.8 8.8.4.4

save and exit file

sudo reboot

Once logged back in try pinging google.com and 8.8.8.8

If no response check IP settings and gateway

UPDATE UBUNTU 16

sudo apt-get update

sudo apt-get dist-upgrade

sudo reboot

Install make and build tools

sudo apt-get install build-essential make

go install

http://tecadmin.net/install-go-on-ubuntu/

cd ~

wget https://storage.googleapis.com/golang/go1.7.5.linux-amd64.tar.gz

sudo tar -xvf go1.7.5.linux-amd64.tar.gz

sudo mv go /usr/local

export GOROOT=/usr/local/go

export PATH=$GOPATH/bin:$GOROOT/bin:$PATH

export GOPATH=$HOME/go

Type: go version

You should have a response with the version.

Installing Redis 2.8.0

https://redis.io/topics/quickstart

wget http://download.redis.io/redis-stable.tar.gz

tar xvzf redis-stable.tar.gz

cd redis-stable

make

sudo cp src/redis-server /usr/local/bin/

sudo cp src/redis-cli /usr/local/bin/

sudo mkdir /etc/redis

sudo mkdir /var/redis

sudo cp utils/redis_init_script /etc/init.d/redis_6379

sudo cp redis.conf /etc/redis/6379.conf

sudo nano /etc/redis/6379.conf

  • Edit the configuration file, making sure to perform the following changes:
  • Set daemonize to yes (by default it is set to no).
  • Set the dir to /var/redis/6379 (very important step!)

sudo mkdir /var/redis/6379

sudo update-rc.d redis_6379 defaults

sudo /etc/init.d/redis_6379 start

Test Redis Install

redis-cli

Expected response

redis 127.0.0.1:6379> ping

PONG

exit

Install nginx

https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-14-04-lts

sudo apt-get install nginx

NGINX starts automatically on port 80. This is all that needs to be competed at this step.

NPM and NODE v4 Install

curl https://raw.githubusercontent.com/creationix/nvm/v0.25.0/install.sh | bash

nvm install 4.7.3

Close and reopen console

node –v

Should be 4.7.3

npm –v

Should be 2.15.11

sudo rm go1.7.5.linux-amd64.tar.gz redis-stable.tar.gz nodesource_setup.sh

Musicoin install

cd /home/username

cd ~

mkdir musicoin

cd musicoin

git clone https://github.com/Musicoin/go-musicoin.git

cd go-musicoin

make gmc

Run GMC

tmux

cd build/bin/

./gmc — rpc console

-add account for miner pool

personal.newAccount()

DON’T FORGET PASSWORD

To Exit: Control B release buttons and then press D

Sammy007 Pool Build

cd ..

git clone https://github.com/sammy007/open-ethereum-pool.git

cd open-ethereum-pool

IF YOU NEED TO RUN MAKE AGAIN USE:

export GOROOT=/usr/local/go

export PATH=$GOPATH/bin:$GOROOT/bin:$PATH

export GOPATH=$HOME/go

make

Edit pool configs before ./build

cp ~/musicoinpool/open-ethereum-pool/config.example.json ~/musicoinpool/open-ethereum-pool/build/bin/config.json

edit config.json

edit www/config/environment.js

Change ApiUrl: ‘//example.net/’ to ApiUrl: ‘//nomnom.technology:8080/

Build configuration

cd www

sudo npm install -g ember-cli@2.9.1

sudo npm install -g bower

sudo npm install

bower install

./build.sh

For Musicoin the block rewards need to be changed from the ETH 5 to 314. That’s completed in the unlocker.go file before you run the ./build.sh.

Change the file to read as follows:

Original:

var constReward = math.MustParseBig256(“5000000000000000000”)
var uncleReward = new(big.Int).Div(constReward, new(big.Int).SetInt64(32))

// Donate 10% from pool fees to developers
const donationFee = 10.0
const donationAccount = “0xb85150eb365e7df0941f0cf08235f987ba91506a”

Changed file:

var constReward = math.MustParseBig256(“314000000000000000000”)
var uncleReward = new(big.Int).Div(constReward, new(big.Int).SetInt64(32))

// Donate 10% from pool fees to developers
const donationFee = 0.0
const donationAccount = “”

Start pool

tmux

cd ~/musicoinpool/open-ethereum-pool/build/bin

./open-ethereum-pool config.json

To Exit: Control B release buttons and then press D

NGINX Config

-Change NGINX default config

sudo nano /etc/nginx/sites-available/default

The final config for NGINX should be formatted like this:

upstream api {
server SERVER_NAME_HERE:8080;
}

server { listen 0.0.0.0:80;

root /home/username/open-ethereum-pool/www/dist;

index index.html index.htm; server_name localhost;

location / {
try_files $uri $uri/ /index.html;
}
location /api {
proxy_pass http://api;
}

}

Restart NGINX

sudo service nginx reload

Firewall ports to open

Stratum: 8008

Web 80

Proxy is 8888 and can be opened for http getwork clients.

The last thing to address is the payouts modules. Sometimes there are issues with the payouts and they need to be resolved manually. Use this guide: https://github.com/sammy007/open-ethereum-pool/blob/master/docs/PAYOUTS.md

I hope you enjoyed this basic how-to on the Musicoin pool build!

--

--