Giter Club home page Giter Club logo

Comments (3)

meltingice avatar meltingice commented on August 24, 2024

Ok, here's my proposed solution. Would love to hear your thoughts on this. We can introduce a separate process that handles sending and receiving, and is backed by Redis/Sidekiq.

  1. TipBot transaction is created. We store the transaction in SQLite like we already do.
  2. After writing the transaction to the db, we build a Sidekiq job and push it into the send queue. Doing so is trivial from Python.
  3. Over in the new worker process, the job is picked up and the transaction is sent to the node RPC.
  4. Once the transaction is successfully sent, the job schedules a corresponding receive job for the destination address with the address and block in the payload.
  5. The receive job is picked up by the worker, and it tells the node RPC to receive the block for the account. This is idempotent, so if the RPC fails for whatever reason, it will be automatically retried until it succeeds.

This solution is highly scalable because you can increase the number of workers and threads as needed. As the workers scale, the bottleneck will become the node, so we'll have to handle that separately if needed (but probably not for awhile).

One missing piece is that we probably want a way to update the database and tell it the transaction has been processed. Might require moving to Postgres, or we can set up some kind of interprocess communication between the two.

from graham_discord_bot.

bbedward avatar bbedward commented on August 24, 2024

Sounds about perfect to me. Besides not really needing to worry about the receives being retried. We don't care about the result of that job as much as we do the result of the send job .

Sending could use the retry mechanism, and an easy solution to the sqlite multi processing problem is probably just switching to postgres so maybe issues #3 and #5 could be prerequisites to this one.

from graham_discord_bot.

tundak avatar tundak commented on August 24, 2024

@renesq I need some support (paid also fine) for an issue, can i have your email ? or can you drop me contact on [email protected]

from graham_discord_bot.

Related Issues (20)

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.