{"id":25053605,"url":"https://github.com/dills122/p2p-test","last_synced_at":"2026-04-27T22:33:16.253Z","repository":{"id":44896818,"uuid":"429634382","full_name":"dills122/p2p-test","owner":"dills122","description":"WIP, test P2P network for messaging other nodes in the network with interactive shell","archived":false,"fork":false,"pushed_at":"2026-03-21T02:53:50.000Z","size":5982,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-21T17:57:05.751Z","etag":null,"topics":["go","golang","grpc","p2p-network"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dills122.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":"2021-11-19T01:37:30.000Z","updated_at":"2025-11-08T04:19:58.000Z","dependencies_parsed_at":"2025-02-06T11:40:04.258Z","dependency_job_id":"b2a01531-003b-461e-84cb-18c826af6e3b","html_url":"https://github.com/dills122/p2p-test","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dills122/p2p-test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dills122%2Fp2p-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dills122%2Fp2p-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dills122%2Fp2p-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dills122%2Fp2p-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dills122","download_url":"https://codeload.github.com/dills122/p2p-test/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dills122%2Fp2p-test/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32358509,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["go","golang","grpc","p2p-network"],"created_at":"2025-02-06T11:39:58.557Z","updated_at":"2026-04-27T22:33:16.247Z","avatar_url":"https://github.com/dills122.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Test P2P Network\n\nSmall playground for experimenting with peer-to-peer style messaging using Go,\ngRPC, and a simple CLI.\n\n![Example with 3 nodes](./assets/3-node-example.gif)\n\n## Requirements\n\n- Go 1.17+\n- `protoc` with the Go gRPC plugin (only needed if you edit `.proto` files)\n\n## Setup\n\n```bash\ngo get -u\ngo mod tidy\n```\n\nRegenerate protobufs after changing `pkg/ping/ping.proto`:\n\n```bash\nprotoc --go_out=plugins=grpc:. --go_opt=paths=source_relative pkg/ping/ping.proto\n```\n\n## CLI overview\n\n```bash\ngo run ./main.go --help\n```\n\n| Command    | Description                                               |\n| ---------- | --------------------------------------------------------- |\n| `pingTest` | Spins up two demo nodes, has them ping one another, exits |\n| `start`    | Starts a node plus interactive shell (`send`, `exit`)     |\n\n## Quick demo (ping test)\n\n```bash\ngo run ./main.go pingTest\n```\n\nThis launches nodes on `127.0.0.1:10000` and `127.0.0.1:10001`, waits briefly,\nthen has each node ping the other.\n\n## Interactive shell\n\nStart a node with sane defaults:\n\n```bash\ngo run ./main.go start\n```\n\nUseful flags:\n\n- `--address` / `-a` – host:port to bind the local gRPC server (must exist on your box)\n- `--listener-addresses` / `-l` – known peers in `host:port` form (repeatable flag)\n- `--name` / `-n` – friendly node name (defaults to a UUID)\n- `--log-file` – where to write node logs (default `logs/\u003caddress\u003e.log`)\n- `--verbose` – also stream logs to the interactive console\n\nEvery ping reply carries the sender's peer list, so after a node successfully\nreaches any peer it will automatically learn about the rest of the network. The\n`--listener-addresses` flag is only needed to provide the initial bootstrap(s).\n\n### Two-node local test\n\nTerminal 1:\n\n```bash\ngo run ./main.go start \\\n  --address 127.0.0.1:10000 \\\n  --listener-addresses 127.0.0.1:10001\n```\n\nTerminal 2:\n\n```bash\ngo run ./main.go start \\\n  --address 127.0.0.1:10001 \\\n  --listener-addresses 127.0.0.1:10000\n```\n\nNow type `send hello` in Terminal 2. Both terminals print live `→` / `←`\nnotifications showing who sent or received the payload, so you can watch the\nmessage propagate even without verbose logging enabled. Either shell accepts:\n\n- `send \u003cmessage\u003e` – ping every known peer with the provided payload\n- `add-peer \u003chost:port\u003e` – add new peers while the node keeps running\n- `peers` – list known peers plus their last-seen timestamp\n- `exit` – stop the gRPC server and quit the shell\n\nIf you supply an address you do not own (for example `172.0.0.1`), the OS will\nreturn `bind: can't assign requested address`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdills122%2Fp2p-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdills122%2Fp2p-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdills122%2Fp2p-test/lists"}