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

fix(docs): Update sandbox reference #6094

Merged
merged 8 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
4 changes: 3 additions & 1 deletion aztec-up/bin/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -32,5 +32,7 @@ services:
PXE_BLOCK_POLLING_INTERVAL_MS: 50
ARCHIVER_VIEM_POLLING_INTERVAL_MS: 500
PXE_PORT: ${PXE_PORT:-8080}
PORT: ${SANDBOX_PORT:-8080}
Copy link
Contributor

Choose a reason for hiding this comment

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

Should PXE_PORT and PORT default to the same thing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

they do currently so yes

TEST_ACCOUNTS: ${TEST_ACCOUNTS:-true}
volumes:
- ./log:/usr/src/yarn-project/aztec/log:rw
Original file line number Diff line number Diff line change
Expand Up @@ -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).


34 changes: 18 additions & 16 deletions docs/docs/developers/sandbox/references/sandbox-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,35 +61,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)
SANDBOX_PORT=8080 # The port that Aztec Sandbox wil be listening to (default: 8080)
Copy link
Contributor

Choose a reason for hiding this comment

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

Are PXE_PORT and SANDBOX_PORT the same thing? Or is SANDBOX_PORT replacing AZTEC_NODE_PORT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PXE_PORT is a different thing - if you just run the sandbox theyre run on the same port, but you can run the sandbox and another PXE separately

AZTEC_NODE_PORT env var was removed a while back for some reason, but youre right in that this naming makes more sense so Ive changed SANDBOX_PORT to AZTEC_NODE_PORT


# Ethereum Forking (Optional: not enabled by default) #
FORK_BLOCK_NUMBER=0 # The block number to fork from
Expand Down Expand Up @@ -142,7 +132,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)
Expand Down Expand Up @@ -177,24 +166,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
Expand Down
Loading