You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/wasm-demo-cairo1/README.md
+12-3Lines changed: 12 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,10 @@
1
-
# Demo of `cairo-vm` on WebAssembly
1
+
# Demo of `cairo-vm` on WebAssembly (Cairo 1)
2
2
3
3
While cairo-vm is compatible with WebAssembly, it doesn't implement any bindings to it.
4
-
Instead, create a new WebAssembly crate with cairo-vm as a dependency and implement the required functionality there.
4
+
Instead, create a new WebAssembly crate with cairo-vm and cairo1-run as dependencies and implement the required functionality there.
5
5
6
-
Since mimalloc is not automatically compilable to WebAssembly, the cairo-vm dependency should disable the default features, which will in turn disable mimalloc.
6
+
Since mimalloc is not automatically compilable to WebAssembly, the cairo-vm dependency should disable the default features, which will in turn disable mimalloc. Simliar to this, WebAssembly is
7
+
not compatible with rust standard library. For this reason, cairo1-run should also disable the default features.
7
8
8
9
A working example is provided in this repository.
9
10
@@ -22,10 +23,18 @@ To compile and run the example you need:
22
23
23
24
To build the example, first you need to compile your Cairo Program, using either cairo 1 or cairo 2 compiler:
> WARNING: This example uses `cairo1-run::cairo_run_program` which expectes the program to be compiled with debug names. By default, `cairo-compile` does not include debug names in sierra. Due to this, the flag `-r` or `--replace-ids` is needed.
0 commit comments