RadiantBlockchain / radiant-node

Radiant Blockchain Node - SHA512/256 Proof-of-Work
MIT License
23 stars 35 forks source link

mining directly to own node, #15

Open becharaSfeir opened 1 year ago

becharaSfeir commented 1 year ago

please provide process of direct mining, to one's own node, to ensure real decentralization

thank you

tjayz commented 8 months ago

While I realize this is old I figure I'd answer to help others in same predicament as I just learned how to do it all recently.

After node is up and running:

Easy way, con is limited to 1 mining software: https://github.com/RadiantBlockchain/rad-bfgminer It acts as a bridge, any other miner will fail because it depends on stratum, even node function of bzminer will fail.

Hard way, build https://github.com/oliverw/miningcore which makes your own pool and acts as the bridge. I used a much more recent fork from blackmennewstyle. If wanting to mine ssl and share your pool with others you will likely want to add https://github.com/minernl/Miningcore.WebUI which again I used a much more recent fork from xiaolin1579 .

Most is self explanatory from the guides. The difficult part is setting up nginx/certs/ssl. I used nginx for windows and put the WebUI directory in its root and the certs inside /conf. I settled on the following settings I am sure an expert can do much better, is however functional for all my needs. My certs were self signed and ssl can be achieved via --no-strict-ssl via rigel and other miners have analogous settings.

nginx.conf:

worker_processes  1;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;

    keepalive_timeout  65;

    gzip  off;

    client_max_body_size 100M;

    server {
        listen       80;
        server_name  Yourdomain.com;
        return 301 https://$host$request_uri;
    }

# HTTPS server

    server {
        listen       443 ssl;
        server_name  Yourdomain.com;

        ssl_certificate      rxd.crt;
        ssl_certificate_key  rxd.key;

        ssl_session_cache    shared:SSL:1m;
        ssl_session_timeout  5m;

        ssl_ciphers  HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers  on;

        location / {

            root   WebUI;
            index  index.html;

            try_files $uri $uri/ =404;
            proxy_set_header Host $host;
            proxy_set_header X-Forwarded-Proto https;
            proxy_read_timeout 5;
            proxy_connect_timeout 5;
            proxy_set_header X-Real-IP $remote_addr;
        }
        location /api/ {

            proxy_pass http://127.0.0.1:4000;

        }
    }
}

My certs were created via openssl v3.2. For the key file and the crt use the following: openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout rxd.key -out rxd.crt openssl pkcs12 -export -keypbe NONE -certpbe NONE -nomaciter -passout pass: -out rxd.pfx -inkey rxd.key -in rxd.crt

The pfx is needed for miningcore. Cheers!