Skip to content
This repository was archived by the owner on Mar 23, 2021. It is now read-only.
This repository was archived by the owner on Mar 23, 2021. It is now read-only.

Migrate network layer to libp2p #800

@thomaseizinger

Description

@thomaseizinger

Based on the outcome of #779, the network layer of COMIT should be replaced with libp2p.

Since libp2p is a modular network stack, I'd propose the following configuration to begin with:

  • Only TCP transport
  • Discovery through WebRTC-star (or should be go with mDNS for now since we are always on the same network?)
  • no encryption

This should allow us to run our tests again.

The following things will need to be done (not necessarily in this order):

  • Throw away comit_server and connection_pool
  • Figure out away on how to put BAM ontop of whichever abstractions libp2p exposes. This will involve registering a protocol with libp2p like /bam/1.0.0.
  • Change the http_api to accept a libp2p node id instead of an IP address
  • Figure out how to establish a connection to the given ID so that the swap request can be sent to the other guy. Not sure if libp2p will handle the discovery transparently for us or we have to do this manually before sending the request
  • Derive the keypair used for the libp2p id from the seed specified in the configuration file
  • Put COMIT on the list of notable users: https://github.com/libp2p/rust-libp2p#notable-users

Note:

  • aim for multiple PRs
  • create issues per PR
  • Pair programming

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions