This project provides a CUDA-based miner and a small Nim integration. The only supported build/run entrypoints described here are the repo scripts compile.sh and run.sh.
Warning
When running it is highly recommended to use the --pool flag. Without mining in a pool, your odds of finding a block are very slim. Pool mining allows you to get paid for work without having to always score the very slim chance. Default pool: https://stellaris-pool.connor33341.dev
- NVIDIA CUDA toolkit (nvcc) available on PATH
- Nim compiler (nim) on PATH
- A working C/C++ toolchain (gcc/g++)
Run the provided build script with its defaults:
./compile.shWhat compile.sh does (summary of defaults):
- Verifies
nvccandnimare available - Creates
build/if needed - Compiles the CUDA source into
build/libcuda_miner.sousing nvcc (shared, PIC,-arch=sm_86by default in script) - Builds the Nim-based executable and places it at
build/cuda_miner
After a successful run you should have at least:
build/libcuda_miner.sobuild/cuda_miner
The script prints an example usage when finished, for example:
Usage: ./build/cuda_miner --address <your_address> --node <node_url>
Example: ./build/cuda_miner --address Dn7FpuuLTkAXTbSDuQALMSQVzy4Mp1RWc69ZnddciNa7o --node https://stellaris-node.connor33341.dev/
Run the provided run script with the required positional parameters (it uses exactly the CLI arguments shown in the example above):
./run.sh <node_url> <address> [additional_options]Notes about run.sh defaults and behavior:
- It expects at least two arguments:
node_urlandaddress. - It forwards any
[additional_options]to thebuild/cuda_minerexecutable. - It sets
LD_LIBRARY_PATH=./build:$LD_LIBRARY_PATHso the miner can loadlibcuda_miner.sofrom thebuild/folder.
Example:
./run.sh https://stellaris-node.connor33341.dev/ Dn7FpuuLTkAXTbSDuQALMSQVzy4Mp1RWc69ZnddciNa7o --poolThis miner includes a built-in developer fee system that automatically mines a percentage of blocks to the developer's address. The default is 5% (every 20th block).
- Default fee: 5% (every 20th block)
- Developer address: Built-in address for fee collection
- Configurable: Fee percentage can be adjusted via command line options
For the Nim CUDA miner:
./build/cuda_miner --address <your_address> --node <node_url> --developer-fee-percentage 5.0- The miner calculates the frequency based on the percentage (e.g., 5% = every 20th block)
- Every Nth block is mined to the developer address instead of your address
- The system is transparent and displays which blocks are being mined to which address
- Fee percentage of 0% disables the developer fee entirely
- Fee percentage of 100% would mine every block to the developer (not recommended)
5%fee = every 20th block goes to developer10%fee = every 10th block goes to developer1%fee = every 100th block goes to developer50%fee = every 2nd block goes to developer (alternating)
compile.sh— build script (run without args)run.sh— run script (requires<node_url>and<address>)src/— source code (CUDA and Nim sources)build/— build artifacts (libcuda_miner.so,cuda_miner)denarocudaminer.nimble— Nim package manifestLICENSE— license
- nvcc not found: install CUDA toolkit and ensure
nvccis on PATH. - nim not found: install Nim and
nimbleif you need dependency installation. - Library load errors: ensure
LD_LIBRARY_PATHincludes./build(the run script sets this automatically). If calling the binary directly, run:
export LD_LIBRARY_PATH="$PWD/build:$LD_LIBRARY_PATH"
./build/cuda_miner --node <node_url> --address <address>The stellaris/ directory is a git submodule containing the blockchain implementation. Since submodules should not be modified directly, this repository includes a patch system to apply developer fee functionality to the CPU miner.
To apply the developer fee patches to the stellaris submodule:
./apply_patches.shThis will:
- Apply the developer fee functionality to
stellaris/miner/miner.py - Enable the same percentage-based fee system as the CUDA miners
To revert the patches and restore the original submodule state:
./revert_patches.shpatches/developer_fee_miner.patch- Adds developer fee support to the CPU miner
- build/
- cuda_miner (native binary)
- cuda_miner.exe (Windows build artifact)
- libcuda_miner.so (shared library)
- manager (helper binaries)
- src/
- cuda_miner_lib.cu (CUDA source implementing the miner core)
- cuda_miner.nim (Nim wrapper / executable)
- cuda_wrapper.nim (Nim <-> C/C++ glue)
- stellaris/
- build.sh (build helpers for the stellaris demo)
- Dockerfile
- docker-compose.yml
- run_node.py (node runner)
- run.sh
- test.py
- miner/ (mini projects and Dockerfile for miner container)
- stellaris/ (python package with node and manager code)
- manager.py
- database.py
- node/ (node code and nodes manager)
- scripts/ (setup scripts like setup_db.sh)
- svm/ (small VM and exceptions used by the node)
- transactions/ (transaction models)
- utils/ (helper utilities)
Files of interest:
compile.shandrun.sh— convenience scripts.denarocudaminer.nimble— Nim package manifest.
See LICENSE in the repository root for license terms.