πββοΈπβ Run a Mining Pool
This page will guide you through the process of setting up your very own mining pool for XKR! Mining pools are essential for keeping the kryptokrona network happy and decentralized.
Thanks to @glen487 for this guide!
First make sure you are using Ubuntu 18.04 LTS (problems with the old node version 11 on 20.04)
sudo apt update
sudo apt upgrade
sudo apt-get install -y git curl wget screen build-essential libboost-all-dev cmake libssl-dev p7zip-full libsodium-dev
sudo rebootNode 12.x
Install Node version 12.x. currently required for cryptonote-nodejs-pool Add repository
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bashNote: you will get warning "Node.js 11.x is no longer actively supported" but there is currently no other version working.
sudo apt-get install gcc g++ make nodejsInstall Redis server
sudo add-apt-repository ppa:chris-lea/redis-server
sudo apt-get update
sudo apt-get install redis-serverDont forget to tune redis-server:
Add this to your /etc/rc.local and make it executable with you favorite editor sample:
Content
Then make it executable
Create a start script for rc.local
Add this:
Enable rc-local
Check status
Start redis-server.
Create a kryptokrona user for daemon and wallet
Recommend to use a dedicated user in this example user "kryptokrona" is used to make it simple.
Add user "kryptokrona" no need for this user to login remotely.
sudo to the new user "kryptokrona"
Visit Github and download latest binaries.
https://github.com/kryptokrona/kryptokrona/releases/
Currently 1.0.2:
Download and unpack
Download and unpack bootstrap of the Kryptokrona blockchain quickly get going.
Start the kryptokrona node
Now go in to the kryptokrona directory
Create XKR daemon start script and start in a "screen" sessions. "screen -S node"
Create a start script for the node:
Add and save: Note: The pool daemon is running on local host only.
Make the new script executable
And start the node inside the sceeen session
The node daemon will start " Imported block with index xxxx" and then sync the missing block with up to the current height of the blockchain. This will take some time. Wait to you see the "Successfully synchronized with the kryptokrona Network." Also the ascii loggo will show :D
ctrl+a to exist the screen session
If you want to go back to the screen session use: "screen -rd" this will list the current sessions running.
Then add the one you want sample: screen -rd 1337.node
Create pool wallet.
If you already have a wallet you could import the seed for that. Not covered in this guide.
Chose option 2 to create
Sample:
Note: This is fake , but remember to store you info in a secure place. Not on the VPS or pool server.
exit the wallet
Create a XKR wallet script and start in a other "screen" session.
Create the wallet script
Add below:
Make the wallet start script executable
Start the wallet and make sure everything looks good ./wallet.bash
Again make sure to save the wallet seed!
ctrl+a to exist the screen session
Create a pool user.
sudo to the new pool user
Download pool software, recommend this version for XKR pool. The newer "cryptonote-nodejs-pool" have problem with unlocker when used for XKR.
Install Node modules needed
Copy config_examples/kryptokrona.json to config.json and edit the following:
Change the pool address to you wallet address for the pool under "poolServer"
Change password under "api"
β 1 warning This is IMPORTANT because this is also used for /admin.html access to the pool.
Note: "wallet" password not used if you run the wallet rpc with "--rpc-legacy-security"
Make sure payment looks something like this.
Start a screen for pool
Create script to start pool
Content:
Make the script exceutable
If you get the problem with the dateformat.js when starting pool. Edit the "package.json" and change changing the "dateformat": "*" to "dateformat": "4.5.1" in package.json, and run "npm update" again to fixed the issue. also change the git url to include "git+https://" like below.
Also add:
"bufferutil": "^4.0.5",
"utf-8-validate": "^5.0.7"
"nodemailer": "4.0.1",
Or simply download packages.json file for the pool from this repo. Make sure it's in the pool source directory.
Important run "npm update" after this change. Also "npm audit fix --force"
ctrl+a to exist the screen session
exit the pool user session
Use the sample website that comes with the pool under "website". In this guide webroot is pointing to "/var/www/html/pool"
Update the "config.js" in webroot to point to your API and add XKR explorer
Sample:
Install you favorite webserver
If you want to support TLS on pool ports, copy your files to filename cert.pem, privkey.pem (no password) and chain.pem (or change in pool config.json) to the pool directory to replace the sample files. Remember to do this also after renewal. Follow the latest cert-bot if you need a certificate.
Sample Nginx
Create the nginx pool config.
Content in this sample with SSL certificate from Lets Replace "hostname.domain.tld" with your pool hostname and domain.
Last updated