From 06410858fd1b6d0d8a1c225a08b8c6628ad9ddcc Mon Sep 17 00:00:00 2001 From: Cat McGee Date: Thu, 2 May 2024 13:46:44 +0100 Subject: [PATCH] fix(docs): Update sandbox reference (#6094) Closes https://github.com/AztecProtocol/aztec-packages/issues/4904 --- aztec-up/bin/docker-compose.yml | 4 ++- .../guides/run_more_than_one_pxe_sandbox.md | 16 ++++++++- .../sandbox/references/sandbox-reference.md | 34 ++++++++++--------- 3 files changed, 36 insertions(+), 18 deletions(-) diff --git a/aztec-up/bin/docker-compose.yml b/aztec-up/bin/docker-compose.yml index 7b3cab5e311..775454fc2d0 100644 --- a/aztec-up/bin/docker-compose.yml +++ b/aztec-up/bin/docker-compose.yml @@ -23,7 +23,7 @@ services: 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 - ETHEREUM_HOST: http://ethereum:${ANVIL_PORT:-8545} + ETHEREUM_HOST: ${ETHEREUM_HOST:-http://ethereum:${ANVIL_PORT:-8545}} CHAIN_ID: 31337 ARCHIVER_POLLING_INTERVAL_MS: 50 P2P_BLOCK_CHECK_INTERVAL_MS: 50 @@ -32,5 +32,7 @@ services: PXE_BLOCK_POLLING_INTERVAL_MS: 50 ARCHIVER_VIEM_POLLING_INTERVAL_MS: 500 PXE_PORT: ${PXE_PORT:-8080} + PORT: ${AZTEC_NODE_PORT:-8080} + TEST_ACCOUNTS: ${TEST_ACCOUNTS:-true} volumes: - ./log:/usr/src/yarn-project/aztec/log:rw diff --git a/docs/docs/developers/sandbox/guides/run_more_than_one_pxe_sandbox.md b/docs/docs/developers/sandbox/guides/run_more_than_one_pxe_sandbox.md index 7961f659f7a..59e3bcc3e7a 100644 --- a/docs/docs/developers/sandbox/guides/run_more_than_one_pxe_sandbox.md +++ b/docs/docs/developers/sandbox/guides/run_more_than_one_pxe_sandbox.md @@ -19,11 +19,25 @@ This removes any other arguments, allowing you to ensure an isolated environment In another terminal, run: ```bash -aztec start --pxe nodeUrl=http://aztec-aztec-1:8079 +aztec start --pxe nodeUrl=http://localhost:8080/ ``` This command uses the default ports, so they might need to be changed depending on yuor configuration. +You should see something like this: + +```bash + kv-store:lmdb Opening LMDB database at temporary location + kv-store:lmdb Opening LMDB database at temporary location + pxe_service Added contract ContractClassRegisterer at 0x030c6b23cf81a1c1387674e7d180ef04abc19387eb0ec71eea67c2b602b517b7 + pxe_service Added contract ContractInstanceDeployer at 0x2d8e7aedc70b65d49e6aa0794d8d12721896c177e87126701f6e60d184358e74 + pxe_service Added contract MultiCallEntrypoint at 0x0325a7874e168991a060b7f54e7324a42f87f48ffa592a903a5ce170b9d99e20 + pxe_service Added contract GasToken at 0x0f0be9c2e88fe0a7baa0823fbf7cfba98a6ba71558d6b5a4ee497e3b38f0aa7c + pxe_synchronizer Initial sync complete + pxe_service Started PXE connected to chain 31337 version 1 +Aztec Server listening on port 8080 +``` + You can learn more about custom commands in the [sandbox reference](../references/sandbox-reference.md). diff --git a/docs/docs/developers/sandbox/references/sandbox-reference.md b/docs/docs/developers/sandbox/references/sandbox-reference.md index 673ed6c4020..99e7850fb04 100644 --- a/docs/docs/developers/sandbox/references/sandbox-reference.md +++ b/docs/docs/developers/sandbox/references/sandbox-reference.md @@ -62,35 +62,25 @@ If you wish to run components of the Aztec network stack separately, you can use aztec start --node [nodeOptions] --pxe [pxeOptions] --archiver [archiverOptions] --sequencer [sequencerOptions] --prover [proverOptions] ----p2p-bootstrap [p2pOptions] ``` -Starting the aztec node alongside a PXE, sequencer or archiver, will attach the components to the node. If you want to e.g. run a PXE separately to a node, you can: -Start a node: - -```bash -aztec start --node [node] --archiver [archiverOptions] -``` - -Then start a PXE on a separate terminal that connects to that node: - -```bash -aztec start --pxe nodeUrl=http://localhost:8080 -``` +Starting the aztec node alongside a PXE, sequencer or archiver, will attach the components to the node.Eg if you want to run a PXE separately to a node, you can [read this guide](../guides/run_more_than_one_pxe_sandbox.md)/ ## Environment Variables 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.yml` and edit them directly. + **Sandbox** ```sh DEBUG=aztec:* # The level of debugging logs to be displayed. using "aztec:*" will log everything. -ETHEREUM_HOST=http://ethereum:8545 # The Ethereum JSON RPC URL. We use an anvil instance that runs in parallel to the sandbox on docker by default. HOST_WORKDIR='${PWD}' # The location to store log outpus. Will use ~/.aztec where the docker-compose.yml file is stored by default. +ETHEREUM_HOST=http://ethereum:8545 # The Ethereum JSON RPC URL. We use an anvil instance that runs in parallel to the sandbox on docker by default. 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) -DEPLOY_AZTEC_CONTRACTS='true' # Option to deploy the Aztec contracts when sandbox starts. (default: true) MODE='sandbox' # Option to start the sandbox or a standalone part of the system. (default: sandbox) -AZTEC_NODE_PORT=8079 # The port that the Aztec node wil be listening to (default: 8079) 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 @@ -143,7 +133,6 @@ SEQ_MIN_TX_PER_BLOCK=1 # Minimum txs to go on a block. (default: 1) **PXE** Variables like `TEST_ACCOUNTS` & `PXE_PORT` are valid here as described above. -`DEPLOY_AZTEC_CONTRACTS` cannot be used here as the PXE does not control an Ethereum account. ```sh AZTEC_NODE_URL='http://localhost:8079' # The address of an Aztec Node URL that the PXE will connect to (default: http://localhost:8079) @@ -178,24 +167,37 @@ You can find the cheat code reference [here](../../sandbox/references/cheat_code We have shipped a number of example contracts in the `@aztec/noir-contracts.js` [npm package](https://www.npmjs.com/package/@aztec/noir-contracts.js). This is included with the sandbox by default so you are able to use these contracts to test with. ```bash +AppSubscriptionContractArtifact +AuthContractArtifact BenchmarkingContractArtifact CardGameContractArtifact ChildContractArtifact +ClaimContractArtifact +ContractClassRegistererContractArtifact +ContractInstanceDeployerContractArtifact CounterContractArtifact +CrowdfundingContractArtifact +DelegatedOnContractArtifact +DelegatorContractArtifact DocsExampleContractArtifact EasyPrivateTokenContractArtifact EasyPrivateVotingContractArtifact EcdsaAccountContractArtifact EscrowContractArtifact +FPCContractArtifact +GasTokenContractArtifact ImportTestContractArtifact InclusionProofsContractArtifact LendingContractArtifact +MultiCallEntrypointContractArtifact ParentContractArtifact PendingNoteHashesContractArtifact PriceFeedContractArtifact +ReaderContractArtifact SchnorrAccountContractArtifact SchnorrHardcodedAccountContractArtifact SchnorrSingleKeyAccountContractArtifact +SlowTreeContractArtifact StatefulTestContractArtifact TestContractArtifact TokenBlacklistContractArtifact