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

Event Callback Registration for Stratum Server #2538

Closed
bladedoyle opened this issue Feb 7, 2019 · 7 comments
Closed

Event Callback Registration for Stratum Server #2538

bladedoyle opened this issue Feb 7, 2019 · 7 comments

Comments

@bladedoyle
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Pools need to get information from the built-in stratum server - for example to know when a block is found. The current options are:

  1. parse the stratum server log message - This isnt a great option because when changes are made to the log message format, or the content of the messages it breaks things.
  2. Use a modified version of the stratum server - This isnt a great option since it requires manual merge of code for each upstream change.

Describe the solution you'd like
I would like the built-in stratum server to support event hooks with callback registration api. This will allow a pool operator to write custom code that is called when events they care about occur.

@hendi
Copy link
Member

hendi commented Feb 7, 2019

👍 from grin-pool.org here (using 2. currently)

Events I'd like to see hooks for:

  • miner submits a solution
  • solution rejected, and why
  • solution accepted
  • block found
  • new job
  • new block
  • block found

@hashmap
Copy link
Contributor

hashmap commented Feb 7, 2019

For my education - I heard all pools have some proxies on top of grin stratum, can it intercept requests and gets most of this info (not sure how stratum is chatty about reasons etc)?

@hendi
Copy link
Member

hendi commented Feb 7, 2019

Yes, proxies can get most of the info. For the stuff they can't, we need to

a) modify grin-server to send us the information we need

and

b) write some logic within the proxy to remove that info/to not pass it along to miners

@hashmap
Copy link
Contributor

hashmap commented Feb 8, 2019

Sounds reasonable. Do you mean in-process API (Rust) or smth like websocket or both?

@bladedoyle
Copy link
Contributor Author

bladedoyle commented Feb 13, 2019

Not websockets. I prefer in-process for performance. I would like to be able to build my custom code into a shared library, and the grin-server would load that and call the methods I define. The simplest (though not cleanest) way is for grin-server to include a "default implementation" (just empty functions) in an external shared library, which could be replaced by the custom library I write.

[edit] the zeromq idea in #2321 also seems fine

@0xmichalis
Copy link
Contributor

Can this issue be closed now that we have webhooks? @bladedoyle @mcdallas

@hashmap
Copy link
Contributor

hashmap commented Jul 3, 2019

Closing, feel free to reopen if needed

@hashmap hashmap closed this as completed Jul 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants