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

Attempt at transaction receipts websocket #1947

Closed

Conversation

artem-streltsov
Copy link
Contributor

@artem-streltsov artem-streltsov commented Jul 12, 2024

Attempt at #1004.

I have followed the implementation of SubscribeNewHeads from #1279.

Currently, for demonstration, I send some transaction receipt (not relevant to the given txHash) to subscribers whenever a new block is added. To test it, run:

  1. ./build/juno --ws --ws-port 6061 --ws-host 0.0.0.0 --db-path $HOME/snapshots/juno_mainnet/
  2. In a different terminal tab, run websocat -v ws://localhost:6061
  3. Send a request like {"jsonrpc": "2.0","method": "juno_subscribeTransactionReceipts","params": {"transaction_hash": "0x18e25397b012015930bd446cedb8e79b89dd848d402104657383d1df786db1b"},"id": 1}

Now, I think I need to add logic for fetching the actual transaction receipt / transaction status. Should I just poll for it every few seconds when juno_subscribeTransactionReceipts is called?

Am I heading in the right direction?

@@ -229,6 +240,7 @@ func (s *Synchronizer) verifierTask(ctx context.Context, block *core.Block, stat
}

s.newHeads.Send(block.Header)
s.newReceipts.Send(block.Receipts[0])
Copy link
Contributor Author

@artem-streltsov artem-streltsov Jul 12, 2024

Choose a reason for hiding this comment

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

Need to implement logic for sending the actual transaction receipt. Currently sending block.Receipts[0] just to make sure this works. Any ideas?

@artem-streltsov artem-streltsov changed the title Initial transaction receipts websocket Attempt at transaction receipts websocket Jul 15, 2024
@artem-streltsov artem-streltsov closed this by deleting the head repository Aug 3, 2024
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.

None yet

1 participant