Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Update the explanation on the usage
  • Loading branch information
wasm-forge authored Aug 29, 2023
1 parent 806c355 commit 09225dd
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,27 @@ 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
```

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.
Expand Down

0 comments on commit 09225dd

Please sign in to comment.