Skip to content

C and CGO bindings for Filecoin's Rust libraries

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

filestar-project/filecoin-ffi

This branch is 28 commits ahead of, 460 commits behind filecoin-project/filecoin-ffi:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

0c26d36 · Oct 18, 2021
Jun 25, 2021
Apr 10, 2020
Jun 25, 2021
Jul 29, 2020
Oct 18, 2021
Mar 24, 2020
Jul 2, 2020
Jun 11, 2019
Jun 11, 2019
Jun 25, 2021
May 21, 2020
Oct 16, 2020
Jun 18, 2021
Jul 16, 2020
Oct 29, 2020
Jun 18, 2021
Jun 25, 2021
Jun 18, 2021
Jun 18, 2021
Jun 25, 2021
May 21, 2020
May 26, 2021
Jun 18, 2021
Jun 18, 2021
Jun 25, 2021
Jul 29, 2020
Jun 18, 2021
Jun 25, 2021
Nov 30, 2020

Repository files navigation

Filecoin Proofs FFI

C and CGO bindings for Filecoin's Rust libraries

Building

To build and install libfilcrypto, its header file and pkg-config manifest, run:

make

To optionally authenticate with GitHub for assets download (to increase API limits) set GITHUB_TOKEN to personal access token.

If no precompiled static library is available for your operating system, the build tooling will attempt to compile a static library from local Rust sources.

Forcing Local Build

To opt out of downloading precompiled assets, set FFI_BUILD_FROM_SOURCE=1:

rm .install-filcrypto \
    ; make clean \
    ; FFI_BUILD_FROM_SOURCE=1 make

Updating rust-fil-proofs (via rust-filecoin-proofs-api)

If rust-fil-proofs has changed from commit X to Y and you wish to get Y into the filecoin-ffi project, you need to do a few things:

  1. Update the rust-filecoin-proofs-api Cargo.toml file to point to Y
  2. Run cd rust && cargo update -p "filecoin-proofs-api" from the root of the filecoin-ffi project
  3. After the previous step alters your Cargo.lock file, commit and push

go get

go get needs some additional steps in order to work as expected.

Get the source, add this repo as a submodule to your repo, build it and point to it:

$ go get github.com/filecoin-project/filecoin-ffi
$ git submodule add https://github.com/filecoin-project/filecoin-ffi.git extern/filecoin-ffi
$ make -C extern/filecoin-ffi
$ go mod edit -replace=github.com/filecoin-project/filecoin-ffi=./extern/filecoin-ffi

Updating CGO Bindings

The CGO bindings are generated using c-for-go and committed to Git. To generate bindings yourself, install the c-for-go binary, ensure that it's on your path, and then run make cgo-gen. CI builds will fail if generated CGO diverges from what's checked into Git.

Updating the Changelog

The mkreleaselog script (in the project root) can be used to generate a good portion of the filecoin-ffi changelog. For historical reasons, the script must be run from the root of a filecoin-ffi checkout which is in your $GOPATH.

Run it like so:

./mkreleaselog v0.25.0 v0.26.0 > /tmp/v0.26.0.notes.txt

License

MIT or Apache 2.0

About

C and CGO bindings for Filecoin's Rust libraries

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE-APACHE
MIT
LICENSE-MIT

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 59.0%
  • Go 31.3%
  • Shell 9.2%
  • Other 0.5%