Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
charlielye committed Dec 8, 2023
1 parent c7f1878 commit 0364914
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 21 deletions.
18 changes: 14 additions & 4 deletions aztec-up/bin/aztec-sandbox
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
#!/bin/bash
set -euo pipefail

# Change working dir, so relative volume mounts are in the right place.
cd ~/.aztec

# Favour 'docker compose', falling back on docker-compose.
CMD="docker compose"
$CMD &>/dev/null || CMD="docker-compose"

$CMD -f ~/.aztec/bin/docker-compose.yml up
ARGS="-f $HOME/.aztec/bin/docker-compose.yml -p sandbox"

# Function to be executed when SIGINT is received.
cleanup() {
$CMD $ARGS down
}

# Set trap to catch SIGINT and call the cleanup function.
trap cleanup SIGINT

# Change working dir, so relative volume mounts are in the right place.
cd ~/.aztec

$CMD $ARGS up --force-recreate --remove-orphans
31 changes: 16 additions & 15 deletions aztec-up/bin/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
version: '3'
version: "3"
services:
ethereum:
image: ghcr.io/foundry-rs/foundry@sha256:29ba6e34379e79c342ec02d437beb7929c9e254261e8032b17e187be71a2609f
entrypoint: >
sh -c '
if [ -n "$FORK_BLOCK_NUMBER" ] && [ -n "$FORK_URL" ]; then
exec anvil -p 8545 --host 0.0.0.0 --chain-id 31337 --silent --fork-url "$FORK_URL" --fork-block-number "$FORK_BLOCK_NUMBER"
elif [ -n "$FORK_URL" ]; then
exec anvil -p 8545 --host 0.0.0.0 --chain-id 31337 --silent --fork-url "$FORK_URL"
else
exec anvil -p 8545 --host 0.0.0.0 --chain-id 31337 --silent
fi'
command: >
'
[ -n "$$FORK_URL" ] && ARGS="$$ARGS --fork-url $$FORK_URL";
[ -n "$$FORK_BLOCK_NUMBER" ] && ARGS="$$ARGS --fork-block-number $$FORK_BLOCK_NUMBER";
echo anvil -p 8545 --host 0.0.0.0 --chain-id 31337 --silent $$ARGS;
anvil -p 8545 --host 0.0.0.0 --chain-id 31337 --silent $$ARGS
'
ports:
- '${SANDBOX_ANVIL_PORT:-8545}:8545'
- "${SANDBOX_ANVIL_PORT:-8545}:8545"
environment:
FORK_URL:
FORK_BLOCK_NUMBER:

aztec:
image: 'aztecprotocol/aztec-sandbox'
image: "aztecprotocol/aztec-sandbox"
ports:
- '${SANDBOX_AZTEC_NODE_PORT:-8079}:8079'
- '${SANDBOX_PXE_PORT:-8080}:8080'
- "${SANDBOX_AZTEC_NODE_PORT:-8079}:8079"
- "${SANDBOX_PXE_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
HOST_WORKDIR: "${PWD}" # Loaded from the user shell to show log files absolute path in host
ETHEREUM_HOST: http://ethereum:8545
CHAIN_ID: 31337
ARCHIVER_POLLING_INTERVAL_MS: 50
Expand Down
7 changes: 6 additions & 1 deletion build-system/scripts/cond_spot_run_script
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ CPUS=$2
ARCH=$3
shift 3

BASE_TAG=$(calculate_image_tag $REPOSITORY)
MULTIARCH=$(query_manifest multiarch $REPOSITORY)
if [ "$MULTIARCH" == "host" ];
BASE_TAG=$(calculate_image_tag $REPOSITORY $ARCH)
else
BASE_TAG=$(calculate_image_tag $REPOSITORY)
fi
SUCCESS_TAG=$BASE_TAG

if [ -n "${TAG_POSTFIX:-}" ]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function addNoirCompilerCommanderActions(program: Command, log: LogFn = (
.option('-o, --outdir <path>', 'Output folder for the binary artifacts, relative to the project path', 'target')
.option('-ts, --typescript <path>', 'Optional output folder for generating typescript wrappers', undefined)
.option('-i, --interface <path>', 'Optional output folder for generating an Aztec.nr contract interface', undefined)
.option('-c --compiler <string>', 'Which compiler to use. Either nargo or wasm. Defaults to nargo', 'wasm')
.option('-c --compiler <string>', 'Which compiler to use. Either nargo or wasm.', 'wasm')
.description('Compiles the Noir Source in the target project')

.action(async (projectPath: string, options: Options) => {
Expand Down

0 comments on commit 0364914

Please sign in to comment.