-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
lnrpc: Add subscribe peer events rpc #3397
lnrpc: Add subscribe peer events rpc #3397
Conversation
897e1e0
to
a7652dd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM! Question more becomes whether this RPC is useful to expose
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. As far as the RPC, are there any plans to extend it with other notification types that could make it more useful to expose?
I think that it's useful in the context of people building their own channel closing logic? If we're going to expose the final channel insights metrics (rather than time series), be it an all time value of with start/end params, I think that it makes sense to expose the individual elements over RPC so that people can easily build from scratch if they want to. |
a7652dd
to
b30250e
Compare
None at present, but I can look into it if online/offline aren't enough to justify adding a new endpoint? |
Also useful for wallets that want to show the number of connected peers without having to poll listpeers I think :) |
This one has been sitting around for a while now. Should I rebase for merge or close because we don't want to add this rpc endpoint? |
I think it is still useful, but we can let it sit around a bit longer until someone has a specific use case for it in mind. |
Ok cool 😀 didn’t want to leave it hanging around without following up. |
I have a usecase :) In my Wallet, I display a list of currently connected peers. Wherever possible, I use subscriptions to make the app feel more responsive and dynamic. Subscribing to this means I don't have to implement pull to refresh and save some bytes of data transfered. https://github.com/fusion44/sendmany/blob/master/docs/screenshots/screenshot_3.png |
b30250e
to
64388fa
Compare
Awesome! Rebased on master just in case we want to merge this :D |
Needs another rebase! 😅 |
64388fa
to
3c28507
Compare
rerebased 😂 going to add it to the 0.9 milestone so it gets some attention |
This PR adds a subscribe peer events rpc stream, following on from #3354. The motivation for adding this stream would be to provide information for people who want to write their own autopilot logic external to LND.
Pull Request Checklist
go fmt
and lines are wrapped at 80make check
,go vet
andmake lint
ok