Skip to content
This repository has been archived by the owner on Apr 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request #40 from iotaledger/kwek20-patch-2
Browse files Browse the repository at this point in the history
Updated C bindings instructions
  • Loading branch information
Brord van Wierst committed Oct 15, 2020
2 parents c921870 + 7bc948b commit 762142e
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions bindings/c/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,21 @@

## Instructions

Change `src/constants.rs` to your preferred node and settings. (default to localhost)
Check out `CMakeLists.txt` and change the 3 options to your preference:

- `NO_STD`: Enable no_std build, without iota_client (when ON, `SYNC_CLIENT` isnt supported)
- `SYNC_CLIENT`: Enable sync transport via iota_client, otherwise it's going to be Bucket which can only be used for tests
- `STATIC`: Build static library when ON, otherwise dynamic library

Edit your author and subscriber seeds in `main.c`

run `./make` in this folder
run `cmake .` in this folder

Then run `make` to build the rust code.

Then run `cargo build --target-dir ./target` to build the rust code.
A binary will be generated which you can run depending on your STATIC setting
- ON: `iota_streams_c_static`
- OFF: `libiota_streams_c.so`(Unix), `iota_streams_c.dll`(Windows) and the executable `iota_streams_c`

A binary will be generated which you can run in `./target/streams`
You can then run the static build or the dynamic executable. Keep in mind that by default the code points to a node on `http://localhost:14265`.
If this node doesnt exist, we will exit with an error immediately.

0 comments on commit 762142e

Please sign in to comment.