Skip to content

Commit

Permalink
Update readme with evn command (#1460)
Browse files Browse the repository at this point in the history
* Update readme with evn command

* Edit readme

---------

Co-authored-by: Leandro Ferrigno <[email protected]>
  • Loading branch information
lferrigno and Leandro Ferrigno authored Oct 11, 2023
1 parent 30eb46d commit a47c0c8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ cairo-vm-pypy-env/*
/cairo2/
/cairo-lang/
*.tar
cairo-vm-cli/air_input.pub

ensure-no_std/Cargo.lock

Expand Down
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,18 @@ These dependencies are only necessary in order to run the original VM, compile C

You can install all of the required and optional dependencies by running the script `install.sh` while in the repository root.

### Installing project dependencies

In order to compile programs you need to install the cairo-lang package.

Running the `make deps` (or the `make deps-macos` if you are runnning in MacOS) command will create a virtual environment with all the required dependencies.

You can then activate this enviroment by running
```bash
. cairo-vm-env/bin/activate
```


## 🚀 Usage

### Adding cairo-vm as a dependency
Expand All @@ -110,6 +122,11 @@ The `-F lambdaworks-felt` part adds usage of [`lambdaworks-math`](https://github

Once the binary is built, it can be found in `target/release/` under the name `cairo-vm-cli`.

In order to compile Cairo programs you need to activate the environment created while installing dependencies. To start it, run:
```bash
. cairo-vm-env/bin/activate
```

To compile a program, use `cairo-compile [path_to_the_.cairo_file] --output [desired_path_of_the_compiled_.json_file]`. For example:

```bash
Expand All @@ -133,6 +150,8 @@ cd cairo-vm

cargo build --release

. cairo-vm-env/bin/activate

cairo-compile cairo_programs/abs_value_array.cairo --output cairo_programs/abs_value_array_compiled.json

target/release/cairo-vm-cli cairo_programs/abs_value_array_compiled.json --layout all_cairo
Expand Down

0 comments on commit a47c0c8

Please sign in to comment.