{"id":19174633,"url":"https://github.com/equalitie/asio-ipfs","last_synced_at":"2025-07-21T18:31:11.363Z","repository":{"id":85416562,"uuid":"134718223","full_name":"equalitie/asio-ipfs","owner":"equalitie","description":"This is a read-only mirror of: https://gitlab.com/equalitie/asio-ipfs \"A C++ Boost.Asio wrapper library over go-ipfs\"","archived":false,"fork":false,"pushed_at":"2023-07-19T15:23:52.000Z","size":60,"stargazers_count":15,"open_issues_count":0,"forks_count":2,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-05-07T18:38:52.751Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","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/equalitie.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}},"created_at":"2018-05-24T13:19:38.000Z","updated_at":"2023-07-19T15:10:46.000Z","dependencies_parsed_at":"2025-04-20T01:31:53.482Z","dependency_job_id":"82fba7f8-919e-4756-b010-e6d934dc31f5","html_url":"https://github.com/equalitie/asio-ipfs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/equalitie/asio-ipfs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/equalitie%2Fasio-ipfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/equalitie%2Fasio-ipfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/equalitie%2Fasio-ipfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/equalitie%2Fasio-ipfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/equalitie","download_url":"https://codeload.github.com/equalitie/asio-ipfs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/equalitie%2Fasio-ipfs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266352504,"owners_count":23915764,"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","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":[],"created_at":"2024-11-09T10:18:36.367Z","updated_at":"2025-07-21T18:31:11.334Z","avatar_url":"https://github.com/equalitie.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CircleCI](https://circleci.com/gh/equalitie/asio-ipfs/tree/master.svg?style=shield)](https://circleci.com/gh/equalitie/asio-ipfs/tree/master)\n\n# Asio.IPFS\n\nA C++ Boost.Asio wrapper library over go-ipfs.\n\n## Features\n\n* Boost.Asio based event loop\n* Supports callbacks, futures and coroutines\n* Cmake automatically downloads `golang` and `go-ipfs` + its dependencies\n* Self contained: no need to run a separate ipfs daemon\n\n## Caveats/TODOs\n\n* Destroying `asio_ipfs::node` will cancel all peding IPFS async operations,\n  but at the moment they can't be cancelled individually.\n* The `asio::io_service` can run in only one thread.\n* Only a basic subset of IPFS operations are currently supported, have a look\n  at `asio_ipfs/node.h` for details.\n* The `node::cat` operation returns the content as a whole (this\n  is OK for small contents, but some kind of stream would be preferred\n  for big ones)\n\n## Requirements\n\nTo be able to use the Asio.IPFS in platforms like Android, where running IPFS as an\nindependent daemon is not a possibility, the wrapper needs to embed IPFS by linking\ndirectly with its Go code.  Thus the source of go-ipfs is needed to build the main\nglue between C++ and IPFS.  Building that source requires a recent version of Go.  To\navoid extra system dependencies, the build process automatically downloads the Go\nsystem and builds IPFS itself.\n\nIn summary, the minimum build dependencies are:\n\n* `cmake` 3.5+\n* `g++` capable of C++14 (`clang` not tested, but there's no reason to thing it\n  wouldn't work)\n* The [Boost library](http://www.boost.org/) v1.62 or higher\n\nFor Debian, this translates to the following packages:\n\n* `build-essential`\n* `cmake`\n* `curl`\n* `libboost-dev`\n* `libboost-system-dev`\n* `libboost-coroutine-dev` (only when it's to be used with coroutines)\n* `libboost-program-options-dev` (only for the examples)\n\nThe build process is able to compile the Asio.IPFS to different platforms with the\nhelp of a properly configured cross-compilation environment.  If you actually intend\nto cross-compile you will need proper C/C++ cross-compiler packages, Boost libraries\nfor the target system and a toolchain file for CMake to use them.\n\nTo the date, the build process has only been tested on 64-bit GNU/Linux platforms\nand ARM based Androids.\n\n## Building\n\n    $ cd \u003cPROJECT ROOT\u003e\n    $ mkdir build\n    $ cd build\n    $ cmake ..\n    $ make\n\nOn success, the _build_ directory shall contain the _libipfs-bindings.so_\nlibrary, _libasio-ipfs.a_ archive and one example programs _ipfs-example_.\n\nTo cross-compile to another system, you may either create a different `build`\ndirectory, or reuse the same directory and just remove the `CMakeCache.txt` file (thus\nyou can reuse some downloads and build tools).  Just remember to point CMake to the\nproper toolchain file.  For the previous Raspbian example:\n\n    cmake -DCMAKE_TOOLCHAIN_FILE=/path/to/toolchain-linux-armhf-gcc6.cmake ..\n    make\n\n### Linux cross-compilation example\n\nFor building binaries in a Debian Strech machine which are able to run on _Raspbian\nStretch_ on the Raspberry Pi:\n\n  - Install the `gcc-6-arm-linux-gnueabihf` and `g++-6-arm-linux-gnueabihf` packages.\n  - As indicated in \u003chttps://wiki.debian.org/Multiarch/HOWTO\u003e, add the new\n    architecture with `dpkg --add-architecture armhf` and update your package list.\n  - Install the Boost libraries matching the target distribution, with the proper\n    architecture suffix:\n\n      - `libboost-system1.62-dev:armhf`\n      - `libboost-coroutine1.62-dev:armhf`\n      - `libboost-program-options1.62-dev:armhf`\n\n  - Create a toolchain file (e.g. `toolchain-linux-armhf-gcc6.cmake`) containing:\n\n        set(CMAKE_SYSTEM_NAME Linux)\n        set(CMAKE_SYSTEM_PROCESSOR armv6l)\n\n        set(CMAKE_C_COMPILER /usr/bin/arm-linux-gnueabihf-gcc-6)\n        set(CMAKE_CXX_COMPILER /usr/bin/arm-linux-gnueabihf-g++-6)\n\n### Android cross-compilation example\n\nFor building binaries able to run in _Android KitKat and above on ARM_ processors you\nwill need a Clang/LLVM standalone toolchain created with the Android NDK.  Assuming\nthat the NDK is under `~/opt/android-ndk-r15c`, you may run:\n\n    $ ~/opt/android-ndk-r15c/build/tools/make-standalone-toolchain.sh \\\n      --platform=android-19 --arch=arm --stl=libc++ \\\n      --install-dir=$HOME/opt/ndk-android19-arm-libcpp\n\nYou will also need to build the Boost libraries for this platform.  You may use\n[Boost for Android](https://github.com/dec1/Boost-for-Android).  Assuming that Boost\nsource is in `~/src/boost/\u003cBOOST_VERSION\u003e`, edit `doIt.sh` and:\n\n  - set `BOOST_SRC_DIR` to `$HOME/src/boost`\n  - set `BOOST_VERSION` to the `\u003cBOOST_VERSION\u003e` above\n  - set `GOOGLE_DIR` to `$HOME/opt/android-ndk-r15c`\n  - modify `build-boost.sh` arguments, set `--version=$BOOST_VERSION`,\n    `--stdlibs=\"llvm-3.5\"`, `--linkage=\"shared\"` and `--abis` to the desired\n    architectures (`armeabi-v7a` in our example)\n\nCreate the `llvm-3.5` link as indicated in Boost for Android's readme and run\n`./doIt.sh` to build the Boost libraries.  This will create the directory\n`build/boost/\u003cBOOST_VERSION\u003e`.\n\nAfter the previous steps you can use a CMake toolchain file like the following one:\n\n    set(CMAKE_SYSTEM_NAME Android)\n    set(CMAKE_SYSTEM_VERSION 19)\n    set(CMAKE_ANDROID_ARCH_ABI armeabi-v7a)\n    set(CMAKE_ANDROID_STANDALONE_TOOLCHAIN $ENV{HOME}/opt/ndk-android19-arm-libcpp)\n\n    set(BOOST_INCLUDEDIR /path/to/Boost-for-Android/build/boost/\u003cBOOST_VERSION\u003e/include)\n    set(BOOST_LIBRARYDIR /path/to/Boost-for-Android/build/boost/\u003cBOOST_VERSION\u003e/libs/${CMAKE_ANDROID_ARCH_ABI}/llvm-3.5)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fequalitie%2Fasio-ipfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fequalitie%2Fasio-ipfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fequalitie%2Fasio-ipfs/lists"}