{"id":27185061,"url":"https://github.com/threefoldtech/libp2p-relay","last_synced_at":"2025-04-09T17:10:22.035Z","repository":{"id":63658941,"uuid":"385937111","full_name":"threefoldtech/libp2p-relay","owner":"threefoldtech","description":"Libp2p relay ","archived":false,"fork":false,"pushed_at":"2024-01-21T16:50:45.000Z","size":436,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":13,"default_branch":"development","last_synced_at":"2024-01-21T17:46:35.432Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/threefoldtech.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}},"created_at":"2021-07-14T12:45:19.000Z","updated_at":"2023-07-15T00:27:17.000Z","dependencies_parsed_at":"2023-10-12T13:06:54.380Z","dependency_job_id":null,"html_url":"https://github.com/threefoldtech/libp2p-relay","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threefoldtech%2Flibp2p-relay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threefoldtech%2Flibp2p-relay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threefoldtech%2Flibp2p-relay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threefoldtech%2Flibp2p-relay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/threefoldtech","download_url":"https://codeload.github.com/threefoldtech/libp2p-relay/tar.gz/refs/heads/development","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248074976,"owners_count":21043490,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2025-04-09T17:10:21.385Z","updated_at":"2025-04-09T17:10:22.029Z","avatar_url":"https://github.com/threefoldtech.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# libp2p-relay\n\nSome projects of Threefold Tech or that Threefold Tech supports rely on [libp2p](https://libp2p.io) peer routing.\n\nThis project provides an implementation for relay nodes that can be used to provide reliable peer communication.\n\n## Flow\n\n```mermaid\nsequenceDiagram\n    participant Client\n    participant Relay\n    participant Daemon \n    Daemon --\u003e\u003e Relay: Connect(RelayAddress) \n    Client --\u003e\u003e Relay: Connect(RelayAddress)\n    Client--\u003e\u003e Client:FindPeer(DaemonID)\n    Client --\u003e\u003e +Daemon: Request\n    Daemon --\u003e\u003e -Client:Response\n```\n\n## Peer propagation\n\nThe relay also acts as a server for a DHT with peerconnections, propagating the peers and their connection informations to connected peers.\n\nIf a client can reach a daemon directly, the relay is not needed for relaying messages.\n\n## Private network\n\nSince we only care about providing reliable peer routing for our own projects we create a private libp2p network with multiple relay nodes. This way the peer routing's dht is only populated with nodes within the private network.\n\n### PSK\n\nA private network is defined by a 256-bit secret key, the pre-shared key (PSK) which has to be known and used by all members inside the network.\n\nAny 32 (pseudo)random bytes are good, this is an example of how to create a PSK in hex on the commandline:\n\n```sh\nopenssl rand -hex 32\n```\n\nOr in python:\n\n```python\nimport os,binascii\nbinascii.b2a_hex(os.urandom(32))\n```\n\n### Security\n\nApplications using the relay nodes and private network should NOT assume all traffic and connections are from trusted parties. Pre-shared private keys are known to leak and it is shared with multiple applications.\n\nA leaked PSK is not a problem either as long as the relaying functionality stays reliable. This does not mean one should hardcode it and submit it to a public github repository off course.\n\n## Release build\n\nThe `release.sh` script builds a release version for linux/amd64 in a `dist` folder.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthreefoldtech%2Flibp2p-relay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthreefoldtech%2Flibp2p-relay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthreefoldtech%2Flibp2p-relay/lists"}