{"id":17317914,"url":"https://github.com/marty1885/gnunetpp","last_synced_at":"2025-04-14T15:22:26.969Z","repository":{"id":88405792,"uuid":"576830185","full_name":"marty1885/gnunetpp","owner":"marty1885","description":" Experimental high level C++ wrapper for GNUnet","archived":false,"fork":false,"pushed_at":"2024-01-15T14:09:09.000Z","size":207,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T15:22:24.517Z","etag":null,"topics":["gnunet","overlay-network","privacy"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marty1885.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":"2022-12-11T05:34:23.000Z","updated_at":"2024-05-16T12:16:31.000Z","dependencies_parsed_at":"2024-01-15T16:01:15.425Z","dependency_job_id":"cb37ff3f-ec2f-4b7c-ab97-099f750fcab6","html_url":"https://github.com/marty1885/gnunetpp","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/marty1885%2Fgnunetpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marty1885%2Fgnunetpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marty1885%2Fgnunetpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marty1885%2Fgnunetpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marty1885","download_url":"https://codeload.github.com/marty1885/gnunetpp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248904686,"owners_count":21180840,"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":["gnunet","overlay-network","privacy"],"created_at":"2024-10-15T13:18:14.037Z","updated_at":"2025-04-14T15:22:26.951Z","avatar_url":"https://github.com/marty1885.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GNUnet++ - High level C++ wrapper for GNUnet\n\n## Why GNUnet++?\n\nIMO GNUnet is a cool project which shows what decentralized systems could look like. However the [time to first hello world][ttfhw] is way too long, API is not well documented and everything is written GNU style C. Which are all factors against it's adoption. GNUnet++ wraps all the C-ness into a (more or less) modern C++ style highlevel API. Provides proper lifetime management and an easier learning path. Hopefully leading to a better development experience.\n\n**IMPORTAN**: This is not a part of the GNUnet project. The [author](https://github.com/marty1885) created it because he wants to use GNUnet in C++.\n\n**ALSO IMPORTANT**: Don't expect the code base be clean. GNUnet is a _very_ C project. Lifetime managment is all over the place. I did my best to create a sane API out of it. Nor it is production ready. The API might go through major changes in the future. Nor ABI stability is guaranteed.\n\n[ttfhw]: https://www.moesif.com/blog/technical/api-product-management/What-is-TTFHW/ \n\n## Show me some code!\n\nThe DHT class provides easy access to GNUnet's DHT. It's API is designed to look like [OpenDHT][opendht]'s for more familiarity to potential users. Note that need GNUnet running on your system before running the samples.\n\n```cpp\n// Max 32 simultaneous operations\nauto dht = std::make_shared\u003cDHT\u003e(cfg, 32);\n\n...\ndht-\u003eput(\"Answer\", \"42\");\ndht-\u003eget(\"some_super_secret\", [](const std::string_view data) {\n   std::cout \u003c\u003c \"super secret info: \" \u003c\u003c data \u003c\u003c std::endl;\n   return true; // keep on searching after the current one.\n   // return false to cancel futher lookups.\n}, std::chrono::seconds(30)); // Max searching for 30 seconds\n```\n\nMakes CADET much easier to use.\n\n\n```cpp\nauto cadet = std::make_shared\u003cCADET\u003e(cfg);\nauto channel = cadet-\u003econnect(\"SOME_PEER_ID\", \"PORT_NAME\");\nchannel-\u003esetReceiveCallback([](const std::string_view data, uint16_t type) {\n   std::cout \u003c\u003c \"Received: \" \u003c\u003c data \u003c\u003c std::endl;\n});\nchannel-\u003esend(\"Hello World!\", GNUNET_MESSAGE_TYPE_CADET_CLI);\n```\n\nSearch and download files from the GNUnet File Sharing service.\n\n```cpp\nFS::search({\"jpg\"}, [](const std::string_view uri, const std::string_view name) {\n   std::cout \u003c\u003c \"Found \" \u003c\u003c filename \u003c\u003c \" at \" \u003c\u003c uri \u003c\u003c std::endl;\n   return true;\n}, std::chrono::seconds(30));\n\nFS::downlad(\"gnunet://fs/...\", \"foobar.jpg\", [](DownloadStatus status) {\n    if(status == DownloadStatus::Completed)\n      // yay! we're done\n});\n```\n\nWich generates the following output\n\n```\nFound IMG_20220528_134243_161.jpg at gnunet://fs/chk/N59XZ8KPMQ0975JBTPV9AGEAD5T7V694QYWNK21683Q74TTRMQB2CHW4AZVTM3A5NFC57K0N6PD5EGCGMJABTZ6HKMV9ZC1T52FTVSG.2RJ19QYFPBJ2TBMZSNECXP9KHDTX90B6ZCTBSJYQKPK016156HNCPE5RJMNEM3A1NTRHMVWK8GCJ1MVG4S25F8A4TW1S70PCDMSG94R.2778934\n\nFound 1651945314526m.jpg at gnunet://fs/chk/R4MCF6MTQDR4VKKKMD1H8PD9THRKGV1ER0BXP57BKVT2580KW7S25HFSW7MK0BM1JBPBEHG6P0SHDHDERX7MTPFA5YE68E7Q43H8Z78.4J604CQR9AESPQ3X894PE2P56X3P21QJWBBQQXH4SR07X4KXX5TBH62BHSDT6HWY70XP5DZB5S5FADDJ7TDYENEX67H4JN6Q1KP725G.91907\n\nFound ball.jpg at gnunet://fs/chk/3ZJRZJRDD6V6R54TG9VAC4G3ZQ4WGZ5ZVSP5BZ12X004CYTGDNTB9P8STZ0P1Y2REB28EA8FZ3JZ4900V5FVEMYAESDWVGATZ37WJAR.46BHSJS8BXTT6KN4NTBS66VAYSDKRFST71439H6RAAKPT294T3ECY6AEQCN726ZQXW039YD7Z0Q17385HMH8RQWT92AR8AQ4B47X60R.241099\n...\n```\n\nExamples with comments can be found in the [examples](examples) directory.\n\n[opendht]: https://github.com/savoirfairelinux/opendht\n\n## Requirments\n\nFirst you need the dependencies\n\n* C++20 capable compiler\n  * Tested with GCC 12.1 and Clang 14.0\n* A installation of GNUnet 0.19 (or likely the latest version)\n* libidn\n\n(For examples)\n* CLI11\n\n(For tests)\n* Drogon (for the async test framework)\n\n## Roadmap\n\nThis project aims to create a easy to use wapper for the commonly used part of GNUnet.\n\n- General\n  - [x] Move applicable APIs to C++ coroutines\n  - [x] Primitives to support multithreading\n    - [x] Allow other threads to wake GNUnet scheduler\n  - [x] Replace cppcoro\n  - [ ] Port to C++ modules when CMake supports it\n- CMake\n  - [x] Locate GNUnet installation path (currently use the expected path)\n  - [x] Find libidn\n- DHT\n  - [x] Basic operations (put/get)\n  - [ ] Monitor\n- File Sharing\n  - [x] Download\n  - [x] Publish\n  - [x] Search\n  - [x] Unindex\n- Crypto\n  - [x] Hash\n  - [x] HMAC\n  - [x] ECDSA/EDDSA\n  - [x] to_string\n  - [ ] RSA\n  - [x] Signatures\n- CADET\n  - [x] Server\n  - [x] Client\n- GNS\n  - [x] Resolve\n- Namestore\n  - [x] Register/modify record\n  - [x] Lookup record in zone\n- Identity\n  - [x] Create\n  - [x] Delte\n  - [x] Get Ego\n  - [x] List\n- NSE (Network Size Estimatior)\n  - [x] Get value\n  - [x] Watch value\n- PeerInfo\n  - [x] List peers\n  - [x] Add peer\n  - [ ] Hello message to URI\n    - Partially done. Current method depends on ABI of transport plugins not changing.\n    - However, it is memory safe.\n  - [ ] Parse HELLO URI\n\n- Scheduler\n  - [x] Delayed run\n  - [x] Run on exit\n  - [x] Run immidately\n- Messenger\n  - [x] Send/receive basic messages\n  - [x] Joining via doors\n  - [ ] Send/receive files\n  - [x] API to send non-text messages\n- Overall cleanup\n  - [ ] Enforce memory safety and track all raw pointers","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarty1885%2Fgnunetpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarty1885%2Fgnunetpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarty1885%2Fgnunetpp/lists"}