Skip to content

Instantly share code, notes, and snippets.

@namnm
Created October 14, 2017 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save namnm/0b4a5053a5b98f4029f8009a3533af0c to your computer and use it in GitHub Desktop.
Save namnm/0b4a5053a5b98f4029f8009a3533af0c to your computer and use it in GitHub Desktop.
UNOMP multipool instructions

UNOMP multipool instructions

Prepare machine

  • Make swap
sudo dd if=/dev/zero of=/mnt/myswap.swap bs=1M count=4000
sudo mkswap /mnt/myswap.swap
sudo swapon /mnt/myswap.swap

sudo nano /etc/fstab
# Put the following line to the end of file
# /mnt/myswap.swap none swap sw 0 0

Setup daemons

Install common dependencies
  • Install BDB to ~/db4
cd ~
HOME=$(pwd)
BDB_PREFIX="${HOME}/db4"
mkdir $BDB_PREFIX

wget 'http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz'
echo '12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef  db-4.8.30.NC.tar.gz' | sha256sum -c
tar -xzvf db-4.8.30.NC.tar.gz

cd db-4.8.30.NC/build_unix/
../dist/configure --enable-cxx --disable-shared --with-pic --prefix=$BDB_PREFIX
make install

cd ~
rm -rf db-4.8.30.NC db-4.8.30.NC.tar.gz
  • Install Miniupnpc
cd ~
wget http://miniupnp.free.fr/files/download.php?file=miniupnpc-1.8.tar.gz
tar -zxf download.php\?file\=miniupnpc-1.8.tar.gz
cd miniupnpc-1.8/
sudo make
sudo make install
cd ~
rm -rf miniupnpc-1.8 download.php\?file\=miniupnpc-1.8.tar.gz
Build daemons
  • Install dashcore
cd ~
HOME=$(pwd)
BDB_PREFIX="${HOME}/db4"
sudo apt-get install build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils libboost-all-dev
git clone https://github.com/dashpay/dash.git
cd dash
sudo ./autogen.sh
sudo ./configure LDFLAGS="-L${BDB_PREFIX}/lib/" CPPFLAGS="-I${BDB_PREFIX}/include/"
sudo make
  • Install gamecredits
cd ~
HOME=$(pwd)
BDB_PREFIX="${HOME}/db4"
apt-get install ntp git build-essential libssl-dev libdb-dev libdb++-dev libboost-all-dev libqrencode-dev autoconf automake pkg-config unzip
git clone https://github.com/gamecredits-project/GameCredits.git gmc
cd gmc
sudo ./autogen.sh
sudo ./configure LDFLAGS="-L${BDB_PREFIX}/lib/" CPPFLAGS="-I${BDB_PREFIX}/include/"
sudo make
  • Install einsteinium
cd ~
HOME=$(pwd)
BDB_PREFIX="${HOME}/db4"
# other dependencies are fullfilled with the above installations
git clone https://github.com/emc2foundation/einsteinium.git emc2
cd emc2
sudo ./autogen.sh
sudo ./configure LDFLAGS="-L${BDB_PREFIX}/lib/" CPPFLAGS="-I${BDB_PREFIX}/include/"
sudo make
  • Install pure
cd ~
sudo apt-get install libgmp3-dev
# other dependencies are fullfilled with the above installations
git clone https://github.com/puredev321/pure.git
cd pure/src/leveldb/
chmod +x build_detect_platform
make libleveldb.a libmemenv.a
cd ..
cp -R support/ obj/support/
cp -R crypto/ obj/crypto
cp -R x11/ obj/x11
make -f makefile.unix
  • Install xios
cd ~
# other dependencies are fullfilled with the above installations
git clone https://github.com/ButterRose/Xios.git xios
cd xios/src
make -f makefile.unix
Config and start daemons
  • Config
sudo nano ~/.dashcore/dash.conf
sudo nano ~/.gamecredits/gamecredits.conf
sudo nano ~/.einsteinium/einsteinium.conf
sudo nano ~/.pure/pure.conf
sudo nano ~/.XIOS/XIOS.conf
rpcuser=dashuser
rpcpassword=dashpassword
rpcport=30001
rpcallowip=127.0.0.1
daemon=1
server=1
listen=1
port=30002
  • Start daemons
~/dash/src/dashd
~/gmc/src/gamecreditsd
~/emc2/src/einsteiniumd
~/pure/src/pured
~/xios/src/XIOSd

Setup unomp

Install unomp related tools
  • Install nvm and node
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.5/install.sh | bash
source ~/.profile
nvm install 0.10.25
nvm use 0.10.25
  • Install Redis
cd ~
sudo apt-get install build-essential tcl8.5
wget http://download.redis.io/releases/redis-stable.tar.gz
tar xzf redis-stable.tar.gz
cd redis-stable
make
make test
sudo make install

cd utils
sudo ./install_server.sh
sudo service redis_6379 start

cd ~
rm redis-stable.tar.gz
  • Clone the unomp project and install its dependencies
cd ~
git clone https://github.com/UNOMP/unified-node-open-mining-portal.git unomp
cd unomp
npm update
Config and start the unomp app
  • Add missing coins
cd ~/unomp/coins
cp dash.json pure.json
sudo nano pure.json
# follow the instructions in the main project page
# note: name, symbol
  • Config the app
cd ~/unomp
cp config.json.example config.json
sudo nano config.json
# follow the instructions in the main project page
# note: website.host, website.port, website.stratumHost
  • Config the pool
cd ~/unomp/pool_configs
cp litecoin.json.example dash.json
sudo nano dash.json
cp litecoin.json.example gamecredits.json
sudo nano gamecredits.json
cp litecoin.json.example einsteinium.json
sudo nano einsteinium.json
cp litecoin.json.example pure.json
sudo nano pure.json
cp litecoin.json.example xios.json
sudo nano xios.json
# follow the instructions in the main project page
# note: enable, coin, auxes, address, rewardRecipients, paymentProcessing.daemon, ports, daemons
  • Special config for multipool
# follow the other instructions in the multipool page
# note config.json: defaultPoolConfigs.validateWorkerUsername
# note pool_configs/*: paymentProcessing.minimumPayment
cd ~/unomp/multipool/bin
sh x11redis.sh dash
sh scryptredis.sh gamecredits
sh scryptredis.sh einsteinium
sh x11redis.sh pure
sh scryptredis.sh xios
  • Start the app
cd ~/unomp
sudo node init.js

Caveats

  • In case of cannot start the monitor server due to EADDRNOTAVAIL, we need to change the website host address to an empty string.
  • Create a new vpc firewall rule for our app in Google Cloud VPC and allow all the necessary ports.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment