Skip to main content

Creating a peer-to-peer network

Project description

nodemanager

Getting started

The aim of this project is to create a p2p network using the libp2p library in rust.

Gossip-Based Peer Sampling

MARK JELASITY, SPYROS VOULGARIS, RACHID GUERRAOUI, ANNE-MARIE KERMARREC, MAARTEN VAN STEEN. “Gossip-based peer sampling”. en. In: ACM Transactions on Computer Systems 25.3 (Aug. 2007), p. 8. issn: 0734-2071, 1557-7333. doi: 10.1145/1275517.1275520. url: https://dl.acm.org/doi/10.1145/1275517.1275520.

To run this project you need to have Rust and Python installed on your machine.

Installation

Rust

To install Rust, follow this link and choose the system you want to install it on.

Python

To install Python, follow this link.

Start the project

Once you've installed rust, you'll need to follow these steps to launch the project:

  1. Go to the project folder
cd project
  1. Create and active a python virtual environment
python -m venv .env
source .env/bin/activate
  1. Install maturin for building and publishing Rust-based Python packages with minimal configuration
pip install -r requirements.txt
  1. Build and execute the module

Example: simulation

maturin develop
python main.py --help

Expected

usage: main.py [-h] [--static_network static] [--enable_peersampling peersampling] [--node N] [--cycles M] [--multi Multithreading]

Simulation of decentralized Learning.

options:
  -h, --help            show this help message and exit
  --static_network static
                        Launch a static network. 0 for False and 1 for True.
  --enable_peersampling peersampling
                        Enables or disables peersampling. 0 for False and 1 for True.
  --node N              If you're not running a static network, it's important to specify the number of nodes in your network. This number must be greater than 5.
  --cycles M            The number of application cycles.
  --multi Multithreading
                      Used to decide whether to run the simulation on a single thread or on several threads. 0 for False and 1 for True.

Then you can lunch a simulation:

python main.py --static_network 0 --enable_peersampling 0 --node 20 --cycles 10 --multi 0

You can observe the application logs in the log.log file. This contains logs for all nodes. And you can see the config_sampling.json file in the tree, which represents the network/sampling configuration file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nodemanager-0.1.1-cp311-cp311-manylinux_2_34_x86_64.whl (5.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

File details

Details for the file nodemanager-0.1.1-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for nodemanager-0.1.1-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 c4e01f9f7379f47647399484f46d5dbc8d6b612a4a0a4f828dea974813ce94aa
MD5 f13ec265b94700f60cfa0bb9320eb992
BLAKE2b-256 60da922eb4b8cc40c2eda9255b1568e64eb05acf9e8959e00385532b9801c515

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page