Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update docs for running the stack locally #64

Merged
merged 1 commit into from
Aug 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Loading