Attempt at transaction receipts websocket #1947
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
./build/juno --ws --ws-port 6061 --ws-host 0.0.0.0 --db-path $HOME/snapshots/juno_mainnet/
websocat -v ws://localhost:6061
{"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?