Restructuring py-libp2p to be more modular and developer-friendly
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 624
- Forks
- 256
- Avg merge
- 1d 34m
- Merged PRs (30d)
- 47
Description
I'm proposing a plan of refactoring large parts of the current py-libp2p library to be more modular and developer-friendly through 3 ways:
- Restructure the network/application side to revolve around 3 basic concepts: Transport, Connection, and Protocol.
- Split functionality into "interfaces" (abstract classes with abstract methods), so cross-library compatibility can work without the two libraries knowing about eachother. (For example, a Protocol could verify that it's working on a secure connection (where one of the parent protocols is providing connections through SecIO, or similar) by simply testing if one of it's parents is a
ISecureConnection, which denotes methods to grab the node's verified identity). - Split interface from implementation, so that every part of the library that's an implementation (
TCPprotocol,Multiplexerprotocol,SecIOprotocol, etc.) implements their interface in a one-way awareness solution (implementation is aware of interface, interface is not aware of implementation)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files, tests, or entry points are named. Start by mapping the current network and application structure, then review how Transport, Connection, and Protocol concepts could be separated into interfaces and implementations. Done means the proposed modular architecture is defined and its compatibility boundaries are agreed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, distributed-systems, networking
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100