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

feat: add otterscan to sandbox #2648

Merged
merged 8 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
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
12 changes: 11 additions & 1 deletion docs/docs/dev_docs/getting_started/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ With the help of Aztec.js you will be able to:

This quickstart walks you through installing the Sandbox, deploying your first Noir contract, and verifying its execution!

## Sandbox Contents

The sandbox contains a local ethereum instance running [Anvil](https://book.getfoundry.sh/anvil/), a local instance of the Aztec rollup, an aztec private execution client for handling user transactions and state, and, if using Docker, an [Otterscan](https://github.com/otterscan/otterscan) block explorer for the local ethereum network.

These provide a self contained environment which deploys Aztec on a local (empty) ethereum network, creates 3 smart contract wallet accounts on the rollup, and allows transactions to be processed on the local Aztec sequencer.

The current sandbox does not generate or verify proofs, but provides a working end to end developer flow for writing and interacting with Aztec.nr smart contracts.

## Requirements

- Node.js >= v18 (recommend installing with [nvm](https://github.com/nvm-sh/nvm))
Expand All @@ -57,7 +65,9 @@ To install a specific version of the sandbox, you can set the environment variab
SANDBOX_VERSION=<version> /bin/bash -c "$(curl -fsSL 'https://sandbox.aztec.network')"
```

NOTE: If `SANDBOX_VERSION` is not defined, the script will pull the latest release of the sandbox.
NOTE: If `SANDBOX_VERSION` is not defined, the script will pull the latest release of the sandbox. The sandbox version should be the same as your `@aztec/cli` package to ensure compatibility.

Once docker is up, you can see ethereum layer 1 activity through the local [otterscan](http://localhost:5100). This is especially useful for dapps that use L1-L2 messaging through [portal contracts](../contracts/portals/main.md).

### With npm

Expand Down
13 changes: 12 additions & 1 deletion yarn-project/aztec-sandbox/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3'
services:
ethereum:
image: ghcr.io/foundry-rs/foundry:v1.0.0
image: ghcr.io/foundry-rs/foundry@sha256:29ba6e34379e79c342ec02d437beb7929c9e254261e8032b17e187be71a2609f
Copy link
Contributor Author

@dan-aztec dan-aztec Oct 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

had to use a later version for otterscan support - this one is tagged "latest" as of October 3rd 2023 (its ~a week older than the nightly builds, stable is ~3 months old but new tag getting pushed soon)

command: '"anvil --silent -p 8545 --host 0.0.0.0 --chain-id 31337"'
ports:
- '${SANDBOX_ANVIL_PORT:-8545}:8545'
Expand All @@ -24,3 +24,14 @@ services:
ARCHIVER_VIEM_POLLING_INTERVAL_MS: 500
volumes:
- ./log:/usr/src/yarn-project/aztec-sandbox/log:rw

otterscan:
image: otterscan/otterscan:develop
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

asked if they can update the stable tag, but i think this is OK for now

# platform: linux/amd64
ports:
- "5100:80"
container_name: otterscan
environment:
# otterscan env var is hardcoded to support erigon client
# but it also works for anvil
- ERIGON_URL=http://127.0.0.1:${SANDBOX_ANVIL_PORT:-8545}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.