Skip to content

Commit 3166484

Browse files
make requested changes
1 parent d249eb6 commit 3166484

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

examples/wasm-demo-cairo1/README.md

+12-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Demo of `cairo-vm` on WebAssembly
22

33
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.
55

66
Since mimalloc is not automatically compilable to WebAssembly, the cairo-vm dependency should disable the default features, which will in turn disable mimalloc.
77

@@ -11,7 +11,7 @@ A working example is provided in this repository.
1111

1212
To compile and run the example you need:
1313

14-
- a Cairo 0 compiler
14+
- an either Cairo 1 or Cairo 2 compiler
1515
- the _wasm-pack_ crate
1616
- some HTTP server (for example: the `live-server` npm module)
1717

@@ -20,12 +20,20 @@ To compile and run the example you need:
2020
2121
## Building
2222

23-
To build the example, first compile your Cairo 1.x program:
23+
To build the example, first compile your Cairo 1 / 2 program:
24+
25+
Cairo 1
2426

2527
```sh
2628
../../cairo1/bin/cairo-compile -r ./bitwise.cairo bitwise.sierra
2729
```
2830

31+
Cairo 2
32+
33+
```sh
34+
../../cairo2/bin/cairo-compile -r ./bitwise.cairo bitwise.sierra
35+
```
36+
2937
> It's important to use the `-r` flag. If not, the `main` function won't be recognized.
3038
3139
And then the WebAssembly package:
@@ -42,7 +50,7 @@ To run the example webpage, you need to run an HTTP server.
4250
For example, using the _live-server_ npm module:
4351

4452
```sh
45-
# while in <repo>/examples/wasm-demo
53+
# while in <repo>/examples/wasm-demo-cairo1
4654
npx live-server
4755
```
4856

0 commit comments

Comments
 (0)