Skip to content

Commit

Permalink
docs: Update README with new config
Browse files Browse the repository at this point in the history
  • Loading branch information
oskarth committed Feb 1, 2024
1 parent f8db4cc commit 4b9194f
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 10 deletions.
36 changes: 29 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,31 @@ Zooming in a bit:

(Note that we require `uniffi-bindgen` to be `0.25`, if you have an older version you might need to remove this to re-install the latest).

### Configure settings

By creating a `toml` configuration file you can specify what build settings you want to use. Example is provided in `config-example.toml`:

```
# config-example.toml
[build]
# For iOS device_type can be x86_64, simulator, device
# For Android device_type can be x86_64, arm, arm64
device_type = "simulator" # Options: x86_64, simulator, device, arm, arm64
# debug is for Rust library to be in debug mode and release for release mode
# We recommend release mode by default for performance
build_mode = "release" # Options: debug, release
[circuit]
dir = "examples/circom/keccak256" # Directory of the circuit
name = "keccak256_256_test" # Name of the circuit
[dylib]
use_dylib = true # Options: true, false
name = "keccak256.dylib" # Name of the dylib file, only used if use_dylib is true
```

### iOS

#### Prepare
Expand All @@ -39,20 +64,17 @@ Zooming in a bit:

#### Build Bindings

To build bindings for iOS simulator debug mode, run
To build bindings for iOS, adjust settings in your config file (we recommend starting with `simulator` and `release`) and run:

```sh
./scripts/build_ios.sh simulator debug
./scripts/build_ios.sh config-example.toml
```

Open the `mopro-ios/MoproKit/Example/MoproKit.xcworkspace` in Xcode.

#### Update Bindings

To update bindings, run `./scripts/update_bindings.sh simulator|device debug|release`.

- `simulator` is for building library to run on iOS simulator, `device` is for running on a real device
- `debug` is for Rust library to be in debug mode and `release` for release mode
To update bindings, run `./scripts/update_bindings.sh config-example`.

### Android

Expand Down Expand Up @@ -80,7 +102,7 @@ To update bindings, run `./scripts/update_bindings.sh simulator|device debug|rel
To build bindings for android simulator debug mode, run

```sh
./scripts/build_android.sh arm64 debug
./scripts/build_android.sh config-example.toml
```

- **Device types:** `x86_64`, `x86`, `arm`, `arm64`
Expand Down
11 changes: 8 additions & 3 deletions config-example.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
# config-example.toml

[build]
device_type = "simulator" # Options: x86_64, simulator, device
build_mode = "release" # Options: debug, release
# For iOS device_type can be x86_64, simulator, device
# For Android device_type can be x86_64, arm, arm64
device_type = "simulator" # Options: x86_64, simulator, device, arm, arm64

# debug is for Rust library to be in debug mode and release for release mode
# We recommend release mode by default for performance
build_mode = "release" # Options: debug, release

[circuit]
dir = "examples/circom/keccak256" # Directory of the circuit
name = "keccak256_256_test" # Name of the circuit

[dylib]
use_dylib = false # Options: true, false
use_dylib = true # Options: true, false
name = "keccak256.dylib" # Name of the dylib file, only used if use_dylib is true

0 comments on commit 4b9194f

Please sign in to comment.