Coder Social home page Coder Social logo

pinkdiamond1 / nano-work-server Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nanocurrency/nano-work-server

0.0 1.0 0.0 147 KB

A dedicated work server for the Nano cryptocurrency

License: BSD 3-Clause "New" or "Revised" License

Rust 88.34% C 11.66%

nano-work-server's Introduction

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.

  • 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_all": "1",
        "valid_receive": "1",
        "difficulty": "ffffffd21c3933f4",
        "multiplier": "1.3946469"
    }
  • work_cancel example:

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

    Response:

    {
    }

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

  • Linux OpenCL AMD GPU series error: thread 'main' panicked at 'Failed to create GPU from string "00:00" - see solution here

nano-work-server's People

Contributors

guilhermelawless avatar plasmapower avatar zhyatt avatar icarusglider avatar optout21 avatar jserv avatar junwei0117 avatar nifni avatar tyshchenko avatar

Watchers

 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.