Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Websocket subscription for work notifications #2289

Conversation

guilhermelawless
Copy link
Contributor

@guilhermelawless guilhermelawless commented Sep 6, 2019

No filtering options. Examples:

Generated:

 {
    "success": "true",
    "reason": "",
    "duration": "306",
    "request": {
        "hash": "3ECE2684044C0EAF2CA6B1C72F11AFC5B5A75C00CFF993FB17B6E75F78ABF175",
        "difficulty": "ffffff999999999a",
        "multiplier": "10.000000000009095"
    },
    "result": {
        "source": "192.168.1.101:7000",
        "work": "4352c6e222703c57",
        "difficulty": "ffffffd2ca03b921",
        "multiplier": "22.649415016750655"
    },
    "bad_peers": ""
}

Cancelled with one bad peer:

 {
    "success": "false",
    "reason": "cancelled",
    "duration": "539",
    "request": {
        "hash": "3ECE2684044C0EAF2CA6B1C72F11AFC5B5A75C00CFF993FB17B6E75F78ABF175",
        "difficulty": "ffffff999999999a",
        "multiplier": "10.000000000009095"
    },
    "bad_peers": [
        "192.168.1.101:7000"
    ]
}
  • Duration is in ms.
  • Failure is the same as cancelled but "reason": "failure".
  • When work generation is done locally it will show "source": "local".

Also fixed another issue in distributed_work. It got a little out of hand, especially so soon after a refactor, but it's the price to handle work generation locally and through peers, as well as cancelling.

@guilhermelawless guilhermelawless added documentation This item indicates the need for or supplies updated or expanded documentation websockets labels Sep 6, 2019
@guilhermelawless guilhermelawless added this to the V20.0 milestone Sep 6, 2019
@guilhermelawless guilhermelawless self-assigned this Sep 6, 2019
@guilhermelawless guilhermelawless requested review from wezrule and removed request for SergiySW September 8, 2019 08:11
Copy link
Contributor

@wezrule wezrule left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a minor comment to resolve.

nano/node/distributed_work.cpp Outdated Show resolved Hide resolved
@guilhermelawless guilhermelawless merged commit 90ec334 into nanocurrency:master Sep 8, 2019
@guilhermelawless guilhermelawless deleted the websockets/pow-subscription branch September 8, 2019 10:24
guilhermelawless added a commit to guilhermelawless/nano-docs that referenced this pull request Sep 23, 2019
guilhermelawless added a commit to nanocurrency/nano-docs that referenced this pull request Sep 25, 2019
* Websocket updates

- PoW notification nanocurrency/nano-node#2289
- Keepalive nanocurrency/nano-node#2307

* Update advanced.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation This item indicates the need for or supplies updated or expanded documentation websockets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants