[c-lightning] Pubsub API?

Rusty Russell rusty at rustcorp.com.au
Fri Aug 10 11:15:47 AEST 2018


William Casarin <jb55 at jb55.com> writes:
> Hey c-lightning devs,
>
> I want to a build an opengl visualization client. My requirements are:
>
>   - access to channel events (updates, announcements, etc) I want to
>     visualize updates as glowing edges between nodes, announcements for
>     rendering new nodes, etc.
>
> Perhaps a realtime pubsub api might be appropriate? Any suggestions on
> what type of transport format/api we could use for this? Otherwise I was
> going to use the wire format that we current use between our daemons,
> but that seems a bit invasive.

We could certainly do it, though pub/sub is bit outside the realm of
normal JSON RPC API.  Weirdly, if you google, you get an Ethereum page
claiming "support for pub/sub using subscriptions as defined in the
JSON-RPC 2.0 specification." but that's kind of a stretch IMHO.

My first reaction was to just connect to c-lightning like any other
peer, but that means you don't get notified of channel closes.  There's
been talk of a future extension that would gossip those, however.

So I wrote a hacky 'gossipfrom' tool which seems to work: it will output
all the gossip messages you receive, so you'll need to parse them, but
OTOH it should work with almost any implementation (well, it doesn't
respond to pings, so Eclair might get upset!).

https://github.com/rustyrussell/lightning/tree/gossiptool

Feedback welcome...

Thanks,
Rusty.


More information about the c-lightning mailing list