Skip to content

A C-Style library implemented in Go for using IPFS in C++/C.

License

Notifications You must be signed in to change notification settings

scala-network/libipfs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libIPFS

libIPFS is a C-style library that wraps around go-ipfs as a library (not an embedded executable) and provides a simple and intuitive API.

Building

Use the provided Makefile to build the library. For example, to build for Linux on amd64:

make build_linux_amd64

You can also build for other platforms by specifying the target:

make build_windows_amd64
make build_darwin_amd64
make build_darwin_arm64
make build_linux_riscv64
make build_linux_arm64
make build_freebsd_amd64

Note:

  • Cross-compilation has been tested on Debian 12.
  • For FreeBSD builds, you may need a proper sysroot configuration.
  • For macOS builds, osxcross is required.

Usage

An example program, example.cpp, is provided in the root of the repository. After building the library, copy the example file to the bin/ folder and compile it with g++:

g++ -pthread -o libipfs-example example.cpp libipfs-linux-amd64.a -Wl,--no-as-needed -ldl -lresolv

Run the compiled example:

./libipfs-example

License

This project is licensed under the terms specified in the LICENSE file.