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

listpeers channel list should be split into listpeerchannels, channels[] deprecated. #4729

Closed
7 tasks
rustyrussell opened this issue Aug 20, 2021 · 16 comments
Closed
7 tasks
Labels
good first issue good for onboarding json-rpc
Milestone

Comments

@rustyrussell
Copy link
Contributor

listpeers has grown: it lists not only the peers, but all the channels each of them has. This is getting very unwieldy (and unnecessarily slow, see #4718 ), and should be split into a listpeerchannels which does that.

Steps:

  • Create a listpeerchannels command next to the listpeers implementation, which returns a "channels" array.
  • Write the doc/schemas/listpeerchannels.schema.json file (copy existing ones)
  • Write some tests (steal from existing listpeers tests), put Changelog-Added: JSON-RPC: listpeerchannels new command.
  • If deprecated_apis is false, don't include "channels" in listpeers.
  • Update listpeers documentation to refer to listpeerchannels and remove channels[] from doc/schemas/listpeers.schema.json
  • Make sure to put a Changelog-Deprecated: in the commit msg for the commit which removes from listpeers.
  • Celebrate!
@rustyrussell rustyrussell added this to the v0.10.2 milestone Aug 20, 2021
@kandycoder
Copy link

I'd like to take this issue.

@vincenzopalazzo
Copy link
Contributor

@rl-d I think just open a PR, maybe it is also easy to include the following issue inside this RPC refactoring #4734

@kandycoder
Copy link

Status update: code and doc changes are in my fork and have been tested manually, but I'm having trouble getting "make check" to work in order to begin work on the tests...it's failing on what seems to be an unrelated test. [newbie]Is there a developer Telegram group or somewhere I can chat with somebody about it?[/newbie]

@vincenzopalazzo
Copy link
Contributor

@rl-d Telegram https://t.me/lightningd and you can use also a libera IRC channel with the name #c-lightning.

@kandycoder
Copy link

Thanks @vincenzopalazzo. Let's leave issue #4734 separate from this (per discussion in Telegram about making a plugin for listing closed channels).

@vincenzopalazzo
Copy link
Contributor

Mh @rl-d, wandering to give the possibility to a plugin to access from the lightning db, I think it is not safe

@rustyrussell
Copy link
Contributor Author

Could incorporate #4734 too...

@vincenzopalazzo
Copy link
Contributor

If someone is working on this issue, please react in some way 😄 (@rl-d) otherwise I can put in my queue this task and @rustyrussell can assign to me this issue to try to have this feature in the next release.

@kandycoder
Copy link

kandycoder commented Sep 7, 2021

Oops, sorry my little ❤️️ reaction on @rustyrussell's comment wasn't enough... next time I will be more verbose... see below :)

I plan to address this with the plugin mentioned in issue #4734. Today (or tomorrow for some) I will request a pull of some new common GraphQL tools I wrote for C into CCAN. Will be my first pull request (ever... LOL) so hopefully I can figure it out. If not I will ask somebody 🥰 Then my next effort will be to fabricate (or duplicate) a plugin and integrate it there.

@kandycoder
Copy link

@vincenzopalazzo on second thought, I will write the tests for the code I already drafted before the plugin suggestion came along (as noted in my comment 14 days ago above)... then we can get this off the radar now and further improve it when the plugin is ready.

@vincenzopalazzo
Copy link
Contributor

No rush here @rl-d, my ping to you was about the idea to solve the issue suggested by @rustyrussell. I ping you because there are several ways to write plugins for c-lightning (Java, Go, C, JS, V) and didn't catch that you were developing a C plugin to put inside c-lightning (the issue is related to clightning internals).

happy to see how the plugin can solve these issue 😄

Thanks

@kandycoder
Copy link

Thanks... Yeah, I know what you mean....that's why I posted my "second thought" above. The plugin itself (though in C) isn't going inside lightningd directly. The internals need to be tweaked in any case for this issue.

The plugin is only providing a convenient way for users to query data that is available in the database. But as such, it should obviate the need to have c-lightning itself serve data that would also be available via the plugin--that is how the plugin relates at all to this issue. Once the plugin is ready with its more convenient way to query the data relevant to a given user, then further simplification of the RPCs could be done (if desired...).

I hope that explains it better, and sorry if it sounded confusing before. 😄

@vincenzopalazzo
Copy link
Contributor

The internals need to be tweaked in any case for this issue.

So, you are working on an alternative solution, and not into this issue (the issue is about the c-lightning internal stuff), right?

If I catch this correctly maybe I can continue my work on this issue, and @rustyrussell or @cdecker can assign it to me to avoid double work.

@kandycoder
Copy link

The work is already done... I would appreciate if you would just take a look at my fork to see what changes I made for this issue, and let me know if you think it is done correctly or if you have any other suggestions.

@kandycoder
Copy link

See PR #4770

@rustyrussell
Copy link
Contributor Author

OK, this has been closed by the emrge of #5825

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue good for onboarding json-rpc
Projects
None yet
5 participants