- https://rustup.rs
uniffi_bindgen
0.17.0 or newer
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
cargo install uniffi_bindgen
uniffi-bindgen --version # check the version is 0.17.0 or newer
brew install ktlint
brew install swiftformat
uniffi-bindgen generate common/src/common.udl --config-path common/uniffi.toml --language kotlin --out-dir bindings/android
uniffi-bindgen generate common/src/common.udl --config-path common/uniffi.toml --language swift --out-dir bindings/ios
wasm-pack build --scope crypto-com bindings/wasm
The single proto-build
crate in this repo clones and rebuilds proto files for
all other crates, simply make the required edits in main.rs, then
cd proto-build # enter `proto-build`, so that we can clone repos and build proto files relative to it
cargo run # build proto files and output to `../proto/src/prost` folder
or simply run make proto
.
build in macos or linux
requires android sdk and ndk, java sdk
install android ndk: https://developer.android.com/ndk
suggest version r22 https://github.com/android/ndk/wiki/Unsupported-Downloads
android studio: https://developer.android.com/studio
set env ANDROID_SDK_ROOT,NDK_HOME,JAVA_HOME
such as
export ANDROID_SDK_ROOT={DIR}/Android/sdk
export NDK_HOME=$ANDROID_SDK_ROOT/ndk/22.1.7171670
export JAVA_HOME={DIR}/openjdk/17.0.1_1/
build:
make android
build in macos
Requires Xcode 13+
build:
make ios
Build bindings/cpp
and example/cpp_example
make build_cpp
Build bindings/cpp
and example/cpp_example
, and run the example programs. Please notice, errors could happen if devnets (chainmain and cronos) are not running.
make cpp
- generate the bindings as above
cd example/js-example
npm install
npm start
- make wasmweb
cd example/extension-example
npm install
Please install pystarport
, supervisord
, chain-maind v3.3.3
or newer before running this test.
make wasm-tests
Please install nix
before running this test.
make wasm-ci-tests
The recommended way to use wasm-bindgen-test
is with wasm-pack
, since it will handle installing the test runner, installing a WebDriver client for your browser, and informing cargo how to use the custom test runner. However, you can also manage those tasks yourself, if you wish.
It is also possible to use cargo test
instead of wasm-pack
-
Install wasm-bindgen-cli
cargo install wasm-bindgen-cli
-
Install chromdriver (for chrome)
brew install --cask chromedriver
-
Run the test in binding/wasm folder
cargo test
make cpp-ci-tests # build bindings and examples, then run the test
# or
make cpp-tests # run the test without building bindings and examples
Please install nix
before running this test.
make python-tests