Skip to content

Commit

Permalink
chore: update docs for running the stack locally (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
cwkang1998 authored Aug 14, 2024
1 parent bee9e0d commit 63a84c8
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions RUNNING_LOCALLY.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
# Running the verifier locally

In order to run the verifier with locally ran services, you'll have to make some modification to the code, particularly in the `cli` crate.
You might want to run the verifier locally in order to test some features of the verification stack. We cover some cases here which might be helpful to devs.

## Running partial stack locally
1. Setup your database. For convenience sake you can connect to a database with data like those in integration or dev env for the network db, and you can run a local centralized db for easier monitoring,
2. Run the cairo compiler service
3. Run the backend api service
4. Change relevant code for the verification api endpoints in [`crates/cli/src/cli.rs`](./crates/cli/src/cli.rs)
### Running it against a dev environment

With this you should be able to run the whole stack for testing verification locally.
In order to run the cli against the dev environment, you can utilize the custom api endpoint env vars to pass your desired api endpoints and thus allow the cli to interact with the dev environment.

For example, if your dev environment is located locally at your machine, you can do the following:

### Running it against the dev environment
```bash
CUSTOM_INTERNAL_API_ENDPOINT_URL="http://localhost:3030" CUSTOM_PUBLIC_API_ENDPOINT_URL="http://localhost:3034" cargo run --bin starknet-contract-verifier
```

Generally, running against the integration environments is more troublesome. Once changes are propagated to dev env, you can make the necessary changes in [`crates/cli/src/cli.rs`](./crates/cli/src/cli.rs) to point to the dev env.
## Running the verification stack locally
This details the steps in order to run the stack for our verification flow locally. The first 3 steps includes components not in this repository. This is usually done by developer working on these components and want to perform manual testing of the verification stack.

If the api endpoint is unknown to you, please ask the Voyager team to provide you with the information.
1. Setup your database. For convenience sake you can connect to a database with data like those in integration or dev env for the network db, and you can run a local centralized db for easier monitoring,
2. Run the cairo compiler service
3. Run the backend verification api service
4. Pass the custom endpoints env vars in order to set your endpoint urls.

With this you should be able to run the whole stack for testing verification locally.

### Running full stack locally
WIP
Make sure the changes you want to test is already propagated to the dev env. If the api endpoint is unknown to you, please ask the Voyager team to provide you with the information.

0 comments on commit 63a84c8

Please sign in to comment.