0

I am currently retrieving transaction information using the getTransactions method with the commitment levels 'finalized' or 'confirmed'. However, I need to access transaction information with a 'processed' commitment level. I understand that this is not possible with the getTransactions method. Is there an alternative way to achieve this?

The reason for this requirement is that when I subscribe to logsSubscribe via WebSocket with a 'processed' commitment, I receive the transaction ID. But when I query this transaction ID using getTransactions, I often get the following response:

{
  "jsonrpc": "2.0",
  "error": {
    "code": -32602,
    "message": "Method does not support commitment below 'confirmed'"
  },
  "id": 1
}

This is presumably because the transaction status is not yet confirmed or finalized.

Any guidance or alternative solutions would be greatly appreciated.

Thank you.

1
  • Did you find a way how to do this?
    – Ajar
    Commented Feb 8 at 15:55

2 Answers 2

2

Take a look at Yellowstone Geyser gRPC,- it can get a tx feed with a "processed" level. They have very good examples in Rust, Go, TS, and Python. https://github.com/rpcpool/yellowstone-grpc/tree/master/examples

The only problem here is that public nodes don't offer Geyser endpoints. That makes sense if you're running your own RPC or using dedicated or shared providers like Triton (which is the author of the thing).

6
  • Someone flagged this as low quality. Can you add demo code for this? Thanks!
    – mikemaccana
    Commented Jul 15 at 13:46
  • 1
    I've added a link to the repo if someone has issues with googling :) that's a bit disrespectful to flag my attempt to help honestly, I just shared my experience by giving free advice on saving 1-2s, take it or leave it! Commented Jul 17 at 11:01
  • thanks for the update! Understood, you're new here, we should appreciate your contribution, and I think the flagger's concerns would have been better handled by asking for more content. Thanks for responding quickly!
    – mikemaccana
    Commented Jul 17 at 13:23
  • No worries! Many thanks for your hard work moderating this community and caring about the quality! Have found very helpful insights here. If someone has any questions about Geyser, feel free to ask me Commented Jul 17 at 19:44
  • 1
    hey @slaesh, thanks! Don’t hesitate to share your q here, and I'll try to help you with it Commented yesterday
0

What’s the use case for getting a transaction which the results might be reverted or changed.

Are you building an application that can’t wait for another 5 to 10 seconds to confirm the transaction status and results?

I’ll start from trying subscribe to block updates using web socket.

And filter out the transactions that you care about.

Or another way will be deploying your own validator with modified core, can lets you query unconfirmed transactions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.