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

Produce GEFX graph for each run #135

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Produce GEFX graph for each run #135

wants to merge 2 commits into from

Conversation

lalexgap
Copy link
Contributor

@lalexgap lalexgap commented Oct 18, 2022

Fixes #104

This outputs a xml file containing a GEFX graph representing the state channel network.

GEFX is just a xml format for describing a graph by specifying nodes and edges. It also contains temporal information (ie an edge exists between two nodes for some amount of time) which lets us "animate" our state channel network over time.

In the graph this PR generates we describe clients as nodes and channels as edges. We record information about when a channel is started and stopped and include that information in the graph.

The file can be loaded into a tool like gephi to display and animate the graph. It lets you colour nodes and edges based on their attributes (ie: an edge being a "virtual" or "ledger" channel).

Unfortunately the GEPHI tool doesn't handle multiple edges nicely (it just draws them over each other, so only the top most edge is visible). This makes the diagram and animations a lot less impressive 😢

It's relatively easy to produce the graph and it doesn't hurt to include it in the artifacts we output. However it does add a bit more code to the repo, so I'm on the fence if we want this merged in.

I'll leave it up to the reviewer to decide 🙂

image

@lalexgap lalexgap changed the base branch from main to multi-hop October 18, 2022 17:32
Base automatically changed from multi-hop to main October 20, 2022 17:36
@lalexgap lalexgap marked this pull request as ready for review November 8, 2022 18:04
@lalexgap lalexgap requested review from geoknee and kerzhner November 8, 2022 18:05
@lalexgap lalexgap changed the title WIP: Produce GEFX graph for each run Produce GEFX graph for each run Nov 8, 2022
@geoknee
Copy link
Contributor

geoknee commented Nov 9, 2022

I would lean towards including this code as it is fairly lightweight and easy to remove later if we want to.

I haven't yet reviewed the code in detail (TODO)

I do have several questions at this point:

  1. Do you have an example output gexf file which I can try with gephi?
  2. Can we play some tricks to get around the multiple edge viz problems -- for example, make the thickness of the line scale with the number of virtual channels?
  3. Can we get the graph into grafana somehow? At the very least, I imagine we could take a static snapshot of the ledger channel connectivity, and maybe extract an svg file and show that in grafana? That might be a nice way to see what's going on.

@lalexgap
Copy link
Contributor Author

lalexgap commented Nov 10, 2022

I would lean towards including this code as it is fairly lightweight and easy to remove later if we want to.

I haven't yet reviewed the code in detail (TODO)

I do have several questions at this point:

  1. Do you have an example output gexf file which I can try with gephi?

Here's one from this run:
graph-cdml258nr2gjkljjjqdg.gexf.zip

  1. Can we play some tricks to get around the multiple edge viz problems -- for example, make the thickness of the line scale with the number of virtual channels?

We might be able to do something like that! I think edges can also have weights, which we could set to the number of virtual channels. I think this would allow the graph to auto arrange based on the busy parts of the network.

  1. Can we get the graph into grafana somehow? At the very least, I imagine we could take a static snapshot of the ledger channel connectivity, and maybe extract an svg file and show that in grafana? That might be a nice way to see what's going on.

Instead of trying to post an svg to grafana we could use this gephi JS library. It's a javascript library that provides a viewer for GEXF graph files. It displays the graph and also allows it to be interacted with. Here's an example. I think it provides a complete website to deploy to render your specific graph so it would be easy to spin up renders of different runs.

c.gr.ObjectiveStatusUpdated(ObjectiveStatusInfo{
Id: id,
Time: time.Now(),
Participants: []common.Address{},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use empty participants list here?

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.

Investigate visualization/animation of Testground Run
2 participants