Skip to main content

Implementation of the chord peer-to-peer networking protocol, introduced by Stoica et al.

Project description

ChordNet

GitHub Actions Workflow Status GitHub Actions Workflow Status

GitHub License PyPI - Types PyPI - Version PyPI - Downloads PyPI - Python Version PyPI - Implementation

Python implementation of the chord protocol, introduced by Stoica et al. This library began as a group project for cs536 at Purdue University in Fall 2024.

Installation

pip install chordnet

uv add chordnet

Usage

To stay consistent with the language from the original paper, we recommend naming your chordnet attribute ring:

from chordnet import ChordNet

ring = new ChordNet(...)
ring.create() # or ring.join(...)
#...application logic...
ring.leave()
# end program

This fits with the concept of "joining" an existing ring network, or creating a new one. Examples follow this practice.

At present, this package only supports IP lookup. All application-dependent logic (state transfer, etc) must be handled by the application. The easiest way to do this is to initialize ChordNet as an attribute on an application class:

class App:
    def __init__(self, ip: str, chordnet_port: int) -> None:
        self._ring = ChordNet(ip, chordnet_port)

    def start(
        self, ip = None: str | None, port = None: int | None
    ) -> None:
        if ip and port:
            self._ring.join(ip, port)
        elif not ip and not port:
            self._ring.create()
        else:
            print("need both or neither")
            return
    def stop(self) -> None:
        self._ring.leave()

In future versions, we hope to support in-package state transfer.

Project details


Download files

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

Source Distribution

chordnet-2.2.1.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

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

chordnet-2.2.1-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file chordnet-2.2.1.tar.gz.

File metadata

  • Download URL: chordnet-2.2.1.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for chordnet-2.2.1.tar.gz
Algorithm Hash digest
SHA256 b88743f9066794df362466c09a21f900d895bd63fee7705f3dfdef2937120931
MD5 7a825ebf6016fdf5ed2ba788f3215962
BLAKE2b-256 da14999fc265467da2835e7a3df9c7157abb9075ff406cf56dcc2b3da599e145

See more details on using hashes here.

Provenance

The following attestation bundles were made for chordnet-2.2.1.tar.gz:

Publisher: release.yml on jacklowrie/chordnet

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file chordnet-2.2.1-py3-none-any.whl.

File metadata

  • Download URL: chordnet-2.2.1-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for chordnet-2.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ddef48d0f05004e8b1344c81f0f43eefb28222eb0594734c8af2eca7bf141721
MD5 aa6291d0a07672c59638cf6975265060
BLAKE2b-256 181a61f58ced0db479d1daca31d22247d310815d90c987136a616c6696051874

See more details on using hashes here.

Provenance

The following attestation bundles were made for chordnet-2.2.1-py3-none-any.whl:

Publisher: release.yml on jacklowrie/chordnet

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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