No project description provided
Project description
BitBootPy: Fully-Decentralized Peer Discovery For P2P Network Formation
Inspired and based on the BitBoot (Javascript) project: https://github.com/tintfoundation/bitboot
BitBootPy
is a Python library that enables fully-decentralized P2P network Peer Discovery and network formation. No centralized infrastructure is required to start or join a P2P network which uses BitBootPy
for Peer Discovery. If you're tempted to use WebRTC for P2P network formation, you should be aware that WebRTC does require a centralized Peer Discovery server.
Key Features
-
Piggybacks on the BitTorrent network
Makes a special entry on the BitTorrent DHT (distributed hash table) to enable robust decentralized peer discovery for your network without the need for centralized servers. As long as the BitTorrent network is running, your network will be discoverble. Can be extended to leverage other DHTs if necessary. -
Self-Healing
Enables networks to easily re-form even if all nodes go offline. -
Easy-to-use
A simple API for creating and joining decentralized networks -
Async support
Supports both synchronous and asynchronous operation
How it works
When you make a network using BitBoot / BitBootPy, you make an entry on the BitTorrent DHT with a unique key identifying your network. Anyone who wants to join your network then just has to search the BitTorrent DHT for that key, and then connect to your machine using the IP data contained in the DHT entry. Done and done. You now have a P2P network that is fully robust to all nodes going offline and does not require a central server for peer discovery.
Usage
To use BitBoot, simply create an instance of the AsyncBitBoot class with a unique key, and call the announce and lookup methods to join the network and discover peers. Here's a simple example:
from bitboot.async_bitboot import AsyncBitBoot
async def main():
bot = AsyncBitBoot("unique_key")
info_hash = await bot.announce()
found_peers = await bot.lookup(info_hash)
print("Found peers:", found_peers)
bot.stop()
if __name__ == "__main__":
asyncio.run(main())
For more examples and details on how to use BitBoot, see the examples
directory.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file bitbootpy-0.3.0.tar.gz
.
File metadata
- Download URL: bitbootpy-0.3.0.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.10.5 Darwin/21.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 144976dc18828a0f09ae27b987ad17889c670e90cce637eb650e5700d917a824 |
|
MD5 | 618bde0ab1e5e21cef7646457f89291a |
|
BLAKE2b-256 | 08ff10b511436e21bcbcf1b0160b2304fe6a84ae7d4cfa482a81a1ef5632dc93 |
File details
Details for the file bitbootpy-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: bitbootpy-0.3.0-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.10.5 Darwin/21.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc74958717a763414f577b84388ffcd2c51dbe9097d8994570a8dd54f7cbe22e |
|
MD5 | 014eb0865458afd44cc3403f93b1f72e |
|
BLAKE2b-256 | 069c9a1e88cd40f2788a1b4cff3354b82133a9b87e0da72319e0e5e7c1323835 |