Skip to content
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
16 changes: 4 additions & 12 deletions aztec-up/bin/.aztec-run
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,10 @@ done
arg_port_assignment=""

# Dynamic port assignment.
if [ -n "${AZTEC_PORT:-}" ]; then
arg_port_assignment+=" -p $AZTEC_PORT:$AZTEC_PORT "
fi

if [ -n "${P2P_TCP_LISTEN_ADDR:-}" ]; then
P2P_TCP_PORT=${P2P_TCP_LISTEN_ADDR#*:}
arg_port_assignment+=" -p $P2P_TCP_PORT:$P2P_TCP_PORT "
fi

if [ -n "${P2P_UDP_LISTEN_ADDR:-}" ]; then
P2P_UDP_PORT=${P2P_UDP_LISTEN_ADDR#*:}
arg_port_assignment+=" -p $P2P_UDP_PORT:$P2P_UDP_PORT/udp "
if [ -n "${PORTS_TO_EXPOSE:-}" ]; then
for port in ${PORTS_TO_EXPOSE}; do
arg_port_assignment+=" -p $port "
done
fi

# For debugging the aztec-up scripts, can be useful to mount local code into container.
Expand Down
33 changes: 31 additions & 2 deletions aztec-up/bin/aztec
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ while [ "$#" -gt 0 ]; do
AZTEC_PORT="$2"
shift 2
;;
-a | --anvil-port)
# Override default port exposed on container.
ANVIL_PORT="$2"
shift 2
;;
--pxe.network)
# Set version to user-specified network (e.g. 'devnet')
VERSION="$2"
Expand Down Expand Up @@ -49,8 +54,11 @@ case ${1:-} in
;;
start)
export ENV_VARS_TO_INJECT="$(get_env_vars)"
# Opens the requested port on the container.
export AZTEC_PORT=${AZTEC_PORT:-8080}

# Dynamic port assignments, .aztec-run will expose the array PORTS_TO_EXPOSE as a space-separated string.
AZTEC_PORT=${AZTEC_PORT:-8080}
export PORTS_TO_EXPOSE="$AZTEC_PORT:$AZTEC_PORT"

if [ "${2:-}" == "--sandbox" ]; then
# TODO: This entire special case should go away.
# Sandbox mode should start it's own anvil.
Expand All @@ -67,11 +75,32 @@ case ${1:-} in
export ARCHIVER_VIEM_POLLING_INTERVAL_MS=500
export TEST_ACCOUNTS=${TEST_ACCOUNTS:-true}
export LOG_LEVEL=${LOG_LEVEL:-info}

ANVIL_PORT=${ANVIL_PORT:-8545}
anvil_port_assignment="$ANVIL_PORT:8545"

PORTS_TO_EXPOSE="${PORTS_TO_EXPOSE:-} $anvil_port_assignment"

exec $(dirname $0)/.aztec-run aztec-sandbox bash -c "
anvil --host 0.0.0.0 --silent &
node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js start --sandbox
"
else
# Export p2p port forwarding only if set in env vars
if [ -n "${P2P_TCP_LISTEN_ADDR:-}" ]; then
P2P_TCP_PORT=${P2P_TCP_LISTEN_ADDR##*:}
P2P_TCP_LISTEN_MAPPING="$P2P_TCP_PORT:$P2P_TCP_PORT"

PORTS_TO_EXPOSE="${PORTS_TO_EXPOSE:-} $P2P_TCP_LISTEN_MAPPING"
fi

if [ -n "${P2P_UDP_LISTEN_ADDR:-}" ]; then
P2P_UDP_PORT=${P2P_UDP_LISTEN_ADDR##*:}
P2P_UDP_LISTEN_MAPPING="$P2P_UDP_PORT:$P2P_UDP_PORT/udp"

PORTS_TO_EXPOSE="${PORTS_TO_EXPOSE:-} $P2P_UDP_LISTEN_MAPPING"
fi

exec $(dirname $0)/.aztec-run aztec-start \
node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js "$@"
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,19 @@ For a quick start, follow the [guide](../../getting_started.md) to install the s

There are various environment variables you can use when running the whole sandbox or when running on of the available modes.

To change them, you can open `~/.aztec/docker-compose.sandbox.yml` and edit them directly.
Copy link
Member Author

Choose a reason for hiding this comment

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

removed as this no longer exists


**Sandbox**

```sh
LOG_LEVEL=debug # Options are 'fatal', 'error', 'warn', 'info', 'verbose', 'debug', 'trace'
HOST_WORKDIR='${PWD}' # The location to store log outputs. Will use ~/.aztec where the docker-compose.yml file is stored by default.
ETHEREUM_HOSTS=http://ethereum:8545 # List of Ethereum JSON RPC URLs. We use an anvil instance that runs in parallel to the sandbox on docker by default.
ETHEREUM_HOSTS=http://127.0.0.1:8545 # List of Ethereum JSON RPC URLs. We use an anvil instance that runs in parallel to the sandbox on docker by default.
ANVIL_PORT=8545 # The port that docker will forward to the anvil instance (default: 8545)
L1_CHAIN_ID=31337 # The Chain ID that the Ethereum host is using.
TEST_ACCOUNTS='true' # Option to deploy 3 test account when sandbox starts. (default: true)
MODE='sandbox' # Option to start the sandbox or a standalone part of the system. (default: sandbox)
PXE_PORT=8080 # The port that the PXE will be listening to (default: 8080)
AZTEC_NODE_PORT=8080 # The port that Aztec Node will be listening to (default: 8080)

# Ethereum Forking (Optional: not enabled by default) #
FORK_BLOCK_NUMBER=0 # The block number to fork from
Copy link
Member Author

Choose a reason for hiding this comment

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

Removed as this usecase is not currently supported - #12600 created to track

FORK_URL="" # The URL of the Ethereum node to fork from

## Polling intervals ##
ARCHIVER_POLLING_INTERVAL_MS=50
P2P_BLOCK_CHECK_INTERVAL_MS=50
Expand Down