buzzkillb Posted June 20, 2018 Report Share Posted June 20, 2018 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.jsonhttps://pastebin.com/JFp5ZKq6 Create the Coin denarius.json under nomp/coins Sample denarius.jsonhttps://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.jsonhttps://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. 1 Quote Link to comment Share on other sites More sharing options...
buzzkillb Posted February 15, 2020 Author Report Share Posted February 15, 2020 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 Bionichttps://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. 1 1 Quote Link to comment Share on other sites More sharing options...
buzzkillb Posted February 15, 2020 Author Report Share Posted February 15, 2020 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([]); }  1 Quote Link to comment Share on other sites More sharing options...
buzzkillb Posted February 15, 2020 Author Report Share Posted February 15, 2020 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/'); 1 Quote Link to comment Share on other sites More sharing options...
buzzkillb Posted April 6, 2020 Author Report Share Posted April 6, 2020 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  1 1 Quote Link to comment Share on other sites More sharing options...
buzzkillb Posted September 3, 2020 Author Report Share Posted September 3, 2020 Couldn't get nvm to work on xenial, this helped https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-16-04 1 Quote Link to comment Share on other sites More sharing options...
buzzkillb Posted June 4, 2021 Author Report Share Posted June 4, 2021 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 1 Quote Link to comment Share on other sites More sharing options...
buzzkillb Posted July 2, 2021 Author Report Share Posted July 2, 2021 Copy Pasta of how to remove garbage from addresses that NOMP can't handle. reference: https://bitcoin.stackexchange.com/questions/34057/error-trying-to-send-payments-with-rpc-sendmany Eliminate the whitespace from workers' names. This commit shows how to do that. Combine payouts together when there is more than one worker with the same address. The code for that is shown below. In paymentProcessor.js, change var address = worker.address = (worker.address || getProperAddress(w)); worker.sent = addressAmounts[address] = satoshisToCoins(toSend); to var address = worker.address = (worker.address || getProperAddress(w)).trim(); if (!worker.sent) { worker.sent = 0; } worker.sent += satoshisToCoins(toSend); if (!(address in addressAmounts)) { addressAmounts[address] = 0; } addressAmounts[address] += satoshisToCoins(toSend); 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.