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

Feature: Persist in REDIS or PostgreSQL Payments Done #58

Open
jvxis opened this issue Jan 1, 2023 · 7 comments
Open

Feature: Persist in REDIS or PostgreSQL Payments Done #58

jvxis opened this issue Jan 1, 2023 · 7 comments

Comments

@jvxis
Copy link

jvxis commented Jan 1, 2023

Hi, It would be nice to persist in Redis or PostgreSQL all the payments done successfully by the mining pool.

Thanks,
Jaime

@jvxis jvxis changed the title Feature: Persist in REDIS Payments Done Feature: Persist in REDIS or PostgreSQL Payments Done Jan 1, 2023
@killerwhile
Copy link
Member

Not sure if redis is the right place to put this, since it's not the best pattern to put unbounded collections in Redis, but storing the transactions in PostgresQL is a good idea, thanks for the proposal!

@jvxis
Copy link
Author

jvxis commented Jan 1, 2023

Yes, I'm using both Redis and PostgreSQL combined for this Dashboard. Including a table in PostgreSQL with all transactions (Payments) made would be nice.
image

@Lbqds
Copy link
Member

Lbqds commented Jan 3, 2023

As @killerwhile said, it might be better to store the payments in PostgreSQL.

But if you want this now, you can change this line to redisTx.expire(_this.txRewardsKey(txId), TIMEOUT), instead of removing the succeed payments immediately, it saves payments on Redis until timeout.

@jvxis
Copy link
Author

jvxis commented Jan 3, 2023

Thanks. Does this will persist on REDIS the hash, miner address and paid amount?

@Lbqds
Copy link
Member

Lbqds commented Jan 3, 2023

Thanks. Does this will persist on REDIS the hash, miner address and paid amount?

Yes, the hset key is rewards: txId, the entry key is the miner address, and the entry value is paid amount.

@jvxis
Copy link
Author

jvxis commented Jan 3, 2023

Thanks, I will try. @Lbqds Do you know the amount of time I can set this timeout? Can it be one day?

@killerwhile
Copy link
Member

Yes it can be a day, or a week, in seconds, as you need.

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

3 participants