![GitHub pull requests]https://img.shields.io/github/issues-pr/vasild/cpp-ipfs-http-client)
Allows C++ applications to communicate with an IPFS node. It implements IPFS API bindings for C++. See the documentation or the source code.
See also IPFS on GitHub.
Currently implemented methods:
- block: get(), put(), stat()
- config: get(), set(), replace()
- dht: findpeer(), findprovs()
- files: get(), add()
- miscellaneous: id(), version()
- object: new(), put(), get(), data(), links(), stat(), patch.addLink(), patch.rmLink(), patch.appendData(), patch.setData()
- pin: add(), ls(), rm()
- swarm: addrs(), connect(), disconnect(), peers()
- key: gen(), list(), rm()
Not all methods are implemented.
- Implement the missing methods
- Contributors are welcome!
cmake /path/to/cpp-ipfs-http-client
make -j 6
make install
See the documentation for details.
Test cases are build by default, but if you want to build with coverage:
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug -DRUN_COVERAGE=ON -DBUILD_SHARED_LIBS=ON
# Run tests & Build the HTML report
make ctest_coverage_html -j 6
# Or run tests & create a Cobertura XML file
make ctest_coverage_xml -j 6
Build Doxygen files locally. From the root directory of this project:
mkdir build
cd build
cmake -DDOC=ON ..
make -j
#include <iostream>
#include <sstream>
#include <ipfs/client.h>
int main(int, char**) {
std::stringstream contents;
ipfs::Client client("localhost", 5001);
client.FilesGet("/ipfs/QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG/readme", &contents);
std::cout << contents.str() << std::endl;
return 0;
}
c++ -std=c++11 -I/path/to/header -L/path/to/lib -lipfs-http-client myprog.cc -o myprog
Feel free to open issues and pull requests. Report vulnerabilities publicly, similar to other non-security issues.
The project adheres to the Google C++ Style Guide. Use clang-format to properly format the code when you submit patches.
Write tests for new code. Changes should not cause the code coverage to go down (ideally up).
The code is distributed under the MIT License.