Skip to content

expanded rpc api to add MempoolSizeChanged #663

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 1 commit into
base: master
Choose a base branch
from

Conversation

x100111010
Copy link

Confirmed working with the below wrpc example subscriber:
https://github.com/kaspanet/rusty-kaspa/blob/master/rpc/wrpc/examples/subscriber/src/main.rs

self.client().rpc_api().start_notify(listener_id, Scope::MempoolSizeChanged(MempoolSizeChangedScope {})).await?;

Creating listener with options: url=Some("ws://localhost:17210"), network=testnet-10, encoding=Borsh, timeout=5000ms
Received connection event
Connected to Some("ws://localhost:17210")
Node version: 0.17.2
Network: testnet-10
Virtual DAA Score: 106173779
Node is indexing UTXOs: true
Node is synced: synced
Notification: MempoolSizeChanged(MempoolSizeChangedNotification { network_mempool_size: 535 })
Notification: MempoolSizeChanged(MempoolSizeChangedNotification { network_mempool_size: 586 })
Notification: MempoolSizeChanged(MempoolSizeChangedNotification { network_mempool_size: 543 })
Notification: MempoolSizeChanged(MempoolSizeChangedNotification { network_mempool_size: 631 })
Notification: MempoolSizeChanged(MempoolSizeChangedNotification { network_mempool_size: 568 })
Notification: MempoolSizeChanged(MempoolSizeChangedNotification { network_mempool_size: 756 })

Currently in the kaspa socket server we periodically update mempool size using getInfoRequest. With the rusty-socket-server we can now use wRPC notifications to get mempool size updates directly and efficiently, replacing the full GetInfoResponseMessage with a more lightweight, real-time mempool size notification.

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.

1 participant