/nano-work-server

A dedicated work server for the Nano cryptocurrency

Primary LanguageRustBSD 2-Clause "Simplified" LicenseBSD-2-Clause

Nano work server

This project is a dedicated work server for the Nano cryptocurrency.

It supports the work_generate, work_cancel, and work_validate commands from the Nano RPC. For details on these commands, see the Nano RPC documentation.

To see available command line options, run nano-work-server --help.

To use with the beta network (lower work difficulty), give the flag --beta. Working with both networks simultaneously is not supported.

Installation

OpenCL

Ubuntu:

sudo apt install ocl-icd-opencl-dev

Fedora:

sudo dnf install ocl-icd-devel

Rust

curl https://sh.rustup.rs -sSf | sh

Build and run

git clone https://github.com/nanocurrency/nano-work-server.git
cd nano-work-server
cargo build --release
cd target/release
./nano-work-server --help

Using

  • work_generate example:

    {
        "action": "work_generate",
        "hash": "718CC2121C3E641059BC1C2CFC45666C99E8AE922F7A807B7D07B62C995D79E2",
        "difficulty": "ffffffc000000000",
        "multiplier": "1.0" // overrides difficulty
    }

    Response:

    {
        "work": "2bf29ef00786a6bc",
        "difficulty": "ffffffd21c3933f4",
        "multiplier": "1.3946469"        
    }
  • work_validate example:

    {
        "action": "work_validate",
        "hash": "718CC2121C3E641059BC1C2CFC45666C99E8AE922F7A807B7D07B62C995D79E2",
        "work": "2bf29ef00786a6bc",
        "difficulty": "ffffffc000000000",
        "multiplier": "1.0" // overrides difficulty
    }

    Response:

    {
        "valid": "1",
        "difficulty": "ffffffd21c3933f4",
        "multiplier": "1.3946469"
    }
    
  • work_cancel example:

    {
        "action": "work_cancel",
        "hash": "718CC2121C3E641059BC1C2CFC45666C99E8AE922F7A807B7D07B62C995D79E2"
    }

    Response:

    {
    }