From c7ced196747791239fb8201b7580afaa73f5ab8c Mon Sep 17 00:00:00 2001 From: Brord van Wierst Date: Thu, 15 Oct 2020 17:06:12 +0200 Subject: [PATCH 1/2] Updated C bindings instructions --- bindings/c/README.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/bindings/c/README.md b/bindings/c/README.md index 2463baf3..5c964b1b 100644 --- a/bindings/c/README.md +++ b/bindings/c/README.md @@ -2,12 +2,20 @@ ## 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 goes to async +`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 `cargo build --target-dir ./target` to build the rust code. +Then run `make` to build the rust code. -A binary will be generated which you can run in `./target/streams` +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` + +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. From 7bc948b9c7c10b9b5e32bf699027287eab9b7749 Mon Sep 17 00:00:00 2001 From: Brord van Wierst Date: Thu, 15 Oct 2020 17:11:47 +0200 Subject: [PATCH 2/2] Update README.md --- bindings/c/README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/bindings/c/README.md b/bindings/c/README.md index 5c964b1b..752b7af0 100644 --- a/bindings/c/README.md +++ b/bindings/c/README.md @@ -3,9 +3,10 @@ ## Instructions 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 goes to async -`STATIC`: Build static library when ON, otherwise dynamic library + +- `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` @@ -14,8 +15,8 @@ run `cmake .` in this folder Then run `make` 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` +- ON: `iota_streams_c_static` +- OFF: `libiota_streams_c.so`(Unix), `iota_streams_c.dll`(Windows) and the executable `iota_streams_c` 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.