Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
src
test
Cargo.toml
LICENSE-APACHE
LICENSE-MIT
README.md
build.sh
cardano.h
test.sh

README.md

C binding for the cardano library

Build Status MIT or APACHE-2 licensed Cardano Mainnet Cardano Staging Cardano Testnet

Exports simple API to use in C library or to write bindings in other languages.

Cross compiling for different targets

To ease the process of cross-compiling to different plate-forms and architectures we provide a build script,

./build.sh <TARGETS>

To see the list of supported platforms, see rustup target list. Theoretically, all the targets are supported.

Cross compiling for iOS

Use cardano-lipo

find linker for your targets

rust does not provide the linker for the targets, it is you to provide it. For example, to cross compile for a given <target>:

  • in `.cargo/config
    [target.<target>]
    linker = "/path/to/linker/for/<target>"
  • then run build script:
    ./build.sh <target>

After successful completion of the script, you will find a directory dist at the root of this crate with directories containing the differently built targets. In our example, something like:

$ tree dist/
dist/
└── cardano-c
    └── <target>
        ├── debug
        │   ├── libcardano_c.a
        │   └── libcardano_c.d
        └── release
            ├── libcardano_c.a
            └── libcardano_c.d

The *.d files are kept in case you want to integrate these in your build and track changes to the rust library as well.

Supported targets

rustup target add aarch64-apple-ios # or any target below
Target test
aarch64-unknown-linux-gnu
aarch64-linux-android
aarch64-apple-ios
arm-unknown-linux-gnueabi
arm-linux-androideabi
armv7-unknown-linux-gnueabihf
armv7-linux-androideabi
armv7-apple-ios
armv7s-apple-ios
i686-unknown-linux-gnu
i686-unknown-linux-musl
i686-unknown-freebsd
i686-apple-ios
i686-apple-darwin
i686-linux-android
x86_64-unknown-linux-gnu
x86_64-unknown-linux-musl
x86_64-linux-android
x86_64-apple-darwin
x86_64-apple-ios
x86_64-unknown-freebsd

supported compiler versions

Rust test
stable
beta
nightly

We will always aim to support the current stable version. However, it is likely that an older version of the Rust compiler is also supported.

License

This project is licensed under either of the following licenses:

Please choose the licence you want to use.