The Rust node is the recommended software for the KarlsenHashv2 mainnet, providing enhanced performance, scalability, and security compared to its Golang node.
We encourage developers and blockchain enthusiasts to collaborate, test, and optimize this Rust-based implementation. Your contributions will help shape a platform focused on scalability and speed without compromising decentralization.
To compile the binaries yourself (if you're unsure whether you need to, you probably don't), you'll need to install Rust.
Mining Karlsen requires three components:
- Node (karlsend): Listens for new blocks.
- Miner: Searches for blocks to report to the node.
- Wallet: For creating and managing wallets.
All three components are standalone executables that require no installation.
You can either download the precompiled binaries or compile the codebase yourself. For most users, downloading the binaries is recommended.
Note: The karlsend node and miner must run concurrently, each from a separate console. Do not interrupt them while mining is in progress.
The simplest way to get started with Rusty-Karlsen is by downloading the binaries from here. After downloading, extract them to a folder.
Important: The rest of this guide assumes installation from source. Before running any command, navigate to the folder where you extracted the binaries:
$ cd <THE_EXTRACTED_BINARIES_FOLDER>
Linux and Mac users may need to prepend commands with ./
to execute the binary. For example:
./karlsend --utxoindex
Building on Linux
-
Install general prerequisites:
sudo apt install curl git build-essential libssl-dev pkg-config
-
Install Protobuf (required for gRPC):
sudo apt install protobuf-compiler libprotobuf-dev
-
Install the Clang toolchain (required for RocksDB and WASM secp256k1 builds):
sudo apt-get install clang-format clang-tidy clang-tools clang clangd libc++-dev libc++1 libc++abi-dev libc++abi1 libclang-dev libclang1 liblldb-dev libllvm-ocaml-dev libomp-dev libomp5 lld lldb llvm-dev llvm-runtime llvm python3-clang
-
Install the Rust toolchain. If Rust is already installed, update it with:
rustup update
-
Clone the repository:
git clone https://github.com/karlsen-network/rusty-karlsen cd rusty-karlsen
-
Build the binaries:
cargo build --release --bin karlsend --bin karlsen-wallet
Building on Windows
-
Install Git for Windows or an alternative Git distribution.
-
Install Protocol Buffers and add the
bin
directory to yourPath
. -
Install LLVM and add the
bin
directory of the LLVM installation (C:\Program Files\LLVM\bin
) toPATH
.- Set the
LIBCLANG_PATH
environment variable to point to thebin
directory as well. - Rename
LLVM_AR.exe
toAR.exe
in the LLVM installation directory to address potential C++ dependency issues.
- Set the
-
Install the Rust toolchain. If Rust is already installed, update it with:
rustup update
-
Clone the repository:
git clone https://github.com/karlsen-network/rusty-karlsen cd rusty-karlsen
-
Build the binaries:
cargo build --release --bin karlsend --bin karlsen-wallet
Building on macOS
-
Install Protobuf (required for gRPC):
brew install protobuf
-
Install LLVM:
- The default Xcode installation does not support WASM build targets. Install LLVM from Homebrew:
brew install llvm
- Add the following to your
~/.zshrc
file:
export PATH="/opt/homebrew/opt/llvm/bin:$PATH" export LDFLAGS="-L/opt/homebrew/opt/llvm/lib" export CPPFLAGS="-I/opt/homebrew/opt/llvm/include" export AR=/opt/homebrew/opt/llvm/bin/llvm-ar
- Reload the
~/.zshrc
file:
source ~/.zshrc
-
Install the Rust toolchain. If Rust is already installed, update it with:
rustup update
-
Clone the repository:
git clone https://github.com/karlsen-network/rusty-karlsen cd rusty-karlsen
-
Build the binaries:
cargo build --release --bin karlsend --bin karlsen-wallet
Karlsend offers various configuration options, but most basic operations require no configuration except for the --utxoindex
flag (which can be omitted if you're not using the wallet):
$ karlsend --utxoindex
Use karlsend --help
to view more running options.
To mine, you'll need a keypair. Start by launching the wallet:
$ ./karlsen-wallet
On Windows:
$ karlsen-wallet.exe
Use the "help" command to explore available options. For instance, to create a wallet:
-
Select a Karlsen network:
$ network mainnet
-
Create a wallet:
$ wallet create
-
Request a new address:
$ address new
Your screen will show you something like this:
Your default account deposit address:
karlsen:0123456789abcdef0123456789abcdef0123456789
Note: Each time you request an address, a new one will be generated. This is normal, as each secret key can correspond to multiple public addresses.
Note: The Golang-based built-in CPU miner has been significantly outperformed by newer GPU miners. For optimal performance, we recommend using our official Karlsen Rust-Based GPU Miner or one of the trusted third-party GPU miners listed below.
Available miners include:
To start mining, copy the address generated by your wallet and run the miner with it:
$ karlsenminer --miningaddr karlsen:<YOUR_CREATED_ADDRESS>
Note: Mining will only start after the network is fully synchronized. The miner will wait until the node is synced, which may result in seeing 0 Hashes/second initially.
You can mine using additional computers by pointing them to your main node:
$ karlsenminer -s <node IP address> --miningaddr karlsen:<YOUR_CREATED_ADDRESS>
Find your node's IP address using ifconfig
on Linux/Mac or ipconfig
on Windows.
For enhanced performance, use the Karlsen Rust-based GPU miner.
To run the miner:
$ karlsen-miner-v2.0.0-win64-amd64 --karlsend-address <node IP address> --mining-address <wallet address>
If running the miner on the same machine as karlsend, you can omit the --karlsend-address
flag, as it defaults to localhost.
Note for Windows users: The GPU miner binary is unsigned, which might cause it to be blocked by Windows Defender. You may need to manually add an exclusion.
Note for Linux/Mac users: If you encounter a permission denied
error, fix it by making the file executable:
chmod +x <file name>
To make your node publicly accessible, forward port 42111 (or the configured port) to the machine running karlsend. Public nodes help the overall health of the network by allowing others to sync with your node.
Minimum:
- 100 GB disk space
- 7th generation i7 4-core processor or AMD equivalent
- 8 GB memory
- 10 Mbit internet connection
Recommended:
- 9th generation i7 8-core processor or AMD equivalent
- 16 GB memory
- 40 Mbit internet connection
You may want to join our discord server for further questions: https://discord.gg/ZPZRvgMJDT