From 41ef378a01db6a87a8620d7fb676784222a3b7f4 Mon Sep 17 00:00:00 2001 From: PhilWindle <60546371+PhilWindle@users.noreply.github.com> Date: Tue, 19 Sep 2023 10:52:14 +0100 Subject: [PATCH] feat: Allow custom ports in sandbox (#2393) This PR allows users to specify non-default ports when running the sandbox. # Checklist: Remove the checklist to signal you've completed it. Enable auto-merge if the PR is ready to merge. - [ ] If the pull request requires a cryptography review (e.g. cryptographic algorithm implementations) I have added the 'crypto' tag. - [ ] I have reviewed my diff in github, line by line and removed unexpected formatting changes, testing logs, or commented-out code. - [ ] Every change is related to the PR description. - [ ] I have [linked](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) this pull request to relevant issues (if any exist). --- docs/docs/dev_docs/getting_started/sandbox.md | 2 +- yarn-project/aztec-sandbox/docker-compose.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/docs/dev_docs/getting_started/sandbox.md b/docs/docs/dev_docs/getting_started/sandbox.md index 621a9e68c0d..02566ec22af 100644 --- a/docs/docs/dev_docs/getting_started/sandbox.md +++ b/docs/docs/dev_docs/getting_started/sandbox.md @@ -32,7 +32,7 @@ It will download and execute a script invoking docker compose with 2 containers: - Anvil - Aztec Sandbox -It will need to create servers on localhost ports 8545 (Anvil) and 8080 (Sandbox) so you will need to ensure nothing conflicts with this. +2 ports will need to be opened on your system in order for you to interact with the sandbox. The first port is for Anvil, it defaults to 8545 and can be overridden by specifying a value in the environment variable `SANDBOX_ANVIL_PORT`. The second is the sandbox RPC host port. It defaults to value 8080 but can be overridden with environment variable `SANDBOX_RPC_PORT`. Within a few seconds the Sandbox should be up and running! diff --git a/yarn-project/aztec-sandbox/docker-compose.yml b/yarn-project/aztec-sandbox/docker-compose.yml index e6da4cef6bb..365e0626beb 100644 --- a/yarn-project/aztec-sandbox/docker-compose.yml +++ b/yarn-project/aztec-sandbox/docker-compose.yml @@ -4,12 +4,12 @@ services: image: ghcr.io/foundry-rs/foundry:v1.0.0 command: '"anvil --silent -p 8545 --host 0.0.0.0 --chain-id 31337"' ports: - - '8545:8545' + - '${SANDBOX_ANVIL_PORT:-8545}:8545' aztec: image: 'aztecprotocol/aztec-sandbox:${SANDBOX_VERSION:-latest}' ports: - - '8080:8080' + - '${SANDBOX_RPC_PORT:-8080}:8080' environment: DEBUG: # Loaded from the user shell if explicitly set HOST_WORKDIR: '${PWD}' # Loaded from the user shell to show log files absolute path in host