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.
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.
./xkrwallet
Chose option 2 to create
Sample:
What would you like to do?: 2
What would you like to call your new wallet?: Pool
Give your new wallet a password: **********
Confirm your new password: **********
Welcome to your new wallet, here is your payment address:
SEKReV8VHMiUg4kMFBfWE5tfb5d9xRQrB4xY8mxR36d2EaCPGBN6kGh9xyc3eGJtr98XpxAVHcqDzRSRXU7U3rTBd3cjdv2Nhbr
Please copy your secret keys and mnemonic seed and store them in a secure location:
Private spend key:
f1a58c31f88d5f8779cefdd70c6bd7f1bfb207ff28b09a1b7bf64b35dc49850e
Private view key:
5f12972e781f67dec0e96c08ee498d0b76323080796a520e0727b240cbd97801
Mnemonic seed:
building building building building cent peaches ostrich washing dexterity highway tsunami tumbling request punch rest reorder cuddled alchemy jittery request uttered lamb opus portents punch
If you lose these your wallet cannot be recreated!
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.
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.
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:
var api = "https://poolhostname.domain.tld/api/";
let parentCoin = ""
var email = "support@poolhost.com";
var telegram = "https://t.me/YourPool";
var discord = "https://discordapp.com/invite/YourPool";
var facebook = "https://www.facebook.com/<YourPoolFacebook>";
var marketCurrencies = ["{symbol}-BTC", "{symbol}-LTC", "{symbol}-DOGE", "{symbol}-USDT", "{symbol}-USD", "{symbol}-EUR", "{symbol}-CAD"];
var blockchainExplorer = "https://explorer.kryptokrona.se/?hash={id}#blockchain_block";
var transactionExplorer = "https://explorer.kryptokrona.se/?hash={id}#blockchain_transaction";
var blockchainExplorerMerged = "";
var transactionExplorerMerged = "";
var themeCss = "themes/default.css";
var defaultLang = 'en';
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
sudo apt install nginx
Create the nginx pool config.
sudo vi /etc/nginx/sites-available/pool
Content in this sample with SSL certificate from Lets Replace "hostname.domain.tld" with your pool hostname and domain.
server {
# Enable HTTP/2
listen 443 ssl http2 default_server;
server_name hostname.domain.tld;
ssl_certificate /etc/letsencrypt/live/hostname.domain.tld/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/hostname.domain.tld/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
root /var/www/html/pool;
# Add index.php to the list if you are using PHP
index index.html index.htm;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
#add_header 'Access-Control-Allow-Origin' 'origin-list' always;
if ($http_origin ~* (https?://[^/]*\.kryptokrona\.se(:[0-9]+)?)) {
add_header 'Access-Control-Allow-Origin' "$http_origin";
}
#add_header 'Access-Control-Allow-Origin' '*';
#add_header 'Access-Control-Allow-Credentials' 'true' always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header Referrer-Policy origin-when-cross-origin;
add_header X-Permitted-Cross-Domain-Policies none;
# Add Security cookie flags
proxy_cookie_path ~(.*) "$1; SameSite=strict; secure; httponly";
}
if ($request_method !~ ^(GET|HEAD|POST)$ )
{
return 405;
}
location ~ ^/api/(.*) {
proxy_pass http://127.0.0.1:8117/$1$is_args$args;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# Add Security cookie flags
proxy_cookie_path ~(.*) "$1; SameSite=strict; secure; httponly";
}
# Allow access to the ACME Challenge for Let's Encrypt <- <3
location ~ /\.well-known\/acme-challenge {
allow all;
}
# Deny all attempts to access hidden files
# such as .htaccess, .htpasswd, .DS_Store (Mac), .git, .etc...
location ~ /\. {
deny all;
}
}