Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Commit

Permalink
Merge pull request #5 from RadiantBlockchain/master
Browse files Browse the repository at this point in the history
Merge Changes to Master
  • Loading branch information
RadiantBlockchain authored Jun 24, 2022
2 parents f8f6b32 + 65507c6 commit 5cb4d67
Show file tree
Hide file tree
Showing 14 changed files with 199 additions and 58 deletions.
97 changes: 42 additions & 55 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand All @@ -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:
#
# [email protected]:~$ ls
# onstart.sh rad-bfgminer rad-bfgminer-helper
# [email protected]:~$
#
# 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
#
#
Expand All @@ -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
Expand Down Expand Up @@ -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
#
#
#

126 changes: 126 additions & 0 deletions MINING_RAD_GUIDE.md
Original file line number Diff line number Diff line change
@@ -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 <your address>
```
EX: replace `<your address>` 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 <your address>
./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 <your address>
```

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 <your address>
```

*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!)

32 changes: 30 additions & 2 deletions README → README.md
Original file line number Diff line number Diff line change
@@ -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:

Expand Down
Binary file added explorer1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added explorer2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added explorer3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vastai1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vastai2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vastai3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vastai4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vastai5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vastai6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vastairent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion version.c
Original file line number Diff line number Diff line change
Expand Up @@ -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";

0 comments on commit 5cb4d67

Please sign in to comment.