diff --git a/README.md b/README.md index a5ac4fa..0b8aaff 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ This will read the old Wasm file and create a new Wasm file with the WASI depend **NOTE** -The tool requires that you the polyfill implementation is present in your Wasm binary, to do that in your Rust project, you can add the dependency: +The tool requires that the polyfill implementation is present in your Wasm binary, to include the polyfill implementation into your canister project you need to add the dependency: ```bash cargo add --git https://github.com/wasm-forge/ic-wasi-polyfill @@ -40,6 +40,19 @@ cargo add --git https://github.com/wasm-forge/ic-wasi-polyfill This will create the polyfill methods in your `.wasm` file, which are needed for `wasi2ic`. +Also add the call to the init of the polyfill, example: + +```rust +#[ic_cdk::init] +fn init() { + unsafe { + ic_wasi_polyfill::init(&[0u8; 32], &[]); + } +} +``` + + + **NOTE2** The polyfill library is still in early development, and not all methods are implemented. Feel free to review its current state before use.