Comments (3)
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.
- TipBot transaction is created. We store the transaction in SQLite like we already do.
- 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. - Over in the new worker process, the job is picked up and the transaction is sent to the node RPC.
- 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.
- 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.
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.
@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)
- Improve Documentation
- Update SQL utilities for postgres
- Add A Licence. HOT 2
- Usernames are not escaped (in tip notification) HOT 3
- triple tip worked, but only last tip got emojis. HOT 2
- No list of library dependencies HOT 2
- Add support for graphene based coins like STEEM and BTS HOT 1
- QOL Improve Copy and Pasting of address from .wfu command HOT 1
- Answer something for `wfu` for non-existing userId HOT 1
- Expand test coverage
- Use decimal instead of float
- Change Giveaway's name to lottery
- `!addfavorite` doesn't fail if user is already on the list
- chore: Add instructions to set banano
- Make the Bot "public" HOT 1
- Active users? Feature add!
- Websocket closed with 4014, cannot reconnect HOT 1
- Bot made me in 4.6k banano debt
- Understanding the behavior of the bot
- Get Bot Able To Run On Mutliple Servers HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graham_discord_bot.