Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/alifarazz/n2p
- Owner: alifarazz
- License: agpl-3.0
- Created: 2020-01-30T21:08:25.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-07-05T21:40:13.000Z (over 2 years ago)
- Last Synced: 2023-03-09T00:08:13.228Z (over 1 year ago)
- Topics: async, p2p, p2p-chat, p2p-mesh-network, python
- Language: Python
- Homepage:
- Size: 137 KB
- Stars: 8
- Watchers: 4
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# N2P
[![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.