Jump to content

How to Setup NOMP Mining Pool [D] - Denarius


Recommended Posts

IurmUnE.gif

How to setup a NOMP mining pool for Denarius. This is a basic guide to get someone headed in the right direction to getting a pool to work.

I can run 2 coins on a $5 Vultr VPS with small hashrate, so far.

Update Ubuntu 16.04

apt-get update
apt-get dist-upgrade

Create a swap file

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

Create swap file to keep this persistent

nano /etc/fstab

Insert at the bottom of the file

/mnt/myswap.swap none swap sw 0 0

Install required packages

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
add-apt-repository ppa:bitcoin/bitcoin
apt-get update
apt-get install libdb4.8-dev libdb4.8++-dev
curl https://raw.githubusercontent.com/creationix/nvm/v0.16.1/install.sh | sh
source ~/.profile
nvm install 0.10.25
nvm use 0.10.25

Make a new user since you aren't going to use root for this.

dduser usernameyourwant

Give new user sudo access

adduser usernameyousetup sudo

Reboot and login as the new user

reboot

Denarius Wallet Daemon Setup

Get dependencies

apt-get --assume-yes install git unzip build-essential libssl-dev libdb++-dev libboost-all-dev libcrypto++-dev libqrencode-dev libminiupnpc-dev libgmp-dev libgmp3-dev autoconf libevent-dev autogen automake  libtool

 

Compile Denarius Daemon

git clone https://github.com/carsenk/denarius
cd denarius
git checkout master
cd src
make -f makefile.unix
sudo mv ~/denarius/src/denariusd /usr/local/bin/denariusd

Get chaindata and extract to .denarius folder

apt-get -y install unzip
cd ~/.denarius
rm -rf database txleveldb smsgDB
wget https://denarii.cloud/chaindata.zip
unzip chaindata.zip

Edit denarius.conf

nano ~/.denarius/denarius.conf

Insert this into denarius.conf

rpcuser=denariusrpc
rpcpassword=USERANDOMPASSWORDHERE!!!
gen=0
server=1
listen=1
rpcallowip=127.0.0.1
rpcport=32369
daemon=1

Run the wallet so its syncing while you do this

sudo denariusd --daemon

Get a DNR address so the pool has a wallet. Save this address for a step below. Address goes into pool_configs/denarius.json eventually.

denariusd getnewaddress

 

Mining Pool Setup

cd
git clone https://github.com/buzzkillb/node-open-mining-portal nomp
cd nomp
#I had to run npm update twice before it worked right
npm update

You want to create a config.json in the main nomp directory. Replace your IP address and take note of changing port 8080 to some random port.

Sample config.json
https://pastebin.com/JFp5ZKq6

Create the Coin denarius.json under nomp/coins

Sample denarius.json
https://pastebin.com/XjiXVLCM

Create the pool config for denarius under nomp/pool_configs. Replace DNRPOOLWALLETDAEMONADDRESS with address used from Denarius wallet daemon getnewaddress from above. Change DNRFEEPAYMENTADDRESS to your fee payment address and 1.0 is 1% fee. Use RPC user and pass that you have in your denarius.conf. Change ports and difficulty for your needs.

Sample denarius.json
https://pastebin.com/23F9Cfwq

Starting the pool.

cd
cd nomp
npm install [email protected]
node init.js

Now go your your IPADDRESS:PORT in your web browser and get to mining on your pool.

I also disabled root access, password logins and only allow SSH key login to the new user.

  • Like 1

If you enjoy my content please consider donating to the Denarius creator - https://www.patreon.com/carsenk
Join Denarius Discord - https://discord.gg/JQEmXwb

Link to post
Share on other sites
  • 11 months later...

To reverse PROXY this and use letsencrypt for easy TLS. Basically NOMP is using Port 8080 for web server which we will pass to port 80 using NGINX and then let certbot configure this to work on TLS port 443.

https://eladnava.com/binding-nodejs-port-80-using-nginx/

sample how you edit above examples node file

server {
    listen 80;
    server_name mining.cafe;

    location / {
        proxy_set_header   X-Forwarded-For $remote_addr;
        proxy_set_header   Host $http_host;
        proxy_pass         "http://127.0.0.1:8080";
    }
}

Then install letsencrypt on example -> Ubuntu 18.04 Bionic
https://certbot.eff.org/lets-encrypt/ubuntubionic-nginx

When it asks to always use 443 say YES! and that's eet. Certbot does all the heavy lifting.

  • Like 1
  • Upvote 1

If you enjoy my content please consider donating to the Denarius creator - https://www.patreon.com/carsenk
Join Denarius Discord - https://discord.gg/JQEmXwb

Link to post
Share on other sites

To get this to work on Denarius I changed these areas to comment them out

~/nomp/node_modules/stratum-pool/lib/blockTemplate.js around line 38

/**    function getVoteData(){
        if (!rpcData.masternode_payments) return new Buffer([]);

        return Buffer.concat(
            [util.varIntBuffer(rpcData.votes.length)].concat(
                rpcData.votes.map(function (vt) {
                    return new Buffer(vt, 'hex');
                })
            )
        );
    }
**/

and around line 110

   //         getVoteData(),

 

OR

replace getVoteData function with

function getVoteData(){
    return new Buffer([]);
}

 

  • Like 1

If you enjoy my content please consider donating to the Denarius creator - https://www.patreon.com/carsenk
Join Denarius Discord - https://discord.gg/JQEmXwb

Link to post
Share on other sites

To edit the coinbase from default nodestratum

Change ~/nomp/node_modules/stratum-pool/lib/transactions.js around line 239 to

var scriptSigPart2 = util.serializeString('/mining.cafe/');

image.png.b4072714c23149b818d6011741ab4550.png

  • Like 1

If you enjoy my content please consider donating to the Denarius creator - https://www.patreon.com/carsenk
Join Denarius Discord - https://discord.gg/JQEmXwb

Link to post
Share on other sites
  • 1 month later...

when the database gets destroyed an easy way to reset is by stopping the pool and then

redis-cli
FLUSHALL
quit

then remove the dump file

cd /var/lib/redis
rm dump.rdb
cd ~

restart redis

/etc/init.d/redis-server restart

restart pool

cd nomp
node init.js

 

  • Upvote 1

If you enjoy my content please consider donating to the Denarius creator - https://www.patreon.com/carsenk
Join Denarius Discord - https://discord.gg/JQEmXwb

Link to post
Share on other sites
  • 4 months later...
  • 9 months later...

Ubuntu 20.04 NOMP with Denarius Snap Daemon

Install Dependencies

sudo apt install build-essential libtool autotools-dev autoconf pkg-config libssl-dev
sudo apt install libboost-all-dev git npm nodejs libminiupnpc-dev redis-server
sudo apt install python git curl

Install node 0.10.25

wget https://nodejs.org/dist/v0.10.25/node-v0.10.25-linux-x64.tar.gz
tar xvf node-v0.10.25-linux-x64.tar.gz
cd node-v0.10.25-linux-x64
sudo cp -R bin/* /usr/bin/
sudo cp -R lib/* /usr/lib/
cd ~

Install Denarius Snap Daemon

sudo apt update
sudo apt install snapd
sudo snap install denarius

Clone NOMP

cd
git clone https://github.com/buzzkillb/node-open-mining-portal nomp
cd nomp
#I had to run npm update twice before it worked right
npm update

Run Nomp

node init.js

 

  • The D 1

If you enjoy my content please consider donating to the Denarius creator - https://www.patreon.com/carsenk
Join Denarius Discord - https://discord.gg/JQEmXwb

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...