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: merge devnet chagnes to master #7822

Merged
merged 192 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from 191 commits
Commits
Show all changes
192 commits
Select commit Hold shift + click to select a range
3b3954d
Initial metrics deployment
PhilWindle Jul 24, 2024
c0e609d
Fixes
PhilWindle Jul 24, 2024
0e04caf
Always build
PhilWindle Jul 24, 2024
6d552e9
Moved terraform
PhilWindle Jul 24, 2024
4600367
Fixed spelling
PhilWindle Jul 24, 2024
2f4411d
Attempted fix
PhilWindle Jul 24, 2024
06f527a
Re-instate diff check
PhilWindle Jul 24, 2024
229ebb2
Attempt grafana
PhilWindle Jul 24, 2024
0bbf42a
feat: devnet release (#7593)
alexghr Jul 24, 2024
fd59b19
ci: fix env var
alexghr Jul 24, 2024
3513334
Inject secrets through TF
PhilWindle Jul 24, 2024
7756ab3
Merge branch 'devnet' of github.com:AztecProtocol/aztec-packages into…
PhilWindle Jul 24, 2024
426313a
TF Fix
PhilWindle Jul 24, 2024
7f05bc3
More fixes
PhilWindle Jul 24, 2024
e9356b8
Fixed grafana TF
PhilWindle Jul 24, 2024
283c866
fix: recreate mount points
alexghr Jul 24, 2024
2dc9763
Otel config
PhilWindle Jul 24, 2024
17f50b6
Merge branch 'devnet' of github.com:AztecProtocol/aztec-packages into…
PhilWindle Jul 24, 2024
aae287f
Grafana updates
PhilWindle Jul 24, 2024
b0fbb8e
Updated node config
PhilWindle Jul 24, 2024
e97b7ce
Removed USER directive
PhilWindle Jul 24, 2024
af35f36
Don't deploy mainet fork
PhilWindle Jul 24, 2024
988882d
Comment
PhilWindle Jul 24, 2024
0931bd7
DNS fix
PhilWindle Jul 24, 2024
b9345ea
Revert change
PhilWindle Jul 24, 2024
e776f03
Only 1 sequencer
PhilWindle Jul 24, 2024
231a344
fix: correctly serialize contract addresses
alexghr Jul 25, 2024
4b26848
fix: don't destroy mainnet-fork
alexghr Jul 25, 2024
b3ce684
ci: skip rebuilding aztec image
alexghr Jul 25, 2024
0673ff1
ci: add logging
alexghr Jul 25, 2024
7866135
fix: exclude emty lines from build check
alexghr Jul 25, 2024
c278e8a
ci: recreate mountpoints
alexghr Jul 25, 2024
71ec387
ci: recreate efs
alexghr Jul 25, 2024
e5df449
fix: log json correctly
alexghr Jul 25, 2024
1c288d6
Fixes
PhilWindle Jul 25, 2024
15c789a
Merge branch 'devnet' of github.com:AztecProtocol/aztec-packages into…
PhilWindle Jul 25, 2024
26276a3
fix: skip build if only tf files have changed
alexghr Jul 25, 2024
06fab9d
Fixes
PhilWindle Jul 25, 2024
b1cdb76
Merge branch 'devnet' of github.com:AztecProtocol/aztec-packages into…
PhilWindle Jul 25, 2024
347489b
chore: enable debug logging in otel
alexghr Jul 25, 2024
d1e8fd2
fix: specify endpoint
alexghr Jul 25, 2024
3ae0b7e
Deploy latest metrics
PhilWindle Jul 25, 2024
5e037eb
Merge branch 'devnet' of github.com:AztecProtocol/aztec-packages into…
PhilWindle Jul 25, 2024
29f3edb
fix: remove http://
alexghr Jul 25, 2024
163ae48
fix: add otel logging
alexghr Jul 25, 2024
bb99244
fix: only deploy metrics if changed
alexghr Jul 25, 2024
389eb52
Merge remote-tracking branch 'origin/master' into devnet
alexghr Jul 25, 2024
94b1c49
fix: add more logging
alexghr Jul 25, 2024
cc17cbe
Deploy latest images
PhilWindle Jul 25, 2024
7e9a579
Merge branch 'devnet' of github.com:AztecProtocol/aztec-packages into…
PhilWindle Jul 25, 2024
24d5dee
fix: exit early
alexghr Jul 25, 2024
413049e
Force a rebuild
PhilWindle Jul 25, 2024
0963404
chore: logging
alexghr Jul 25, 2024
44e7c8e
Merge branch 'master' into devnet
PhilWindle Jul 25, 2024
59a721e
Attempt to enable proving
PhilWindle Jul 25, 2024
8041cf6
Fixes
PhilWindle Jul 25, 2024
ff5a1e4
Fixes
PhilWindle Jul 25, 2024
dec7c9a
Merge branch 'master' into devnet
PhilWindle Jul 25, 2024
142e863
fix: faucet deploy
alexghr Jul 26, 2024
4877a24
Merge branch 'devnet' of github.com:AztecProtocol/aztec-packages into…
PhilWindle Jul 26, 2024
3238e91
TF Fix
PhilWindle Jul 26, 2024
65c3bb8
Fix retagging
PhilWindle Jul 26, 2024
5091deb
Default faucet private key
PhilWindle Jul 26, 2024
c4b4442
Try and fix faucet
PhilWindle Jul 26, 2024
91d3ba8
Forgot previous file
PhilWindle Jul 26, 2024
9f98b45
fix: fund fpc
alexghr Jul 26, 2024
590a6a8
fix: number to string
alexghr Jul 26, 2024
b7e641f
Revert "fix: fund fpc"
alexghr Jul 26, 2024
c3256b9
fix: build aztec-faucet
alexghr Jul 26, 2024
838bbf9
Reapply "fix: fund fpc"
alexghr Jul 26, 2024
52028e1
Bot TF fix
PhilWindle Jul 26, 2024
c9bed7b
Merge branch 'master' into devnet
PhilWindle Jul 26, 2024
e304d64
Use EC2 instances as prover agents
PhilWindle Jul 29, 2024
565a82d
Comment
PhilWindle Jul 29, 2024
54fb8e7
Updated config
PhilWindle Jul 29, 2024
9d80ef6
Updated devnet config
PhilWindle Jul 29, 2024
5004bf1
TF changes
PhilWindle Jul 29, 2024
f5b2156
Merge branch 'master' into devnet
PhilWindle Jul 29, 2024
25f5fda
Merge fix
PhilWindle Jul 29, 2024
34bba71
Use spot instances
PhilWindle Jul 29, 2024
dea4526
Bot TF fix and wait for PXE
PhilWindle Jul 29, 2024
7c2122b
Use efs to store data in node
PhilWindle Jul 29, 2024
a063d51
Alter machine specs
PhilWindle Jul 30, 2024
54ed386
feat: devnet smoke test (#7629)
alexghr Jul 30, 2024
61b1d67
Merge branch 'master' into devnet
PhilWindle Jul 30, 2024
3de6138
Updated configuration
PhilWindle Jul 30, 2024
90c9fb2
Merge branch 'devnet' of github.com:AztecProtocol/aztec-packages into…
PhilWindle Jul 30, 2024
fb59d8e
Disable bot before deployment
PhilWindle Jul 30, 2024
6371972
Merge branch 'master' into devnet
PhilWindle Jul 30, 2024
979aa17
Add log level to node config
PhilWindle Jul 30, 2024
de4c808
Config updates
PhilWindle Jul 30, 2024
bb7af58
Config change
PhilWindle Jul 31, 2024
07347f8
Another minor config change
PhilWindle Jul 31, 2024
e5d44fe
fix: disable devnet tests in normal ci
alexghr Jul 31, 2024
0bd5a14
Updated bot config
PhilWindle Jul 31, 2024
258cf5e
Merge branch 'devnet' of github.com:AztecProtocol/aztec-packages into…
PhilWindle Jul 31, 2024
12082f5
chore: Fix the output of network bootstrapping (#7691)
PhilWindle Jul 31, 2024
a6c94ca
feat: devnet metrics (#7687)
alexghr Jul 31, 2024
467693c
Merge branch 'master' into devnet
PhilWindle Jul 31, 2024
f328701
chore: update txe tsconfig
alexghr Jul 31, 2024
9feb488
Build fix
PhilWindle Jul 31, 2024
7bdd3fd
Merge branch 'devnet' of github.com:AztecProtocol/aztec-packages into…
PhilWindle Jul 31, 2024
434a4fe
Trigger rebuild
PhilWindle Jul 31, 2024
71e2736
fix: serialize empty tube proof
alexghr Jul 31, 2024
26cec69
fix: try/catch
alexghr Jul 31, 2024
eabafa2
feat: Configure bot to run a local PXE (#7700)
PhilWindle Jul 31, 2024
3a86a9d
feat: Don't wait for transaction if configured not to do so. (#7697)
PhilWindle Jul 31, 2024
913b99b
Merge branch 'master' into devnet
spypsy Jul 31, 2024
b3e9a83
fix: serialize new class
alexghr Jul 31, 2024
0a780e5
Upgrade grafana
PhilWindle Jul 31, 2024
2d1432f
Updated deployment file
PhilWindle Aug 1, 2024
d01f22e
More env var work
PhilWindle Aug 1, 2024
0f671b6
Debugging
PhilWindle Aug 1, 2024
809ca7e
More debugging
PhilWindle Aug 1, 2024
6ef8550
Debugging
PhilWindle Aug 1, 2024
12ff3fa
Syntax
PhilWindle Aug 1, 2024
ac8c45b
Fix API_KEY
PhilWindle Aug 1, 2024
0b1f303
Debugging
PhilWindle Aug 1, 2024
e82383b
feat: aztec start --pxe network=devnet (#7705)
spypsy Aug 1, 2024
67eb953
Another attempt
PhilWindle Aug 1, 2024
abcdf42
Merge branch 'devnet' of github.com:AztecProtocol/aztec-packages into…
PhilWindle Aug 1, 2024
45fafc3
Try again
PhilWindle Aug 1, 2024
907e167
Use Vars
PhilWindle Aug 1, 2024
916ec4c
Try again
PhilWindle Aug 1, 2024
710977e
Another attempt
PhilWindle Aug 1, 2024
7b7d7c5
Debug
PhilWindle Aug 1, 2024
8c3871d
Another attempt
PhilWindle Aug 1, 2024
b634c4f
Fix
PhilWindle Aug 1, 2024
bbf554b
Set TF_VAR_DEPLOY_TAG
PhilWindle Aug 1, 2024
043e315
feat: Scale bots using spot instances (#7716)
PhilWindle Aug 1, 2024
5409f49
chore: More fixes for the transaction bot (#7714)
PhilWindle Aug 1, 2024
a0cfc9b
Merge branch 'master' into devnet
PhilWindle Aug 1, 2024
b1cea64
Bot config updates
PhilWindle Aug 2, 2024
6a800eb
Fixed bot config
PhilWindle Aug 2, 2024
b13c620
Minor bot fix
PhilWindle Aug 2, 2024
2916f88
Deployment config updates
PhilWindle Aug 2, 2024
0e96e09
Check branch name for deployment
PhilWindle Aug 2, 2024
f7f7c5e
feat: more metrics (#7739)
alexghr Aug 2, 2024
0157a39
Re-instate on push
PhilWindle Aug 2, 2024
398921e
Merge branch 'devnet' of github.com:AztecProtocol/aztec-packages into…
PhilWindle Aug 2, 2024
e54cd55
Increase bot tx interval
PhilWindle Aug 2, 2024
3a4a936
Trigger rebuild
PhilWindle Aug 2, 2024
7a82bf1
Updated deployment config
PhilWindle Aug 2, 2024
324ddf1
fix: set network id (#7746)
alexghr Aug 2, 2024
d5f2405
Changed bot config
PhilWindle Aug 2, 2024
9d00b6c
fix: tf encode
alexghr Aug 2, 2024
54a4954
fix: tf encode v2
alexghr Aug 2, 2024
ff0d12a
chore: Cleanup network api key configuration (#7766)
PhilWindle Aug 5, 2024
758a7b0
Another attempt
PhilWindle Aug 5, 2024
d8db1e1
And another
PhilWindle Aug 5, 2024
28eaf3f
Fixed
PhilWindle Aug 5, 2024
7e40dc6
Merge branch 'master' into alphanet
PhilWindle Aug 5, 2024
5385ca0
Merge fixes
PhilWindle Aug 5, 2024
5dd3cb5
Multi-build
PhilWindle Aug 5, 2024
bb95967
Force build
PhilWindle Aug 5, 2024
377503f
Build again
PhilWindle Aug 5, 2024
2b8f496
Force build again
PhilWindle Aug 5, 2024
d6d83e5
Config updates
PhilWindle Aug 5, 2024
d9b10e0
Disable cli wallet
PhilWindle Aug 5, 2024
09c8737
Fix
PhilWindle Aug 5, 2024
48bec66
FIx fork
PhilWindle Aug 5, 2024
e338675
Fix
PhilWindle Aug 5, 2024
711394c
More config
PhilWindle Aug 5, 2024
a8f38c3
More fixes
PhilWindle Aug 5, 2024
2d0c127
More fixes
PhilWindle Aug 5, 2024
1bfb2cb
Config updates and build nargo
PhilWindle Aug 6, 2024
8bb0689
Fixed aztec nargo
PhilWindle Aug 6, 2024
82a6c71
Updated bot config
PhilWindle Aug 6, 2024
ba0114b
fix: prover agent more logging (#7752)
alexghr Aug 6, 2024
2ee3353
feat: Config consolidation & CLI namespaced options (#7781)
spypsy Aug 6, 2024
5eb45ef
fix: call command requires wallet (#7747)
alexghr Aug 6, 2024
f9d6804
fix: Parse numerical CLI options (#7805)
spypsy Aug 7, 2024
4bb38e0
Try and speed up build
PhilWindle Aug 7, 2024
6572378
Merge branch 'alphanet' of github.com:AztecProtocol/aztec-packages in…
PhilWindle Aug 7, 2024
db29e66
Try and force build
PhilWindle Aug 7, 2024
f7f04e8
Increase prover count on prover net
PhilWindle Aug 7, 2024
048a085
feat: more metrics (#7769)
alexghr Aug 7, 2024
faf2ab4
fix: parse ENV variable values (#7809)
spypsy Aug 7, 2024
e83f5ae
fix: p2pEnabled option source (#7810)
spypsy Aug 7, 2024
fca0d12
fix: bot nodeUrl (#7811)
spypsy Aug 7, 2024
215b2c3
fix: prover agents (#7812)
alexghr Aug 7, 2024
f93f0f1
Fix typo
spypsy Aug 7, 2024
16be480
fix ifs
spypsy Aug 7, 2024
7baf6f8
fix: provide all PXE options + fix node telemetry (#7814)
spypsy Aug 7, 2024
05d4f15
fix: scripts
alexghr Aug 7, 2024
bcddebd
Merge branch 'master' into ag/merge-to-master
alexghr Aug 7, 2024
6eed63a
chore: conflicts
alexghr Aug 7, 2024
438b69d
fix: pass env vars
alexghr Aug 7, 2024
65b8b36
Merge branch 'master' into ag/merge-to-master
spypsy Aug 8, 2024
7e1fd40
update env_var
spypsy Aug 8, 2024
e1dfbbf
update l1RpcUrl
spypsy Aug 8, 2024
86cb878
Remove autoscaling operation
PhilWindle Aug 7, 2024
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
62 changes: 28 additions & 34 deletions .github/workflows/devnet-deploys.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
setup:
uses: ./.github/workflows/setup-runner.yml
with:
username: master
username: ${{ github.actor }}
runner_type: builder-x86
secrets: inherit

Expand All @@ -99,7 +99,6 @@ jobs:
pxe_lb_priority_range_start: ${{ steps.set_network_vars.outputs.pxe_lb_priority_range_start }}
faucet_lb_priority: ${{ steps.set_network_vars.outputs.faucet_lb_priority }}
bot_no_wait: ${{ steps.set_network_vars.outputs.bot_no_wait }}
max_txs_per_block: ${{ steps.set_network_vars.outputs.max_txs_per_block }}
steps:
- name: Set network vars
shell: bash
Expand All @@ -119,21 +118,19 @@ jobs:
echo "pxe_lb_priority_range_start=5100" >> $GITHUB_OUTPUT
echo "faucet_lb_priority=601" >> $GITHUB_OUTPUT
echo "bot_no_wait=false" >> $GITHUB_OUTPUT
echo "max_txs_per_block=64" >> $GITHUB_OUTPUT
elif [ "$BRANCH_NAME" = "provernet" ]
then
echo "deploy_tag=provernet" >> $GITHUB_OUTPUT
echo "branch_name=provernet" >> $GITHUB_OUTPUT
echo "network_api_key=PROVERNET_API_KEY" >> $GITHUB_OUTPUT
echo "agents_per_prover=2" >> $GITHUB_OUTPUT
echo "agents_per_prover=4" >> $GITHUB_OUTPUT
echo "bot_interval=300" >> $GITHUB_OUTPUT
echo "node_tcp_range_start=40200" >> $GITHUB_OUTPUT
echo "node_udp_range_start=45200" >> $GITHUB_OUTPUT
echo "node_lb_priority_range_start=4200" >> $GITHUB_OUTPUT
echo "pxe_lb_priority_range_start=5200" >> $GITHUB_OUTPUT
echo "faucet_lb_priority=602" >> $GITHUB_OUTPUT
echo "bot_no_wait=true" >> $GITHUB_OUTPUT
echo "max_txs_per_block=4" >> $GITHUB_OUTPUT
elif [ "$BRANCH_NAME" = "alphanet" ]
then
echo "deploy_tag=alphanet" >> $GITHUB_OUTPUT
Expand All @@ -147,7 +144,6 @@ jobs:
echo "pxe_lb_priority_range_start=5000" >> $GITHUB_OUTPUT
echo "faucet_lb_priority=600" >> $GITHUB_OUTPUT
echo "bot_no_wait=false" >> $GITHUB_OUTPUT
echo "max_txs_per_block=64" >> $GITHUB_OUTPUT
else
echo "Unrecognized Branch!!"
exit 1
Expand Down Expand Up @@ -190,31 +186,6 @@ jobs:
earthly-ci \
--no-output --push ./iac/mainnet-fork+export-mainnet-fork --DIST_TAG=${{ env.DEPLOY_TAG }}

build-aztec-nargo:
needs: set-network
env:
BRANCH_NAME: ${{ needs.set-network.outputs.branch_name }}
DEPLOY_TAG: ${{ needs.set-network.outputs.deploy_tag }}
TF_VAR_DEPLOY_TAG: ${{ needs.set-network.outputs.deploy_tag }}
API_KEY: ${{ secrets[needs.set-network.outputs.network_api_key] }}
TF_VAR_API_KEY: ${{ secrets[needs.set-network.outputs.network_api_key] }}
API_KEY_NAME: ${{ needs.set-network.outputs.network_api_key }}
runs-on: ${{ github.actor }}-x86
steps:
- uses: actions/checkout@v4
with:
ref: "${{ env.GIT_COMMIT }}"
fetch-depth: 0
- uses: ./.github/ci-setup-action
with:
concurrency_key: build-aztec-nargo-${{ github.actor }}
dockerhub_password: "${{ env.DOCKERHUB_PASSWORD }}"

- name: Build & push aztec nargo image
run: |
earthly-ci --no-output --push ./aztec-nargo+export-aztec-nargo --DIST_TAG=${{ env.DEPLOY_TAG }}
earthly-ci --no-output --push ./aztec-nargo+export-aztec-nargo --DIST_TAG=${{ github.sha }}

build-aztec:
needs: set-network
env:
Expand Down Expand Up @@ -268,8 +239,33 @@ jobs:

docker push aztecprotocol/aztec:${{ github.sha }}

build-aztec-nargo:
needs: [set-network, build-aztec]
env:
BRANCH_NAME: ${{ needs.set-network.outputs.branch_name }}
DEPLOY_TAG: ${{ needs.set-network.outputs.deploy_tag }}
TF_VAR_DEPLOY_TAG: ${{ needs.set-network.outputs.deploy_tag }}
API_KEY: ${{ secrets[needs.set-network.outputs.network_api_key] }}
TF_VAR_API_KEY: ${{ secrets[needs.set-network.outputs.network_api_key] }}
API_KEY_NAME: ${{ needs.set-network.outputs.network_api_key }}
runs-on: ${{ github.actor }}-x86
steps:
- uses: actions/checkout@v4
with:
ref: "${{ env.GIT_COMMIT }}"
fetch-depth: 0
- uses: ./.github/ci-setup-action
with:
concurrency_key: build-aztec-nargo-${{ github.actor }}
dockerhub_password: "${{ env.DOCKERHUB_PASSWORD }}"

- name: Build & push aztec nargo image
run: |
earthly-ci --no-output --push ./aztec-nargo+export-aztec-nargo --DIST_TAG=${{ env.DEPLOY_TAG }}
earthly-ci --no-output --push ./aztec-nargo+export-aztec-nargo --DIST_TAG=${{ github.sha }}

build-faucet:
needs: set-network
needs: [set-network, build-aztec]
env:
BRANCH_NAME: ${{ needs.set-network.outputs.branch_name }}
DEPLOY_TAG: ${{ needs.set-network.outputs.deploy_tag }}
Expand Down Expand Up @@ -415,7 +411,6 @@ jobs:
TF_VAR_NODE_LB_RULE_PRIORITY: ${{ needs.set-network.outputs.node_lb_priority_range_start }}
TF_VAR_PXE_LB_RULE_PRIORITY: ${{ needs.set-network.outputs.pxe_lb_priority_range_start }}
TF_VAR_BOT_NO_WAIT_FOR_TRANSFERS: ${{ needs.set-network.outputs.bot_no_wait }}
TF_VAR_SEQ_MAX_TX_PER_BLOCK: ${{ needs.set-network.outputs.max_txs_per_block }}
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -616,7 +611,6 @@ jobs:
TF_VAR_NODE_LB_RULE_PRIORITY: ${{ needs.set-network.outputs.node_lb_priority_range_start }}
TF_VAR_PXE_LB_RULE_PRIORITY: ${{ needs.set-network.outputs.pxe_lb_priority_range_start }}
TF_VAR_BOT_NO_WAIT_FOR_TRANSFERS: ${{ needs.set-network.outputs.bot_no_wait }}
TF_VAR_SEQ_MAX_TX_PER_BLOCK: ${{ needs.set-network.outputs.max_txs_per_block }}
TF_VAR_PROVING_ENABLED: true
TF_VAR_BOT_NO_START: false
steps:
Expand Down
37 changes: 26 additions & 11 deletions aztec-up/bin/.aztec-run
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ shift
DEFAULT_PORT=8080
VERSION=${VERSION:-"latest"}
AZTEC_PORT=${AZTEC_PORT:-$DEFAULT_PORT}
INHERIT_USER=${INHERIT_USER:-1}

if [[ -n "${NETWORK:-}" ]]; then
VERSION=$NETWORK
# enable proving if connecting to a network by default
export PXE_PROVER_ENABLED=${PXE_PROVER_ENABLED:-1}
fi

# preserve arguments to pass to docker run
declare -a preserved_args
Expand Down Expand Up @@ -39,7 +46,7 @@ fi

# If running in rootless docker, don't set uid/gid in container, as it breaks the write perms to the home mount.
# Otherwise we set the uid/gid to be that of user running the container to ensure write perms to the home mount.
if [ -z "${ROOTLESS:-}" ]; then
if [[ -z "${ROOTLESS:-}" && "${INHERIT_USER:-}" == "1" ]]; then
DOCKER_USER="--user $(id -u):$(id -g)"
fi

Expand Down Expand Up @@ -73,16 +80,6 @@ for i in "${!args[@]}"; do
fi
done

DOCKER_ENV="-e HOME=$HOME"
for env in ${ENV_VARS_TO_INJECT:-}; do
if [ -n "${!env:-}" ]; then
# First substitute any reference to localhost with our host gateway.
env=${env//localhost/host.docker.internal}
# Inject into container.
DOCKER_ENV+=" -e $env=${!env:-}"
fi
done

# Parse command-line arguments
while [[ "$#" -gt 0 ]]; do
case $1 in
Expand All @@ -91,13 +88,31 @@ while [[ "$#" -gt 0 ]]; do
preserved_args+=("$1" "$2") # Store both argument and value
shift 2 # Move past argument and value
;;
--pxe.network)
VERSION="$2" # Set version to user-specified network (e.g. 'devnet')
echo "Using aztecprotocol/aztec: $VERSION"
preserved_args+=("$1" "$2") # Store both argument and value
# turn on proving if connecting to a network by default
export PXE_PROVER_ENABLED=${PXE_PROVER_ENABLED:-1}
shift 2
;; # Move past argument and value
*)
preserved_args+=("$1") # Store unrecognized/other arguments
shift # Move to next argument
;;
esac
done

DOCKER_ENV="-e HOME=$HOME"
for env in ${ENV_VARS_TO_INJECT:-}; do
if [ -n "${!env:-}" ]; then
# First substitute any reference to localhost with our host gateway.
env=${env//localhost/host.docker.internal}
# Inject into container.
DOCKER_ENV+=" -e $env=${!env:-}"
fi
done

# Dynamic port assignment
port_assignment=""
if [[ -z "${SKIP_PORT_ASSIGNMENT:-}" ]]; then
Expand Down
38 changes: 35 additions & 3 deletions aztec-up/bin/aztec
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
#!/usr/bin/env bash
set -euo pipefail

# Directory of env_var file
TS_ENV_VAR_FILE=/usr/src/yarn-project/foundation/src/config/env_var.ts
LOCAL_TS_FILE=./env_var.ts
NETWORK=${NETWORK:-}
VERSION=${VERSION:-${NETWORK:-"latest"}}
LOCAL_ENV_VAR_FILE="./.${VERSION}_aztec_cli_vars"

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

# Function to parse the TypeScript file
function parse_ts_file {
grep -oE "\| '[^']+'" "$LOCAL_TS_FILE" | sed "s/| '//; s/'//g" >"$LOCAL_ENV_VAR_FILE"
}

CALLED_FROM=$PWD

if [ "${1:-}" == "test" ]; then
Expand All @@ -24,17 +36,37 @@ elif [ $# == 2 ] && [ "$1" == "start" ] && [ "$2" == "--sandbox" ]; then
# Compose file to use
FILE_ARG="-f $HOME/.aztec/docker-compose.sandbox.yml"

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

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

get_compose -p sandbox $FILE_ARG up --force-recreate --remove-orphans
get_compose -p sandbox $FILE_ARG up --force-recreate --remove-orphans
elif [ "${1:-}" == "start" ]; then
$(dirname $0)/.aztec-run aztecprotocol/aztec "$@"
# export ENV_VARS_TO_INJECT=$(<.aztec_cli_vars)

# Grab env vars from aztec project
if [[ ! -f "$LOCAL_ENV_VAR_FILE" ]]; then
echo "No env vars file found, creating one..."
# Create temp container
temp_container_id=$(docker create aztecprotocol/aztec:$VERSION)
# Copy env vars file from container
docker cp ${temp_container_id}:$TS_ENV_VAR_FILE $LOCAL_TS_FILE &> /dev/null
# Remove temp container
docker rm $temp_container_id &> /dev/null

# Parse the TypeScript file
parse_ts_file
rm $LOCAL_TS_FILE
fi

# Read env vars from file
readarray -t ENV_VARS_TO_INJECT <"$LOCAL_ENV_VAR_FILE"
export ENV_VARS_TO_INJECT="${ENV_VARS_TO_INJECT[*]}"
ENV_VARS_TO_INJECT="${ENV_VARS_TO_INJECT[*]}" INHERIT_USER=0 $(dirname $0)/.aztec-run aztecprotocol/aztec "$@"
else
SKIP_PORT_ASSIGNMENT=1 $(dirname $0)/.aztec-run aztecprotocol/aztec "$@"
fi
31 changes: 16 additions & 15 deletions aztec-up/bin/aztec-install
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
set -euo pipefail

# Colors
g="\033[32m" # Green
y="\033[33m" # Yellow
b="\033[34m" # Blue
p="\033[35m" # Purple
r="\033[0m" # Reset
g="\033[32m" # Green
y="\033[33m" # Yellow
b="\033[34m" # Blue
p="\033[35m" # Purple
r="\033[0m" # Reset
bold="\033[1m"

# Function to replace characters and add color
function print_colored() {
local b=$'\033[34m' # Blue
local y=$'\033[33m' # Yellow
local r=$'\033[0m' # Reset
echo "$1" | sed -E "s/(█+)/${b}\1${y}/g"
local b=$'\033[34m' # Blue
local y=$'\033[33m' # Yellow
local r=$'\033[0m' # Reset
echo "$1" | sed -E "s/(█+)/${b}\1${y}/g"
}

function title() {
Expand All @@ -32,11 +32,11 @@ function title() {
echo
if [ "$(uname -s)" == "Darwin" ]; then
echo -e "${y}WARNING: For best performance we recommend adjusting your default docker settings:"
echo -e " - Under general, enable VirtioFS."
echo -e " - Under resources, set CPUs to ~80% your maximum."
echo -e " - Under resources, set Memory to ~80% your maximum."
echo -e "You may receive a warning about your home directory being mounted into a container."
echo -e "This is requested so we can read and write project files, that is all."
echo -e " - Under general, enable VirtioFS."
echo -e " - Under resources, set CPUs to ~80% your maximum."
echo -e " - Under resources, set Memory to ~80% your maximum."
echo -e "You may receive a warning about your home directory being mounted into a container."
echo -e "This is requested so we can read and write project files, that is all."
echo -e "${r}"
fi
echo -e "This will install the following scripts and update your PATH if necessary:"
Expand Down Expand Up @@ -126,6 +126,7 @@ install_bin aztec
install_bin aztec-up
install_bin aztec-nargo
install_bin aztec-wallet
install_bin .aztec_cli_vars

function update_path_env_var {
TARGET_DIR="${1}"
Expand Down Expand Up @@ -159,7 +160,7 @@ function update_path_env_var {
fi

# Add the target directory to the user's PATH in their profile.
echo "export PATH=\"\$PATH:$TARGET_DIR\"" >> "$SHELL_PROFILE"
echo "export PATH=\"\$PATH:$TARGET_DIR\"" >>"$SHELL_PROFILE"

if [ -z "${NON_INTERACTIVE:-}" ]; then
info "Done! Starting fresh shell..."
Expand Down
1 change: 1 addition & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"acir",
"acvm",
"addrs",
"alphanet",
"archiver",
"assignement",
"asyncify",
Expand Down
9 changes: 5 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ services:
PXE_DATA_DIRECTORY: /var/lib/aztec/pxe
NODE_NO_WARNINGS: 1
AZTEC_PORT: 8080
MNEMONIC: "test test test test test test test test test test test junk"
entrypoint: >
sh -c '
export AZTEC_NODE_URL=$$(cat /var/run/secrets/aztec-node-url);
Expand Down Expand Up @@ -61,7 +62,7 @@ services:
P2P_ENABLED: true
PEER_ID_PRIVATE_KEY:
AZTEC_PORT: 8999
TEL_COLLECTOR_BASE_URL: ${TEL_COLLECTOR_BASE_URL:-http://otel-collector:4318}
OTEL_EXPORTER_OTLP_ENDPOINT: ${OTEL_EXPORTER_OTLP_ENDPOINT:-http://otel-collector:4318}
secrets:
- ethereum-host
- p2p-boot-node
Expand All @@ -76,13 +77,13 @@ services:
# if the stack is started with --profile metrics --profile node, give the collector a chance to start before the node
i=0
max=3
while ! curl --head --silent $$TEL_COLLECTOR_BASE_URL > /dev/null; do
while ! curl --head --silent $$OTEL_EXPORTER_OTLP_ENDPOINT > /dev/null; do
echo "OpenTelemetry collector not up. Retrying after 1s";
sleep 1;
i=$$((i+1));
if [ $$i -eq $$max ]; then
echo "OpenTelemetry collector at $$TEL_COLLECTOR_BASE_URL not up after $${max}s. Running without metrics";
unset TEL_COLLECTOR_BASE_URL;
echo "OpenTelemetry collector at $$OTEL_EXPORTER_OTLP_ENDPOINT not up after $${max}s. Running without metrics";
unset OTEL_EXPORTER_OTLP_ENDPOINT;
break
fi;
done;
Expand Down
2 changes: 1 addition & 1 deletion iac/mainnet-fork/redeploy
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3
3
Loading
Loading