cjdelisle / packetcrypt_rs

PacketCrypt in Rust
53 stars 43 forks source link

packetcrypt_rs

PacketCrypt implementation in Rust

What exists

PacketCrypt mining is made up of 6 distinct components:

The Master, Announcement Handler, Block Handler, and Paymaker must be operated by the mining pool, the Announcement Miner and Block Miner can be operated by 3rd parties.

This codebase currently provides the Announcement Handler and Announcement Miner components. All of the others can be found in the C PacketCrypt project.

Install

First install rust if you haven't, see: rustup

git clone https://github.com/cjdelisle/packetcrypt_rs
cd packetcrypt_rs
cargo build --release

Install Guide with CLANG build

Step 1: Copy and run the following command

sudo apt-get update && sudo apt-get install gcc git curl make clang && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh && mkdir ~/packet && cd ~/packet && git clone https://github.com/cjdelisle/packetcrypt_rs && cd packetcrypt_rs

Step 1.5(Optional). If you were using a gcc build then please copy and run the following command

cargo clean

Step 2: Copy and run the following command

CC=clang cargo build --release

Mine announcements

For more information ./target/release/packetcrypt help ann

Run an Announcement Handler

If you're running a pool, you can use the Rust announcement handler as follows:

See pool.example.toml for information about what should be in your pool.toml file.

For more information ./target/release/packetcrypt help ah

Env vars

Memory leak detection

To run with memory leak detection, build with cargo build --features leak_detect and while it is running send a SIGUSR1 signal, this will cause it to write out all of it's long lived memory to a file.

Jemalloc

You may achieve better performance by building with cargo build --release --features jemalloc

License

LGPL-2.1 or LGPL-3.0, at your option