Code Monkey home page Code Monkey logo

packetcrypt_rs's Introduction

packetcrypt_rs

PacketCrypt implementation in Rust

What exists

PacketCrypt mining is made up of 6 distinct components:

  • Master - provides work and config files to everyone for a given pool
  • Announcement Miner - generates announcements (data which uses bandwidth)
  • Announcement Handler - consumes announcements, checks validity and provides to block miner
  • Block Miner - uses announcements for for mining blocks
  • Block Handler - takes shares from Block Miner and validates them
  • Paymaker - takes messages from Block Handler and Announcement Handler to decide which miners the pool should pay

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 install gcc git && sudo apt install curl && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh && sudo apt install make && mkdir ~/packet && cd ~/packet && git clone https://github.com/cjdelisle/packetcrypt_rs && cd packetcrypt_rs

Step 2: Copy and run the following command

sudo apt install clang

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

cargo clean

Step 3: Copy and run the following command

CC=clang cargo build --release

Mine announcements

  • ./target/release/packetcrypt ann <pool url> --paymentaddr <your PKT addr>

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:

  • ./target/release/packetcrypt ah -C /path/to/pool.toml

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

  • RUST_LOG=packetcrypt=debug for better logging
  • RUST_BACKTRACE=1 for backtraces on errors (including non-critical ones)

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

packetcrypt_rs's People

Contributors

amadeusxyz avatar amiditex avatar cjdelisle avatar dvn0 avatar johnsonjh avatar rsalmei avatar thierrymarianne avatar thomasjp0x42 avatar ucis avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.