diff --git a/Dockerfile b/Dockerfile index 1b1aaa00b..7e093ab14 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,6 +36,19 @@ ENV PACKAGES="\ uthash-dev \ nodejs \ vim \ + libboost-chrono-dev \ + libboost-filesystem-dev \ + libboost-test-dev \ + libboost-thread-dev \ + libevent-dev \ + libminiupnpc-dev \ + libssl-dev \ + libzmq3-dev \ + help2man \ + ninja-build \ + python3 \ + libdb++-dev \ + wget \ " RUN apt update && apt install --no-install-recommends -y $PACKAGES && \ @@ -57,21 +70,44 @@ RUN git clone https://github.com/RadiantBlockchain/rad-bfgminer-helper.git /root WORKDIR /root/rad-bfgminer-helper RUN npm install +# Install cmake to prepare for radiant-node +RUN mkdir /root/cmaketmp +WORKDIR /root/cmaketmp +RUN wget https://github.com/Kitware/CMake/releases/download/v3.20.0/cmake-3.20.0.tar.gz +RUN tar -zxvf cmake-3.20.0.tar.gz +WORKDIR /root/cmake-3.20.0 +RUN ./bootstrap +RUN make +RUN make install + +# Install radiant-node +WORKDIR /root +RUN git clone https://github.com/radiantblockchain/radiant-node.git +RUN mkdir /root/radiant-node/build +WORKDIR /root/radiant-node/build +RUN /root/cmaketmp/cmake-3.20.0/bin/cmake -GNinja .. -DBUILD_RADIANT_QT=OFF +RUN ninja + +ENTRYPOINT ["/usr/local/bin/radiantd -rpcworkqueue=64 -rpcthreads=64 -rest -server -rpcbind -rpcallowip='0.0.0.0/0' -txindex=1 -rpcuser=raduser -rpcpassword=radpass"] + # Load up a shell to be able to run on vast.ai and connect CMD ["bash"] -# -# # Once you login you will see a folder structure like: # # root@C.482204:~$ ls # onstart.sh rad-bfgminer rad-bfgminer-helper # root@C.482204:~$ # -# Launch rad-bfgminer like: +# Launch rad-bfgminer like (specify url to the radiantd node process or a stratum server) # -# /root/rad-bfgminer/bfgminer -S opencl:auto -o http://miner.radiantblockchain.org:7332 -u raduser -p radpass --set-device OCL:kernel=poclbm --coinbase-sig rad-bfgminer-misc --generate-to 1KSFaegQYMgQRfr2jWfHxy5pv6CQvHB5Lz >> /root/bfgminer.txt # +# Single GPU example: +# /root/rad-bfgminer/bfgminer -S opencl:auto -o http://master.radiantblockchain.org:7332 -u raduser -p radpass --set-device OCL:kernel=poclbm --coinbase-sig rad-bfgminer-misc --generate-to 16JR3uTBpTSnhWfLdX8D5EcMrTVhrBCr2X + +# 4x GPU example: +# /root/rad-bfgminer/bfgminer -S opencl:auto -o http://master.radiantblockchain.org:7332 -u raduser -p radpass --set-device OCL0:kernel=poclbm --set-device OCL1:kernel=poclbm --set-device OCL2:kernel=poclbm --set-device OCL3:kernel=poclbm --coinbase-sig rad-bfgminer-misc --generate-to 16JR3uTBpTSnhWfLdX8D5EcMrTVhrBCr2X + # The above command will begin mining and generating any coinbase rewards into 1KSFaegQYMgQRfr2jWfHxy5pv6CQvHB5Lz # # @@ -84,7 +120,7 @@ CMD ["bash"] # # node start_radbfgminer.js #---------------------------------------------------- -# Mnemonic seed phrase random every time (NOT USED) --> favorite success manual property energy cry feel shift celery alter fluid bullet <-- +# Mnemonic seed phrase random every time (NOT USED) --> this success manual property energy cry feel shift celery not valid no bullet <-- # Showing first address associated with the random mnemonic seed phrase... # Address: 13rXNRH2afHmhGdWGZfz9KMusfRQ7TVxaz # Private Key WIF: KxK2f6eKvRcHsoFjmWDQkkANXpmp1Bi4Qhhdbj1k8Yhkn2pA @@ -120,53 +156,4 @@ CMD ["bash"] # # Look inside rad-bfgminer-helper/minerIndex.json and see which key index is being used (it will increment on each new found block) - - -# -# ------- MISC SETUPS -------- -# Audience: Developers who want to host radiantd or electrumx or other services like block explorer -# -# - -# Setup Electrumx to server UTXOS and blockchain data -# -# git clone https://github.com/RadiantBlockchain/electrumx.git -# -# -# -# Create prod.env in the electrumx -# -# -#$ cat ./prod.env -#DAEMON_URL=http://raduser:radpass@localhost:7332/ -# -#COIN=BitcoinSV -# -#REQUEST_TIMEOUT=60 -# -#DB_DIRECTORY=/home/ubuntu/electrumdb -# -#DB_ENGINE=leveldb -# -#SERVICES=tcp://:50010 -#HOST="" -# -#ALLOW_ROOT=true -# -#CACHE_MB=300 -# -# mkdir /home/ubuntu/electrumdb -# -# Install python3 package manager pip to begin install deps -# -# sudo apt install python3-pip -# -# Install deps: -# -# python3 -m pip install aiorpcx -# python3 -m pip install aiohttp -# python3 -m pip install pylru -# python3 -m pip install pycryptodome -# -# -# \ No newline at end of file + \ No newline at end of file diff --git a/MINING_RAD_GUIDE.md b/MINING_RAD_GUIDE.md new file mode 100644 index 000000000..065df4013 --- /dev/null +++ b/MINING_RAD_GUIDE.md @@ -0,0 +1,126 @@ +# Mining Radiant (RAD) Guide + +The purpose of this guide is to provide instructions on how to GPU mine Radiant (RAD) Blockchain. + +Setting up a node is out of scope of this guide, instead a sample URL is provided. + +## Requirements + +- Bitcoin/Radiant wallet address and private keys (ex: https://bitaddress.org - use at own risk!) +- Vast.ai account; or +- Computer with OpenCL/CUDA 11.2+ compatible GPU + +## Mining with vast.ai + +### Step 1. Create an account at vast.ai + +Login and add some credit to your account. Most miners we are using cost between $0.20 to $0.35 per hour (ex: RTX 3090) + +### Step 2. Specify and Load Prebuilt Docker Image + +The latest prebuilt docker image can be pulled from https://hub.docker.com/repository/docker/radiantblockchain/rad-bfgminer + +Follow the instructions in vast.ai to specify the image `radiantblockchain/rad-bfgminer:latest` + +Select 'Edit Image & Configure': + +![GPU Selection Screen](vastai1.png) + +Select a template slot: + +![Choose docker image](vastai2.png) + +Specify `radiantblockchain/rad-bfgminer:latest` as the docker image to pull. Make sure to select `Run interactive shell server. SSH`. Once +finished press 'Select'. Now the docker image is prepared in your configuration to choose a GPU system to rent. + +![Select options](vastai3.png) + +Please note: at the time of writing there is a bug in the vast.ai user interface that prevents removing the `null:` tag. Type something into +the text box and then enter the full `radiantblockchain/rad-bfgminer:latest` and then remove any excess characters at the beginning. + +Select 'Rent' for a GPU to begin loading the image + +![Rent system](vastairent.png) + +### Step 3. SSH/Powershell into the server + +Navigate to the 'Instances' tab in the UI and once the docker image is loaded (after about 2 to 5 minutes) you will see a 'Connect' button. + +![Rent system](vastai4.png) + +The SSH connect command is displayed. Please note, you may need to create a local SSH key first and it will prompt you to specify one. + +Use the following guide to create one: https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent + +After that key is provided, now you can securely connect via SSH to the vast.ai host: + +![Rent system](vastai5.png) + +After that key is provided, now you can securely connect via SSH to the vast.ai host. Once connected, proceed to the next step below. + +### Step 4. Run RAD-BFGMINER + +![Run rad-bfgminer](vastai6.png) + +Navigate to the `rad-bfgminer` directory and execute the following command. *Please note* you MUST specify your own `--generate-to` address (Ex: https://bitaddress.org for example, use at own risk) in the command below: + + +``` +cd rad-bfgminer +``` + +Run the miner with all options to enable GPU, URL endpoint to an existing node (Ex: `master.radiantblockchain.org:7332` can be replaced with your own node URL if you wish or leave it as is) + +``` +/root/rad-bfgminer/bfgminer -S opencl:auto -o http://master.radiantblockchain.org:7332 -u raduser -p radpass --set-device OCL:kernel=poclbm --coinbase-sig hello-miner --generate-to +``` +EX: replace `` with your public address and replace `hello-miner` with your miner id (keep it short, no spaces allowed) + +### Step 5. Browse Radiant Blockchain + +You can use the public blockchain explorer at https://explorer.radiantblockchain.org to browse existing blocks and find your address to see which blocks you mined. + +![Explorer homepage](explorer1.png) + +Clicking on any block will bring up details about that block, transactions included and the miner information. + +![View block](explorer2.png) + +Show details for an address by clicking on the coinbase output address to see balances and activity for the address. + +![View address information](explorer3.png) + +## Mining with owned system + +To mine Radiant (RAD) with a non-hosted system, simply follow the build instructions the normal way to build bfgminer. + +It may be helpful to consult the Dockerfile for more examples + +Clone and build the repo (tested on Ubuntu 18.04 and Ubuntu 20.04). Expected to work on all supported OS. + +``` +git clone https://github.com/radiantblockchain/rad-bfgminer.git +cd rad-bfgminer +# Replace the github paths or the ./autogen.sh script fails since it checks out git submodules that can hang socket timeout +git config --global url.https://github.com/.insteadOf git://github.com/ +./autogen.sh +./configure --enable-opencl +make +``` + +Single GPU example: + +``` +./bfgminer -S opencl:auto -o http://master.radiantblockchain.org:7332 -u raduser -p radpass --set-device OCL:kernel=poclbm --coinbase-sig rad-bfgminer-misc --generate-to + +./bfgminer -S opencl:auto -o http://master.radiantblockchain.org:7332 -u raduser -p radpass --set-device OCL:kernel=poclbm --coinbase-sig rad-bfgminer-misc --generate-to +``` + +4x GPU example: + +``` +./bfgminer -S opencl:auto -o http://master.radiantblockchain.org:7332 -u raduser -p radpass --set-device OCL0:kernel=poclbm --set-device OCL1:kernel=poclbm --set-device OCL2:kernel=poclbm --set-device OCL3:kernel=poclbm --coinbase-sig rad-bfgminer-misc --generate-to +``` + +*Note*: Ensure you replace `rad-bfgminer-misc` with your miner id and also the `--generate-to` address to the public address you generated with bitaddress.org (Use at your own risk!) + \ No newline at end of file diff --git a/README b/README.md similarity index 97% rename from README rename to README.md index 036bec25a..e2fa07995 100644 --- a/README +++ b/README.md @@ -1,6 +1,34 @@ -Novo Bitcoin Miner +# Radiant (RAD) Blockchain Miner +## SHA512/256 -This miner has been modified to work with Novo Bitcoin's sha256dt algorithm +This miner has been modified to work with Radiant (RAD) Blockchain's SHA512/256 algorithm + +Clicking on any block will bring up details about that block, transactions included and the miner information. + +[Open Radiant (RAD) Mining Guide](MINING_RAD_GUIDE.md) + +## Quick Start How to Clone and Build. + +For additional details see the [Dockerfile](Dockerfile) + +``` +git clone https://github.com/radiantblockchain/rad-bfgminer.git /root/rad-bfgminer +cd rad-bfgminer +//Replace the github paths or the ./autogen.sh script fails since it checks out git submodules that can hang socket timeout +git config --global url.https://github.com/.insteadOf git://github.com/ +./autogen.sh +// Need to build with --enable-opencl +./configure --enable-opencl +make +``` +## Example how to mine with 4x GPUs using the poclbm (recommended) kernel + +> +> ./bfgminer -S opencl:auto -o http://node.radiantblockchain.org:7332 -u raduser -p radpass --set-device OCL0:kernel=poclbm --set-device OCL1:kernel=poclbm --set-device OCL2:kernel=poclbm --set-device OCL3:kernel=poclbm --coinbase-sig rad-bfgminer-misc --generate-to 16JR3uTBpTSnhWfLdX8D5EcMrTVhrBCr2X + + +--------- +## Previous Documentation Compile with OpenCL enabled: diff --git a/explorer1.png b/explorer1.png new file mode 100644 index 000000000..9aba88255 Binary files /dev/null and b/explorer1.png differ diff --git a/explorer2.png b/explorer2.png new file mode 100644 index 000000000..31ab647e4 Binary files /dev/null and b/explorer2.png differ diff --git a/explorer3.png b/explorer3.png new file mode 100644 index 000000000..469cf7dd0 Binary files /dev/null and b/explorer3.png differ diff --git a/vastai1.png b/vastai1.png new file mode 100644 index 000000000..168494807 Binary files /dev/null and b/vastai1.png differ diff --git a/vastai2.png b/vastai2.png new file mode 100644 index 000000000..5190b9f5d Binary files /dev/null and b/vastai2.png differ diff --git a/vastai3.png b/vastai3.png new file mode 100644 index 000000000..2e6553380 Binary files /dev/null and b/vastai3.png differ diff --git a/vastai4.png b/vastai4.png new file mode 100644 index 000000000..91a5f9f98 Binary files /dev/null and b/vastai4.png differ diff --git a/vastai5.png b/vastai5.png new file mode 100644 index 000000000..35487fa76 Binary files /dev/null and b/vastai5.png differ diff --git a/vastai6.png b/vastai6.png new file mode 100644 index 000000000..24a7094ae Binary files /dev/null and b/vastai6.png differ diff --git a/vastairent.png b/vastairent.png new file mode 100644 index 000000000..0a33d62f1 Binary files /dev/null and b/vastairent.png differ diff --git a/version.c b/version.c index 17144d689..504ed0827 100644 --- a/version.c +++ b/version.c @@ -13,4 +13,4 @@ const char * const bfgminer_name_space_ver = PACKAGE " " VERSION; const char * const bfgminer_name_slash_ver = PACKAGE "/" VERSION; -const char * const bfgminer_ver = VERSION; +const char * const bfgminer_ver = "rad-bfgminer";