{"id":39403149,"url":"https://github.com/firstbatchxyz/dnet-p2p","last_synced_at":"2026-01-18T03:26:57.128Z","repository":{"id":328227323,"uuid":"946475721","full_name":"firstbatchxyz/dnet-p2p","owner":"firstbatchxyz","description":"A shared library for local peer discovery, in Rust.","archived":false,"fork":false,"pushed_at":"2025-12-11T20:36:21.000Z","size":7869,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-13T00:13:02.018Z","etag":null,"topics":["mdns","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/firstbatchxyz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-11T07:44:14.000Z","updated_at":"2025-12-11T20:36:26.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/firstbatchxyz/dnet-p2p","commit_stats":null,"previous_names":["firstbatchxyz/dnet-p2p"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/firstbatchxyz/dnet-p2p","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstbatchxyz%2Fdnet-p2p","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstbatchxyz%2Fdnet-p2p/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstbatchxyz%2Fdnet-p2p/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstbatchxyz%2Fdnet-p2p/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/firstbatchxyz","download_url":"https://codeload.github.com/firstbatchxyz/dnet-p2p/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/firstbatchxyz%2Fdnet-p2p/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28528038,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mdns","rust"],"created_at":"2026-01-18T03:26:51.235Z","updated_at":"2026-01-18T03:26:57.109Z","avatar_url":"https://github.com/firstbatchxyz.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dnet p2p\n\ndnet p2p is a shared library that adds LAN peer-to-peer discovery. It exposes two modes (inspired from MPI terms):\n\n- **Manager**: the manager of the local network, is able to dispatch tasks to all other. There can only be one manager.\n- **Worker**: every non-manager is expected to be a worker, connected via the LAN to serve their compute power to the manager.\n\n## Installation\n\nInstall from the source via:\n\n```sh\ncargo install --git https://github.com/firstbatchxyz/dnet-p2p\n```\n\n## Usage\n\n### Cargo from Source\n\nYou can run DnetP2P as follows:\n\n```sh\n# worker\ncargo run\n\n# manager\ncargo run -m\n\n# passive, just monitors others\ncargo run -p\n```\n\nNote that there can only be one manager at a time.\n\n### FFI from C/C++\n\nInclude the shared library within your loader step, e.g. `-L some/directory -ldnet_p2p`. Then, include [`dnet_p2p.h`](./bindings/c/src/dnet_p2p.h) in your code.\n\n- You can create a new service object with `dnet_p2p_new` which returns you an object pointer, and free it later with `dnet_p2p_free`.\n- You can start the service with `dnet_p2p_start` which returns you a thread handle pointer, and then stop it with `dnet_p2p_stop`.\n\nSee the [header file](./bindings/c/src/dnet_p2p.h) for more specific instructions.\n\n### FFI from Python\n\nA utility class is provided within [`dnet_p2p.py`](./bindings/py/src/dnet_p2p.py) that wraps the function calls for the shared library using `ctypes`. It provides both context usage (i.e. `with`) and normal usage.\n\nSee the example usage at [`main.py`](./bindings/py/main.py) that you can run with:\n\n```sh\n# worker\nRUST_LOG=info uv run main.py\n\n# manager\nRUST_LOG=info uv run main.py -m\n```\n\n## Testing\n\nRun tests with:\n\n```sh\ncargo test\n```\n\n### License\n\nSee [license file](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirstbatchxyz%2Fdnet-p2p","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffirstbatchxyz%2Fdnet-p2p","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirstbatchxyz%2Fdnet-p2p/lists"}