{"id":15756945,"url":"https://github.com/treethought/p2p_exec","last_synced_at":"2025-03-31T08:26:11.016Z","repository":{"id":53208815,"uuid":"521323864","full_name":"treethought/p2p_exec","owner":"treethought","description":null,"archived":false,"fork":false,"pushed_at":"2022-08-04T15:42:53.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-06T12:48:20.154Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/treethought.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-04T15:42:41.000Z","updated_at":"2022-08-04T15:42:56.000Z","dependencies_parsed_at":"2022-09-15T03:51:10.612Z","dependency_job_id":null,"html_url":"https://github.com/treethought/p2p_exec","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treethought%2Fp2p_exec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treethought%2Fp2p_exec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treethought%2Fp2p_exec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treethought%2Fp2p_exec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/treethought","download_url":"https://codeload.github.com/treethought/p2p_exec/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246438492,"owners_count":20777431,"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":"2024-10-04T09:03:25.845Z","updated_at":"2025-03-31T08:26:10.996Z","avatar_url":"https://github.com/treethought.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# p2p-exec\n\nSimple peer-to-peer execution of basic math operations. Built on [libp2p](https://libp2p.io/).\n\n## Usage\n\n1. Open two terminals\n2. run `cargo run` in each to start a node\n\nEach node should output something like the following, indicating the peers discovered each other.\n\n```\n\nLocal peer id: PeerId(\"12D3KooWA7LShSoWyTEKW6qZtLCrxeqzqP3mNfFwaaaW4uJ2gLft\")\nlistener id: ListenerId(1)\nListening on \"/ip4/127.0.0.1/tcp/45397\"\nListening on \"/ip4/192.168.2.131/tcp/45397\"\nListening on \"/ip4/172.20.0.1/tcp/45397\"\nListening on \"/ip4/172.17.0.1/tcp/45397\"\nListening on \"/ip4/172.18.0.1/tcp/45397\"\ndiscovered peer: PeerId(\"12D3KooWRvvA82V3BJrMttRyzcp4dYcv6SqMZdo64peghCh1DnuT\")\ndiscovered peer: PeerId(\"12D3KooWRvvA82V3BJrMttRyzcp4dYcv6SqMZdo64peghCh1DnuT\")\ndiscovered peer: PeerId(\"12D3KooWRvvA82V3BJrMttRyzcp4dYcv6SqMZdo64peghCh1DnuT\")\ndiscovered peer: PeerId(\"12D3KooWRvvA82V3BJrMttRyzcp4dYcv6SqMZdo64peghCh1DnuT\")\ndiscovered peer: PeerId(\"12D3KooWRvvA82V3BJrMttRyzcp4dYcv6SqMZdo64peghCh1DnuT\")\ndiscovered peer: PeerId(\"12D3KooWH2ozJPojBR26uAeXXB8rHRsEXX6Lj8aB2sva2ksJKHn7\")\ndiscovered peer: PeerId(\"12D3KooWH2ozJPojBR26uAeXXB8rHRsEXX6Lj8aB2sva2ksJKHn7\")\ndiscovered peer: PeerId(\"12D3KooWH2ozJPojBR26uAeXXB8rHRsEXX6Lj8aB2sva2ksJKHn7\")\ndiscovered peer: PeerId(\"12D3KooWH2ozJPojBR26uAeXXB8rHRsEXX6Lj8aB2sva2ksJKHn7\")\ndiscovered peer: PeerId(\"12D3KooWH2ozJPojBR26uAeXXB8rHRsEXX6Lj8aB2sva2ksJKHn7\")\n```\n\nIn either terminal, enter a basic math operation such as:\n\n```\nadd 5 6\nsub 623 23\nmult 42 313\ndiv 100 20\n```\n\nAfter hitting enter, you should see the operation be executed by the second terminal:\n\n```\nRequest(ExecRequest { function: Add, args: (27, 12093) }) from PeerId(\"12D3KooWAuyzhL2ei6AuEuedLcVeMcEkbCdknEstHVvHtPEB98UR\")\n```\n\nAnd the result be returned to sending peer in the first terminal\n\n```\nadd 27 12093\npublishing op: Request(ExecRequest { function: Add, args: (27, 12093) })\nResponse(ExecResponse { result: 12120 }) from PeerId(\"12D3KooWMWDcvVA8jhn3ggHZr6XmvUs73FGjp3AjRek98w8HjA2k\")\nreceived result: 12120\n```\n\nYou may start additional peers, but you will see duplicate responses from each peer. As well as peers receiving the result that shouldn't.\n\n### TODO\n\n- better msg subscribing, set recipient in result\n- allow peers to register which operations they can perform\n- get relay server working, to use [hole punching](https://docs.rs/libp2p/latest/libp2p/tutorials/hole_punching/index.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftreethought%2Fp2p_exec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftreethought%2Fp2p_exec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftreethought%2Fp2p_exec/lists"}