ethberlinzwei / Bounties

Get rewards for your contributions
10 stars 10 forks source link

[BOUNTY] Community Improvement Bounties - libp2p - gossipsub visualizations: fork and adapt meshsim #26

Open raulk opened 5 years ago

raulk commented 5 years ago

gossipsub visualizations: fork and adapt meshsim

Life would be fantastic if we could visualize the behaviour of gossip meshes. Fork the fantastic matrix-org/meshsim visualizer, developed by our friends at Matrix.org, make it run and visualise gossipsub nodes, and run home with 2000 EUR extra in your pocket 🤑

This is what meshsim is capable of doing now. Your goal is to replace the backend with gossipsub nodes!

image (copied from matrix-org/meshsim)

How to qualify

Get familiarised with matrix-org/meshsim. It's very well written and structured, so that should be straightforward. You will need to fork it and modify it as described next.

The goal is to reuse the same frontend and network QoS configuration logic as meshsim, but adapting the backend to launch libp2p daemons instead of matrix servers.

Since meshsim relies on docker containers, you will first need to create a Dockerfile for https://github.com/libp2p/go-libp2p-daemon/. This should be pretty straightforward.

With every click on the canvas, a container of this image should be launched and connected to the network using the same topology heuristic that's in effect now.

In order to make the message flow viz work, you'll probably need to fork https://github.com/libp2p/go-libp2p-pubsub to add log statements, that can then be picked up by the visualizer to feed the animations.

In theory we could instrument any gossipsub implementation (there are JS and Rust ones), but go is our top priority since it serves as the reference implementation.

Dragging and dropping on the canvas and everything else should work as it currently does.

Following the spirit of the current repo, you should create scripts to make it easy to send messages of different sizes and content to the mesh.

Resources

Check out:

Feel free to use @raulk as a walking encyclopedia for all things libp2p.

Judging Criteria

  1. It actually works, and you can demo it.
  2. Completeness, correctness, cleanliness and maintainability of code.
  3. Pull requests upstream with new features or improvements you may add along the way \o/ Contribute back to the original authors!

Prizes

  1. 750 EUR via Protocol Labs.
  2. 750 EUR via the Ethereum Foundation.
  3. 500 EUR via Community Improvement Bounties fund.
ara4n commented 5 years ago

I can answer questions (modulo time constraints) on how meshsim works :)

protolambda commented 5 years ago

That's fun, I have been thinking of implementing something like this long term. But planned to focus on chain activity (forks, slashigns, deposits) visualization in network-graph form first (have a WIP implementation). Anyway, definitely down to talk at ethberlin, and maybe help out whoever likes to pick this up. Maybe @chainsafe @gregthegreek and/or @whiteblock @zscole

djrtwo commented 5 years ago

The Ethereum Foundation is chipping in 750 EUR for this bounty!

raulk commented 5 years ago

@protolambda have you checked out the Filecoin network visualizer? Demo: https://youtu.be/clzivvkpKpc We (PL) might be able to help.

protolambda commented 5 years ago

@raulk No, but thanks for sharing. I like the one shown in this issue better however, as a higher node count and a complicated network topography don't fit the filecoin visualization approach so well.

And then there are also the contents of the graph to consider: one could just render the gossibsub things, or annotate it with message types, committtees, etc. (if we use it for Eth 2)

valer-cara commented 5 years ago

I'd like to take a shot at this :wave:

raulk commented 5 years ago

Fantastic, @valer-cara! Come find me at the libp2p/ipfs helpdesk on level one. I’ll be able to help.

bowd commented 5 years ago

we did it!

https://devpost.com/software/libp2p-gossip-pubsub-visualisation

ara4n commented 5 years ago

wow, congrats! i should apologise that the original meshsim code was written in a bit of a rush and is certainly not our best work (i deeply regret the webapp being a tangle of procedural JS rather than React) - but based on the devpost writeup it sounds like you made massive improvements. We’d love to get the code merged (and use this for our own libp2p experiments!)

bowd commented 5 years ago

@ara4n Yeah I didn't open a PR yet because we didn't have time to update the documentation but we're gonna do that in the following days, other than that it should be more-or-less margeable, we can talk through some particulars when the PR is open. You can check the code at https://github.com/valer-cara/meshsim/ for now.

If this is actually useful I have a ton of improvement ideas.

raulk commented 5 years ago

@bowd thanks for the submission. This is fantastic. Would be great if you updated the README.md with concrete instructions to run gossipsub nodes from scratch, including building the docker images. Ping me if you're still around so we can go through a demo together.

bowd commented 5 years ago

@raulk we're still around, at a table close to the inner courtyard (with the icecream van), do you wanna meet here?

raulk commented 5 years ago

@bowd already syncing with @valer-cara over Telegram.