Home

Awesome

Nano work server

Build

This project is a dedicated work server for the Nano cryptocurrency. See the documentation for details on work generation and the current network difficulty.

nano-work-server 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.

If using more than one work peer, give the flag --shuffle. This makes it so that the next request is picked randomly instead of sequentially, which leads to more efficient work generation with multiple peers, especially when they are not in the same network.

Current base difficulty

0xfffffff800000000 since a75d984. See the Nano work generation guide for more information.

Installation

OpenCL

Ubuntu:

sudo apt install ocl-icd-opencl-dev

Fedora:

sudo dnf install ocl-icd-devel

Windows:

Rust

Linux:

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

Windows: follow instructions in https://www.rust-lang.org/tools/install

GCC

Ubuntu:

sudo apt install gcc

Fedora:

sudo dnf install gcc

Build

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

Depending on your system configuration and if the OpenCL library cannot be found in the PATH, it may be necessary to link against explicitly:

cargo rustc --release -- -l OpenCL -L "/path/to/opencl.lib"

Using

nano-work-server --help

Note difficulty values may be outdated in these examples.

Benchmarking

Example request:

{
    "action": "benchmark",
    "count": "10"
}

Note use a sufficiently high count as work generation is a random process.

Example response:

{
    "average": "481",
    "count": "10",
    "difficulty": "fffffff800000000",
    "duration": "4813",
    "hint": "Times in milliseconds",
    "multiplier": "1"
}

Status

Example request:

{
    "action": "status"
}

Example response:

{
    "generating": "1",
    "queue_size": "3"
}

Troubleshooting