Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 13 additions & 29 deletions bindings/go/README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,28 @@
# IOTA SDK - Go Bindings

# Install `uniffi-bindgen-go`
## Prerequisites

https://github.com/NordSecurity/uniffi-bindgen-go
Make sure to have those dependencies installed on your system:

`cargo install uniffi-bindgen-go --git https://github.com/filament-dm/uniffi-bindgen-go --rev ab7315502bd6b979207fdae854e87d531ee8764d` until https://github.com/NordSecurity/uniffi-bindgen-go/pull/77 is merged
- GNU Make
- Go
- uniffi-bindgen-go

# Compile the FFI crate to a dynamic library
Until https://github.com/NordSecurity/uniffi-bindgen-go/pull/77 is merged, it is recommended to install `uniffi-bindgen-go` via:

```sh
cargo build --all-features -p iota-sdk-ffi --lib --release
```

# Generate the Go bindings

## MacOS

```sh
uniffi-bindgen-go --library target/release/libiota_sdk_ffi.dylib --out-dir ./bindings/go --no-format
```

## Linux

```sh
uniffi-bindgen-go --library target/release/libiota_sdk_ffi.so --out-dir ./bindings/go --no-format
```bash
cargo install uniffi-bindgen-go --git https://github.com/filament-dm/uniffi-bindgen-go --rev ab7315502bd6b979207fdae854e87d531ee8764d
```

## Windows
Verify by running `make --version`, `go version`, and `uniffi-bindgen-go --version`.

```sh
uniffi-bindgen-go --library target/release/libiota_sdk_ffi.dll --out-dir ./bindings/go --no-format
```

# Run an example
## Generate Go bindings

```sh
LD_LIBRARY_PATH="../../target/release" CGO_LDFLAGS="-liota_sdk_ffi -L../../target/release" go run examples/chain_id.go
```bash
make go
```

or
## Run Go example

```sh
make go-example chain_id
Expand Down
35 changes: 10 additions & 25 deletions bindings/kotlin/README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,29 @@
# IOTA SDK - Kotlin Bindings

## Generate Binding
## Prerequisites

```bash
#!/bin/bash
LANGUAGE="kotlin"
# Start by building the library to generate the appropriate dylib files
cargo build -p iota-sdk-ffi --lib --release
# Determine the library extension based on the platform
case "$(uname -s)" in
Darwin) LIB_EXT=".dylib" ;;
Linux) LIB_EXT=".so" ;;
MINGW*|MSYS*|CYGWIN*|Windows_NT) LIB_EXT=".dll" ;;
*) echo "Unsupported platform"; exit 1 ;;
esac
cargo run --bin iota_sdk_bindings -- generate --library "target/release/libiota_sdk_ffi${LIB_EXT}" --language $LANGUAGE --out-dir bindings/$LANGUAGE/lib --no-format -c bindings/kotlin/uniffi.toml
# Finally, copy the library file to the output directory.
cp target/release/libiota_sdk_ffi${LIB_EXT} bindings/$LANGUAGE/lib/
```
Make sure to have those dependencies installed on your system:

# Run an example
- GNU Make
- Gradle

Install gradle:
It is recommended to install `Gradle` through:

```bash
curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk install gradle
```

`java -version` should be >= 21
Verify by running `make --version` and `gradle --version`.

```bash
cd bindings/kotlin
## Generate Kotlin bindings

./gradlew build clean
LD_LIBRARY_PATH=./lib ./gradlew example -Pexample=chain_id
```bash
make kotlin
```

or
## Run Kotlin example

```sh
make kotlin-example chain_id
Expand Down
33 changes: 10 additions & 23 deletions bindings/python/README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,23 @@
# IOTA SDK - Python Bindings

```sh
cargo build --all-features -p iota-sdk-ffi --lib --release
```

# Generate the Python bindings

## MacOS

```sh
cargo run --bin iota_sdk_bindings -- generate --library "target/release/libiota_sdk_ffi.dylib" --language python --out-dir bindings/python/lib --no-format
```
## Prerequisites

## Linux
Make sure to have those dependencies installed on your system:

```sh
cargo run --bin iota_sdk_bindings -- generate --library "target/release/libiota_sdk_ffi.so" --language python --out-dir bindings/python/lib --no-format
```
- GNU Make
- Python3

## Windows
Please follow the general install instructions for your platform.

```sh
cargo run --bin iota_sdk_bindings -- generate --library "target/release/libiota_sdk_ffi.dll" --language python --out-dir bindings/python/lib --no-format
```
Verify by running `make --version` and `python3 --version`.

# Run an example
## Generate Python bindings

```sh
PYTHONPATH=. python3 examples/chain_id.py
```bash
make python
```

or
## Run Python example

```sh
make python-example chain_id
Expand Down