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

Tracking issue: libp2p introspection support (proof-of-concept) #947

Closed
15 of 17 tasks
raulk opened this issue May 20, 2020 · 2 comments
Closed
15 of 17 tasks

Tracking issue: libp2p introspection support (proof-of-concept) #947

raulk opened this issue May 20, 2020 · 2 comments

Comments

@raulk
Copy link
Member

raulk commented May 20, 2020

This umbrella issue enumerates all the pull requests and linked issues that make up the initial introspection proof-of-concept for go-libp2p.

The project is affectionately codenamed Phantom Drift 👻🌊, and we'll be open sourcing the UI and widget library soon. A sneak peek:

image

Scope

The initial proof-of-concept comprises these components and concepts on the libp2p backend side of the fence:

  • an Protobuf introspection schema that libp2p implementations adhere to to offer introspection ability.
  • a WebSockets-based introspection protocol that uses the schema and offers a set of RPCs and streaming operations to fetch the current state of the stack and the events circulating through the eventbus.
  • an introspectable Host: a Host that renders itself to introspection by offering an introspection endpoint that speak the above protocol.
  • an introspector component that does the heavy-lifting of sourcing data from the inner libp2p modules (e.g. swarm, DHT, etc.) to expose over the introspection endpoint.
  • REPL support for quick testing.

On the frontend/application/UI side of things:

  • the libp2p observer shell: a web application onto which you can load libp2p observation widgets, load file dumps of introspection data, or connect to a live libp2p instance to visualise real-time, or travel back and forth in time to view the state of the host at that point. https://github.com/libp2p/observation-deck
  • the widget toolkit: a JS library to develop observation widgets against the libp2p introspection protocol. https://github.com/libp2p/observer-toolkit
  • various widgets to playing with out of the box.

go-libp2p work tracker

For reference, here's the initial issue where this work was initially introduced: #775

@raulk
Copy link
Member Author

raulk commented May 20, 2020

After reviewing the solution end-to-end, I'm proposing that we make a few architectural changes.

  • I don't like the fact that modules (e.g. swarm) are responsible for populating the introspection schema. I think they should just return go-libp2p-core objects, and the introspector should translate to the introspection schema.

  • That model also creates symmetry -- the data you can obtain from introspection is the same data that's in the libp2p core model. Otherwise, we can get into a paradoxical situation where an outside observer (introspection UI) would be capable of obtaining more information about the system than an internal observer (via the core API).

  • I'm going to rejigger the data provider system / introspector accordingly.

  • I might also move the introspector into go-libp2p -- to align with our pursuit of codebase simplification. The introspector is one of those "replaceable, not modular" components. 99% of users will use the default introspector; the other 1% can implement the interface and inject the custom implementation via the constructor option.

@marten-seemann
Copy link
Contributor

Closing this. See #775 (comment) for motivation.

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

No branches or pull requests

2 participants