Skip to content

Added Poller with Transaction Status #8

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

CosmoWorker
Copy link

Changes

Poller

  • Constantly Checking for pending and failure transactions and updating it with success status
  • Retrying failure transactions for the max limit of 3 and updating the database

Database

  • Used a enum for transaction status
  • Retry limit in Transactions model to avoid overhead over a single transaction

@hkirat

else {
console.log(`Retrying transaction ${txn.id} attemp no. ${txn.retryCount+1}`);
const fromKeypair=Keypair.fromSecretKey(Uint8Array.from(JSON.parse(`${process.env.PRIVATE_KEY}`)));
const toPublicKey= new PublicKey(txn.validatorId);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this 42th line of code seems invalid...txn.validatorId is Id of validator not public key ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tnx for pointing out, fixed it now 👍

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

Successfully merging this pull request may close these issues.

2 participants