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

Subscribe to notifications for new boost jobs and completed jobs. #8

Open
DanielKrawisz opened this issue Jun 28, 2022 · 1 comment

Comments

@DanielKrawisz
Copy link
Contributor

The boost stratum server reads all open jobs from the API on startup but after that point has no way of detecting changes to currently open jobs. Two possible ways that the open jobs can change are

  • an new job is detected
  • an old job is completed

We discussed a system similar to Kafka + Zookeeper, which is what BTCPool used, that has some kind of centralized message queue. The blockchain scanner should send messages on this queue for new jobs and completed jobs.

New jobs: need an outpoint (txid and output index), and an output (script and satoshi value)
Completed job: need the outpoint of the completed output.

@owenkellogg
Copy link
Contributor

In summary the stratum server needs two queues. Good news is the app is already set up to use rabbitmq for this exact purpose in a rather elegant way.

The powco-api service will publish boost.job.created and boost.job.completed events to rabbitmq.

The boost-stratum service will maintain a queue receiving the boost.job.created and boost.job.completed events and respond accordingly by updating its internal state and triggering further actions.

The rabbitmq interaction is already set up and configured using the rabbi library for typescript, which I personally developed. In this way we get reliable real-time message passing between our various services regardless of which host or data center.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants