Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/alifarazz/n2p

:postal_horn: P2P mesh network with focus on broadcasting.
https://github.com/alifarazz/n2p

async p2p p2p-chat p2p-mesh-network python

Last synced: 1 day ago
JSON representation

:postal_horn: P2P mesh network with focus on broadcasting.

Awesome Lists containing this project

README

        

# N2P


logo

[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)

A basic P2P mesh network implemented in multi-threaded asynchronous python.

Each peer can broadcast a message. The message is received by other peers which have subscribed to it. Subscribing peers will also broadcast the message but retain the originals broadcaster's info. The peers will automatically detect and control message floods.

Also, peers can query other peers for a search. The first match will be returned to the peer which initiated the query. Other subsequent answers will be discarded.

## Running the Project

- You will need at least python 3.7 with async support.
- Setup a virtual-env and install the packages in `requirements.txt` using pip.
- `virtualenv --python=python `
- `. /bin/activate.sh`
- `pip install -r requirements.txt`
- Go to `peer/` and run the script to bring up a peer.
- `python peer.py : :`
- The first argument is the address listening server's socket to let other peers connect.
- The second argument is the address controlling server's socket to let users control the peer.
- Connect to the controlling server using a TCP client. You can use `netcat` command. Or `telnet`.
- `nc `
- List of all commands and their responses is listed in `api/`.

## Contribution
1. Fork the project.
2. Create a new branch with an appropriate name.
3. Commit the changes, Please use meaningful commit messages.([guide](https://github.com/RomuloOliveira/commit-messages-guide))
4. Submit a pull/merge request to this repo's master branch.