@aztec/cli 4.0.0-nightly.20250907 → 4.0.0-nightly.20260107
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -428
- package/dest/cmds/aztec_node/block_number.d.ts +3 -0
- package/dest/cmds/aztec_node/block_number.d.ts.map +1 -0
- package/dest/cmds/aztec_node/block_number.js +10 -0
- package/dest/cmds/aztec_node/get_block.d.ts +3 -0
- package/dest/cmds/aztec_node/get_block.d.ts.map +1 -0
- package/dest/cmds/aztec_node/get_block.js +10 -0
- package/dest/cmds/aztec_node/get_current_base_fee.d.ts +3 -0
- package/dest/cmds/aztec_node/get_current_base_fee.d.ts.map +1 -0
- package/dest/cmds/aztec_node/get_current_base_fee.js +7 -0
- package/dest/cmds/aztec_node/get_l1_to_l2_message_witness.d.ts +5 -0
- package/dest/cmds/aztec_node/get_l1_to_l2_message_witness.d.ts.map +1 -0
- package/dest/cmds/aztec_node/get_l1_to_l2_message_witness.js +12 -0
- package/dest/cmds/aztec_node/get_logs.d.ts +7 -0
- package/dest/cmds/aztec_node/get_logs.d.ts.map +1 -0
- package/dest/cmds/{pxe → aztec_node}/get_logs.js +4 -4
- package/dest/cmds/aztec_node/get_node_info.d.ts +3 -0
- package/dest/cmds/aztec_node/get_node_info.d.ts.map +1 -0
- package/dest/cmds/{pxe → aztec_node}/get_node_info.js +3 -8
- package/dest/cmds/aztec_node/index.d.ts +4 -0
- package/dest/cmds/aztec_node/index.d.ts.map +1 -0
- package/dest/cmds/aztec_node/index.js +28 -0
- package/dest/cmds/contracts/index.d.ts +1 -1
- package/dest/cmds/contracts/inspect_contract.d.ts +1 -1
- package/dest/cmds/contracts/inspect_contract.d.ts.map +1 -1
- package/dest/cmds/contracts/inspect_contract.js +4 -10
- package/dest/cmds/contracts/parse_parameter_struct.d.ts +1 -1
- package/dest/cmds/infrastructure/index.d.ts +3 -3
- package/dest/cmds/infrastructure/index.d.ts.map +1 -1
- package/dest/cmds/infrastructure/index.js +7 -9
- package/dest/cmds/infrastructure/sequencers.d.ts +3 -5
- package/dest/cmds/infrastructure/sequencers.d.ts.map +1 -1
- package/dest/cmds/infrastructure/sequencers.js +15 -7
- package/dest/cmds/infrastructure/setup_l2_contract.d.ts +2 -2
- package/dest/cmds/infrastructure/setup_l2_contract.d.ts.map +1 -1
- package/dest/cmds/infrastructure/setup_l2_contract.js +10 -25
- package/dest/cmds/l1/advance_epoch.d.ts +2 -2
- package/dest/cmds/l1/advance_epoch.d.ts.map +1 -1
- package/dest/cmds/l1/advance_epoch.js +6 -5
- package/dest/cmds/l1/assume_proven_through.d.ts +2 -2
- package/dest/cmds/l1/assume_proven_through.d.ts.map +1 -1
- package/dest/cmds/l1/assume_proven_through.js +8 -6
- package/dest/cmds/l1/bridge_erc20.d.ts +2 -2
- package/dest/cmds/l1/bridge_erc20.d.ts.map +1 -1
- package/dest/cmds/l1/bridge_erc20.js +3 -2
- package/dest/cmds/l1/create_l1_account.d.ts +1 -1
- package/dest/cmds/l1/deploy_l1_contracts_cmd.d.ts +4 -0
- package/dest/cmds/l1/deploy_l1_contracts_cmd.d.ts.map +1 -0
- package/dest/cmds/l1/{deploy_l1_contracts.js → deploy_l1_contracts_cmd.js} +42 -7
- package/dest/cmds/l1/deploy_new_rollup.d.ts +4 -4
- package/dest/cmds/l1/deploy_new_rollup.d.ts.map +1 -1
- package/dest/cmds/l1/deploy_new_rollup.js +5 -5
- package/dest/cmds/l1/get_l1_addresses.d.ts +2 -2
- package/dest/cmds/l1/get_l1_addresses.d.ts.map +1 -1
- package/dest/cmds/l1/get_l1_addresses.js +5 -2
- package/dest/cmds/l1/get_l1_balance.d.ts +1 -1
- package/dest/cmds/l1/get_l1_balance.js +4 -2
- package/dest/cmds/l1/governance_utils.d.ts +5 -5
- package/dest/cmds/l1/governance_utils.d.ts.map +1 -1
- package/dest/cmds/l1/governance_utils.js +3 -1
- package/dest/cmds/l1/index.d.ts +1 -2
- package/dest/cmds/l1/index.d.ts.map +1 -1
- package/dest/cmds/l1/index.js +22 -36
- package/dest/cmds/l1/prover_stats.d.ts +1 -1
- package/dest/cmds/l1/prover_stats.d.ts.map +1 -1
- package/dest/cmds/l1/prover_stats.js +32 -30
- package/dest/cmds/l1/trigger_seed_snapshot.d.ts +2 -2
- package/dest/cmds/l1/trigger_seed_snapshot.d.ts.map +1 -1
- package/dest/cmds/l1/trigger_seed_snapshot.js +2 -1
- package/dest/cmds/l1/update_l1_validators.d.ts +10 -5
- package/dest/cmds/l1/update_l1_validators.d.ts.map +1 -1
- package/dest/cmds/l1/update_l1_validators.js +74 -9
- package/dest/cmds/misc/compute_selector.d.ts +1 -1
- package/dest/cmds/misc/example_contracts.d.ts +1 -1
- package/dest/cmds/misc/generate_bootnode_enr.d.ts +1 -1
- package/dest/cmds/misc/generate_p2p_private_key.d.ts +1 -1
- package/dest/cmds/misc/generate_secret_and_hash.d.ts +1 -1
- package/dest/cmds/misc/generate_secret_and_hash.js +2 -2
- package/dest/cmds/misc/generate_secret_key.d.ts +2 -2
- package/dest/cmds/misc/generate_secret_key.d.ts.map +1 -1
- package/dest/cmds/misc/generate_secret_key.js +1 -1
- package/dest/cmds/misc/get_canonical_sponsored_fpc_address.d.ts +1 -1
- package/dest/cmds/misc/index.d.ts +1 -1
- package/dest/cmds/misc/index.d.ts.map +1 -1
- package/dest/cmds/misc/index.js +1 -1
- package/dest/cmds/misc/update/common.d.ts +1 -1
- package/dest/cmds/misc/update/github.d.ts +1 -1
- package/dest/cmds/misc/update/noir.d.ts +1 -1
- package/dest/cmds/misc/update/npm.d.ts +1 -1
- package/dest/cmds/misc/update/npm.js +1 -1
- package/dest/cmds/misc/update/utils.d.ts +1 -1
- package/dest/cmds/misc/update.d.ts +1 -1
- package/dest/cmds/validator_keys/add.d.ts +5 -0
- package/dest/cmds/validator_keys/add.d.ts.map +1 -0
- package/dest/cmds/validator_keys/add.js +83 -0
- package/dest/cmds/validator_keys/generate_bls_keypair.d.ts +12 -0
- package/dest/cmds/validator_keys/generate_bls_keypair.d.ts.map +1 -0
- package/dest/cmds/validator_keys/generate_bls_keypair.js +27 -0
- package/dest/cmds/validator_keys/index.d.ts +4 -0
- package/dest/cmds/validator_keys/index.d.ts.map +1 -0
- package/dest/cmds/validator_keys/index.js +32 -0
- package/dest/cmds/validator_keys/new.d.ts +29 -0
- package/dest/cmds/validator_keys/new.d.ts.map +1 -0
- package/dest/cmds/validator_keys/new.js +134 -0
- package/dest/cmds/validator_keys/shared.d.ts +68 -0
- package/dest/cmds/validator_keys/shared.d.ts.map +1 -0
- package/dest/cmds/validator_keys/shared.js +274 -0
- package/dest/cmds/validator_keys/staker.d.ts +38 -0
- package/dest/cmds/validator_keys/staker.d.ts.map +1 -0
- package/dest/cmds/validator_keys/staker.js +210 -0
- package/dest/cmds/validator_keys/utils.d.ts +25 -0
- package/dest/cmds/validator_keys/utils.d.ts.map +1 -0
- package/dest/cmds/validator_keys/utils.js +52 -0
- package/dest/config/cached_fetch.d.ts +18 -0
- package/dest/config/cached_fetch.d.ts.map +1 -0
- package/dest/config/cached_fetch.js +54 -0
- package/dest/config/chain_l2_config.d.ts +41 -0
- package/dest/config/chain_l2_config.d.ts.map +1 -0
- package/dest/config/chain_l2_config.js +524 -0
- package/dest/config/enrich_env.d.ts +4 -0
- package/dest/config/enrich_env.d.ts.map +1 -0
- package/dest/config/enrich_env.js +12 -0
- package/dest/config/get_l1_config.d.ts +9 -0
- package/dest/config/get_l1_config.d.ts.map +1 -0
- package/dest/config/get_l1_config.js +24 -0
- package/dest/config/index.d.ts +5 -0
- package/dest/config/index.d.ts.map +1 -0
- package/dest/config/index.js +4 -0
- package/dest/config/network_config.d.ts +22 -0
- package/dest/config/network_config.d.ts.map +1 -0
- package/dest/config/network_config.js +115 -0
- package/dest/utils/aztec.d.ts +8 -20
- package/dest/utils/aztec.d.ts.map +1 -1
- package/dest/utils/aztec.js +22 -67
- package/dest/utils/commands.d.ts +21 -12
- package/dest/utils/commands.d.ts.map +1 -1
- package/dest/utils/commands.js +38 -11
- package/dest/utils/encoding.d.ts +1 -1
- package/dest/utils/encoding.js +1 -1
- package/dest/utils/github.d.ts +1 -1
- package/dest/utils/index.d.ts +1 -1
- package/dest/utils/inspect.d.ts +5 -11
- package/dest/utils/inspect.d.ts.map +1 -1
- package/dest/utils/inspect.js +13 -95
- package/dest/utils/setup_contracts.d.ts +2 -4
- package/dest/utils/setup_contracts.d.ts.map +1 -1
- package/dest/utils/setup_contracts.js +2 -22
- package/package.json +43 -28
- package/public_include_metric_prefixes.json +1 -0
- package/src/cmds/aztec_node/block_number.ts +9 -0
- package/src/cmds/aztec_node/get_block.ts +11 -0
- package/src/cmds/aztec_node/get_current_base_fee.ts +9 -0
- package/src/cmds/aztec_node/get_l1_to_l2_message_witness.ts +27 -0
- package/src/cmds/{pxe → aztec_node}/get_logs.ts +11 -9
- package/src/cmds/{pxe → aztec_node}/get_node_info.ts +5 -16
- package/src/cmds/aztec_node/index.ts +87 -0
- package/src/cmds/contracts/inspect_contract.ts +4 -11
- package/src/cmds/infrastructure/index.ts +7 -18
- package/src/cmds/infrastructure/sequencers.ts +13 -11
- package/src/cmds/infrastructure/setup_l2_contract.ts +13 -30
- package/src/cmds/l1/advance_epoch.ts +6 -5
- package/src/cmds/l1/assume_proven_through.ts +10 -6
- package/src/cmds/l1/bridge_erc20.ts +5 -2
- package/src/cmds/l1/{deploy_l1_contracts.ts → deploy_l1_contracts_cmd.ts} +44 -24
- package/src/cmds/l1/deploy_new_rollup.ts +6 -9
- package/src/cmds/l1/get_l1_addresses.ts +5 -3
- package/src/cmds/l1/get_l1_balance.ts +2 -2
- package/src/cmds/l1/governance_utils.ts +3 -8
- package/src/cmds/l1/index.ts +28 -66
- package/src/cmds/l1/prover_stats.ts +42 -31
- package/src/cmds/l1/trigger_seed_snapshot.ts +2 -1
- package/src/cmds/l1/update_l1_validators.ts +88 -18
- package/src/cmds/misc/generate_secret_and_hash.ts +2 -2
- package/src/cmds/misc/generate_secret_key.ts +1 -1
- package/src/cmds/misc/index.ts +1 -1
- package/src/cmds/misc/update/npm.ts +1 -1
- package/src/cmds/validator_keys/add.ts +123 -0
- package/src/cmds/validator_keys/generate_bls_keypair.ts +34 -0
- package/src/cmds/validator_keys/index.ts +142 -0
- package/src/cmds/validator_keys/new.ts +207 -0
- package/src/cmds/validator_keys/shared.ts +326 -0
- package/src/cmds/validator_keys/staker.ts +301 -0
- package/src/cmds/validator_keys/utils.ts +81 -0
- package/src/config/cached_fetch.ts +67 -0
- package/src/config/chain_l2_config.ts +694 -0
- package/src/config/enrich_env.ts +15 -0
- package/src/config/get_l1_config.ts +31 -0
- package/src/config/index.ts +4 -0
- package/src/config/network_config.ts +147 -0
- package/src/utils/aztec.ts +27 -118
- package/src/utils/commands.ts +52 -15
- package/src/utils/encoding.ts +1 -1
- package/src/utils/inspect.ts +19 -111
- package/src/utils/setup_contracts.ts +4 -43
- package/dest/cmds/devnet/bootstrap_network.d.ts +0 -3
- package/dest/cmds/devnet/bootstrap_network.d.ts.map +0 -1
- package/dest/cmds/devnet/bootstrap_network.js +0 -216
- package/dest/cmds/devnet/faucet.d.ts +0 -4
- package/dest/cmds/devnet/faucet.d.ts.map +0 -1
- package/dest/cmds/devnet/faucet.js +0 -26
- package/dest/cmds/devnet/index.d.ts +0 -4
- package/dest/cmds/devnet/index.d.ts.map +0 -1
- package/dest/cmds/devnet/index.js +0 -14
- package/dest/cmds/l1/deploy_l1_contracts.d.ts +0 -4
- package/dest/cmds/l1/deploy_l1_contracts.d.ts.map +0 -1
- package/dest/cmds/pxe/add_contract.d.ts +0 -5
- package/dest/cmds/pxe/add_contract.d.ts.map +0 -1
- package/dest/cmds/pxe/add_contract.js +0 -29
- package/dest/cmds/pxe/block_number.d.ts +0 -3
- package/dest/cmds/pxe/block_number.d.ts.map +0 -1
- package/dest/cmds/pxe/block_number.js +0 -10
- package/dest/cmds/pxe/get_account.d.ts +0 -4
- package/dest/cmds/pxe/get_account.d.ts.map +0 -1
- package/dest/cmds/pxe/get_account.js +0 -10
- package/dest/cmds/pxe/get_accounts.d.ts +0 -3
- package/dest/cmds/pxe/get_accounts.d.ts.map +0 -1
- package/dest/cmds/pxe/get_accounts.js +0 -25
- package/dest/cmds/pxe/get_block.d.ts +0 -3
- package/dest/cmds/pxe/get_block.d.ts.map +0 -1
- package/dest/cmds/pxe/get_block.js +0 -9
- package/dest/cmds/pxe/get_contract_data.d.ts +0 -4
- package/dest/cmds/pxe/get_contract_data.d.ts.map +0 -1
- package/dest/cmds/pxe/get_contract_data.js +0 -31
- package/dest/cmds/pxe/get_current_base_fee.d.ts +0 -3
- package/dest/cmds/pxe/get_current_base_fee.d.ts.map +0 -1
- package/dest/cmds/pxe/get_current_base_fee.js +0 -7
- package/dest/cmds/pxe/get_l1_to_l2_message_witness.d.ts +0 -4
- package/dest/cmds/pxe/get_l1_to_l2_message_witness.d.ts.map +0 -1
- package/dest/cmds/pxe/get_l1_to_l2_message_witness.js +0 -11
- package/dest/cmds/pxe/get_logs.d.ts +0 -4
- package/dest/cmds/pxe/get_logs.d.ts.map +0 -1
- package/dest/cmds/pxe/get_node_info.d.ts +0 -3
- package/dest/cmds/pxe/get_node_info.d.ts.map +0 -1
- package/dest/cmds/pxe/get_pxe_info.d.ts +0 -3
- package/dest/cmds/pxe/get_pxe_info.d.ts.map +0 -1
- package/dest/cmds/pxe/get_pxe_info.js +0 -11
- package/dest/cmds/pxe/index.d.ts +0 -4
- package/dest/cmds/pxe/index.d.ts.map +0 -1
- package/dest/cmds/pxe/index.js +0 -55
- package/src/cmds/devnet/bootstrap_network.ts +0 -321
- package/src/cmds/devnet/faucet.ts +0 -33
- package/src/cmds/devnet/index.ts +0 -60
- package/src/cmds/pxe/add_contract.ts +0 -41
- package/src/cmds/pxe/block_number.ts +0 -9
- package/src/cmds/pxe/get_account.ts +0 -16
- package/src/cmds/pxe/get_accounts.ts +0 -35
- package/src/cmds/pxe/get_block.ts +0 -10
- package/src/cmds/pxe/get_contract_data.ts +0 -51
- package/src/cmds/pxe/get_current_base_fee.ts +0 -9
- package/src/cmds/pxe/get_l1_to_l2_message_witness.ts +0 -25
- package/src/cmds/pxe/get_pxe_info.ts +0 -13
- package/src/cmds/pxe/index.ts +0 -170
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ The Aztec CLI `aztec-cli` is a command-line interface (CLI) tool for interacting
|
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
1. In your terminal, download the
|
|
7
|
+
1. In your terminal, download the local network by running
|
|
8
8
|
|
|
9
9
|
```
|
|
10
10
|
bash -i <(curl -s https://install.aztec.network)
|
|
@@ -20,430 +20,4 @@ bash -i <(curl -s https://install.aztec.network)
|
|
|
20
20
|
|
|
21
21
|
## Usage
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
Here's the basic syntax for running a command:
|
|
26
|
-
|
|
27
|
-
```shell
|
|
28
|
-
aztec-cli <command> [options]
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
Replace `<command>` with the actual command you want to execute and `[options]` with any optional flags or parameters required by the command.
|
|
32
|
-
|
|
33
|
-
### Environment Variables
|
|
34
|
-
|
|
35
|
-
Some options can be set globally as environment variables to avoid having to re-enter them every time you call `aztec-cli.`
|
|
36
|
-
These options are:
|
|
37
|
-
|
|
38
|
-
- `SECRET_KEY` -> `-sk, --secret-key` for all commands that require an Aztec secret key.
|
|
39
|
-
- `PUBLIC_KEY` -> `-k, --public-key` for all commands that require a public key.
|
|
40
|
-
- `PXE_URL` -> `-u, --rpc-url` for commands that require a PXE
|
|
41
|
-
- `ETHEREUM_HOSTS` -> `-u, --rpc-urls` or `--l1-rpc-urls` for `deploy-l1-contracts`.
|
|
42
|
-
|
|
43
|
-
So if for example you are running your Private eXecution Environment (PXE) remotely you can do:
|
|
44
|
-
|
|
45
|
-
```shell
|
|
46
|
-
export PXE_URL=http://external.site/rpc:8080
|
|
47
|
-
aztec-cli deploy my_contract.json
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
And this will send the request to `http://external.site/rpc:8080`.
|
|
51
|
-
|
|
52
|
-
**NOTE**: Entering an option value will override the environment variable.
|
|
53
|
-
|
|
54
|
-
## Available Commands
|
|
55
|
-
|
|
56
|
-
`aztec-cli` provides the following commands for interacting with Aztec:
|
|
57
|
-
|
|
58
|
-
### deploy-l1-contracts
|
|
59
|
-
|
|
60
|
-
Deploys all necessary Ethereum contracts for Aztec.
|
|
61
|
-
|
|
62
|
-
Syntax:
|
|
63
|
-
|
|
64
|
-
```shell
|
|
65
|
-
aztec-cli deploy-l1-contracts [rpcUrl] [options]
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
- `rpcUrl` (optional): URL of the Ethereum host. Chain identifiers `localhost` and `testnet` can be used. Default: `http://localhost:8545`.
|
|
69
|
-
|
|
70
|
-
Options:
|
|
71
|
-
|
|
72
|
-
- `-a, --l1-chain-id <string>`: Chain ID for the Ethereum host.
|
|
73
|
-
- `-p, --private-key <string>`: The private key to use for deployment.
|
|
74
|
-
- `-m, --mnemonic <string>`: The mnemonic to use in deployment. Default: `test test test test test test test test test test test junk`.
|
|
75
|
-
|
|
76
|
-
This command deploys all the necessary Ethereum contracts required for Aztec. It creates the rollup contract, registry contract, inbox contract, outbox contract, and contract deployment emitter. The command displays the addresses of the deployed contracts.
|
|
77
|
-
|
|
78
|
-
Example usage:
|
|
79
|
-
|
|
80
|
-
```shell
|
|
81
|
-
aztec-cli deploy-l1-contracts
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
### create-private-key
|
|
85
|
-
|
|
86
|
-
Generates a 32-byte private key.
|
|
87
|
-
|
|
88
|
-
Syntax:
|
|
89
|
-
|
|
90
|
-
```shell
|
|
91
|
-
aztec-cli create-private-key [options]
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
Options:
|
|
95
|
-
|
|
96
|
-
- `-m, --mnemonic`: A mnemonic string that can be used for the private key generation.
|
|
97
|
-
|
|
98
|
-
This command generates a random 32-byte private key or derives one from the provided mnemonic string. It displays the generated private key.
|
|
99
|
-
|
|
100
|
-
Example usage:
|
|
101
|
-
|
|
102
|
-
```shell
|
|
103
|
-
aztec-cli create-private-key
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
### create-account
|
|
107
|
-
|
|
108
|
-
Creates an Aztec account that can be used for transactions.
|
|
109
|
-
|
|
110
|
-
Syntax:
|
|
111
|
-
|
|
112
|
-
```shell
|
|
113
|
-
aztec-cli create-account [options]
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
Options:
|
|
117
|
-
|
|
118
|
-
- `-k, --private-key`: Private key to use for the account generation. Uses a random key by default.
|
|
119
|
-
- `-u, --rpc-url <string>`: URL of PXE Service. Default: `http://localhost:8080`.
|
|
120
|
-
|
|
121
|
-
This command creates an Aztec account that can be used for transactions. It generates a new account with a private key or uses the provided private key. The command displays the account's address and public key.
|
|
122
|
-
|
|
123
|
-
Example usage:
|
|
124
|
-
|
|
125
|
-
```shell
|
|
126
|
-
aztec-cli create-account
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
### deploy
|
|
130
|
-
|
|
131
|
-
Deploys a compiled Aztec.nr contract to Aztec.
|
|
132
|
-
|
|
133
|
-
Syntax:
|
|
134
|
-
|
|
135
|
-
```shell
|
|
136
|
-
aztec-cli deploy <contractArtifact> [options]
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
Options:
|
|
140
|
-
|
|
141
|
-
- `-c, --contract-artifact <fileLocation>`: Path to the compiled Aztec.nr contract's artifact file in JSON format. You can also use one of Aztec's example contracts found in [@aztec/noir-contracts](https://www.npmjs.com/package/@aztec/noir-contracts), e.g. PrivateTokenContractArtifact. You can get a full ist of the available contracts with `aztec-cli example-contracts`
|
|
142
|
-
- `-a, --args <constructorArgs...>` (optional): Contract constructor arguments Default: [].
|
|
143
|
-
- `-u, --rpc-url <string>`: URL of PXE Service. Default: `http://localhost:8080`.
|
|
144
|
-
- `-k, --public-key <string>`: Public key of the deployer. If not provided, it will check the RPC for existing ones.
|
|
145
|
-
|
|
146
|
-
This command deploys a compiled Aztec.nr contract to Aztec. It requires the path to the contract's artifact file in JSON format. Optionally, you can specify the public key of the deployer and provide constructor arguments for the contract. The command displays the address of the deployed contract.
|
|
147
|
-
|
|
148
|
-
Example usage:
|
|
149
|
-
|
|
150
|
-
```shell
|
|
151
|
-
aztec-cli deploy -c path/to/contract.artifact.json -a ...args
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
With an Aztec example contract:
|
|
155
|
-
|
|
156
|
-
```shell
|
|
157
|
-
aztec-cli deploy -c PrivateTokenContractArtifact -a 333 0x134567890abcdef
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
### check-deploy
|
|
161
|
-
|
|
162
|
-
Checks if a contract is deployed to the specified Aztec address.
|
|
163
|
-
|
|
164
|
-
Syntax:
|
|
165
|
-
|
|
166
|
-
```shell
|
|
167
|
-
aztec-cli check-deploy <contractAddress> [options]
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
Options:
|
|
171
|
-
|
|
172
|
-
- `-ca, --contract-address <address>`: An Aztec address to check if the contract has been deployed to.
|
|
173
|
-
- `-u, --rpc-url <string>`: URL of PXE Service. Default: `http://localhost:8080`.
|
|
174
|
-
|
|
175
|
-
This command checks if a contract is deployed to the specified Aztec address. It verifies if the contract is present at the given address and displays the result.
|
|
176
|
-
|
|
177
|
-
Example usage:
|
|
178
|
-
|
|
179
|
-
```shell
|
|
180
|
-
aztec-cli check-deploy -ca 0x123456789abcdef123456789abcdef12345678
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
### get-tx-receipt
|
|
184
|
-
|
|
185
|
-
Gets the receipt for the specified transaction hash.
|
|
186
|
-
|
|
187
|
-
Syntax:
|
|
188
|
-
|
|
189
|
-
```shell
|
|
190
|
-
aztec-cli get-tx-receipt <txHash> [options]
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
- `txHash`: A transaction hash to get the receipt for.
|
|
194
|
-
|
|
195
|
-
Options:
|
|
196
|
-
|
|
197
|
-
- `-u, --rpc-url <string>`: URL of PXE Service. Default: `http://localhost:8080`.
|
|
198
|
-
|
|
199
|
-
This command retrieves and displays the receipt for the specified transaction hash. It shows details such as the transaction status, block number, and block hash.
|
|
200
|
-
|
|
201
|
-
Example usage:
|
|
202
|
-
|
|
203
|
-
```shell
|
|
204
|
-
aztec-cli get-tx-receipt 0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef12345678
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
### get-contract-data
|
|
208
|
-
|
|
209
|
-
Gets information about the Aztec contract deployed at the specified address.
|
|
210
|
-
|
|
211
|
-
Syntax:
|
|
212
|
-
|
|
213
|
-
```shell
|
|
214
|
-
aztec-cli get-contract-data <contractAddress> [options]
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
- `contractAddress`: Aztec address of the contract.
|
|
218
|
-
|
|
219
|
-
Options:
|
|
220
|
-
|
|
221
|
-
- `-u, --rpc-url <string>`: URL of PXE Service. Default: `http://localhost:8080`.
|
|
222
|
-
- `-b, --include-bytecode`: Include the contract's public function bytecode, if any.
|
|
223
|
-
|
|
224
|
-
This command retrieves and displays information about the Aztec contract deployed at the specified address. It shows the contract address, portal contract address, and optionally, the bytecode of the contract's public functions.
|
|
225
|
-
|
|
226
|
-
Example usage:
|
|
227
|
-
|
|
228
|
-
```shell
|
|
229
|
-
aztec-cli get-contract-data 0x123456789abcdef123456789abcdef12345678
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
### register-recipient
|
|
233
|
-
|
|
234
|
-
Register a recipient account on the PXE (called recipient because we can only send notes to this account and not receive them via this PXE).
|
|
235
|
-
To read about how keys are generated and used, head to our docs [here](https://github.com/AztecProtocol/aztec-packages/blob/master/docs/docs/aztec/developer/wallet-providers/keys.md#addresses-partial-addresses-and-public-keys).
|
|
236
|
-
|
|
237
|
-
Syntax:
|
|
238
|
-
|
|
239
|
-
```shell
|
|
240
|
-
aztec-cli register-recipient [options]
|
|
241
|
-
```
|
|
242
|
-
|
|
243
|
-
Options:
|
|
244
|
-
|
|
245
|
-
- `-a, --address <aztecAddress>`: The account's Aztec address.
|
|
246
|
-
- `-p, --public-key <publicKey>`: 'The account public key.'
|
|
247
|
-
- `-pa, --partial-address <partialAddress`: 'The partially computed address of the account contract.'
|
|
248
|
-
- `-u, --rpc-url <string>`: URL of PXE Service. Default: `http://localhost:8080`.
|
|
249
|
-
|
|
250
|
-
Example usage:
|
|
251
|
-
|
|
252
|
-
```shell
|
|
253
|
-
aztec-cli register-recipient -p 0x20d9d93c4a9eb2b4bdb70ead07d28d1edb74bfd78443a8c36b098b024cd26f0e0647f5dbe3619453f42eb788c2beed0294c84676425047aadac23294605c4af9 -a 0x111fdc0f6bf831ca59f05863199762d643b782699d7ce6feaae40a923baf60af -pa 0x72bf7c9537875b0af267b4a8c497927e251f5988af6e30527feb16299042ed
|
|
254
|
-
```
|
|
255
|
-
|
|
256
|
-
### get-accounts
|
|
257
|
-
|
|
258
|
-
Gets all the Aztec accounts stored in a PXE.
|
|
259
|
-
|
|
260
|
-
Syntax:
|
|
261
|
-
|
|
262
|
-
```shell
|
|
263
|
-
aztec-cli get-accounts [options]
|
|
264
|
-
```
|
|
265
|
-
|
|
266
|
-
Options:
|
|
267
|
-
|
|
268
|
-
- `-u, --rpc-url <string>`: URL of PXE Service. Default: `http://localhost:8080`.
|
|
269
|
-
|
|
270
|
-
This command retrieves and displays all the Aztec accounts available in the system.
|
|
271
|
-
|
|
272
|
-
Example usage:
|
|
273
|
-
|
|
274
|
-
```shell
|
|
275
|
-
aztec-cli get-accounts
|
|
276
|
-
```
|
|
277
|
-
|
|
278
|
-
### get-account
|
|
279
|
-
|
|
280
|
-
Gets an account given its Aztec address.
|
|
281
|
-
|
|
282
|
-
Syntax:
|
|
283
|
-
|
|
284
|
-
```shell
|
|
285
|
-
aztec-cli get-account <address> [options]
|
|
286
|
-
```
|
|
287
|
-
|
|
288
|
-
- `address`: The Aztec address to get the public key for.
|
|
289
|
-
|
|
290
|
-
Options:
|
|
291
|
-
|
|
292
|
-
- `-u, --rpc-url <string>`: URL of PXE Service. Default: `http://localhost:8080`.
|
|
293
|
-
|
|
294
|
-
This command retrieves and displays the public key of an account given its Aztec address.
|
|
295
|
-
|
|
296
|
-
Example usage:
|
|
297
|
-
|
|
298
|
-
```shell
|
|
299
|
-
aztec-cli get-account 0x123456789abcdef123456789abcdef12345678
|
|
300
|
-
```
|
|
301
|
-
|
|
302
|
-
### send
|
|
303
|
-
|
|
304
|
-
Sends a transaction invoking a function on an Aztec contract.
|
|
305
|
-
|
|
306
|
-
Syntax:
|
|
307
|
-
|
|
308
|
-
```shell
|
|
309
|
-
aztec-cli send <functionName> --args [functionArgs...] --contract-artifact <contractArtifact> --contract-address <contractAddress> --private-key <senderPrivateKey>
|
|
310
|
-
```
|
|
311
|
-
|
|
312
|
-
- `functionName`: Name of the function to call.
|
|
313
|
-
|
|
314
|
-
Options:
|
|
315
|
-
|
|
316
|
-
- `'-a, --args [functionArgs...]` (optional): Function arguments. Default: [].
|
|
317
|
-
- `-c, --contract-artifact <fileLocation>`: The compiled contract's artifact in JSON format. You can also use one of Aztec's example contracts found in (@aztec/noir-contracts)[https://www.npmjs.com/package/@aztec/noir-contracts], e.g. PrivateTokenContractArtifact.
|
|
318
|
-
- `-ca, --contract-address <address>`: Address of the contract.
|
|
319
|
-
- `-k, --private-key <string>`: The sender's private key.
|
|
320
|
-
- `-u, --rpc-url <string>`: URL of PXE Service. Default: `http://localhost:8080`.
|
|
321
|
-
|
|
322
|
-
This command calls a function on an Aztec contract. It requires the contract's artifact, address, function name, and optionally, function arguments. The command executes the function call and displays the transaction details.
|
|
323
|
-
|
|
324
|
-
Example usage:
|
|
325
|
-
|
|
326
|
-
```shell
|
|
327
|
-
aztec-cli send transfer -ca 0x123456789abcdef123456789abcdef12345678 -a 100 -c path/to/artifact.json
|
|
328
|
-
```
|
|
329
|
-
|
|
330
|
-
### call
|
|
331
|
-
|
|
332
|
-
Calls a view (read-only) function on a deployed contract.
|
|
333
|
-
Unlike transactions, view calls do not modify the state of the contract.
|
|
334
|
-
|
|
335
|
-
Syntax:
|
|
336
|
-
|
|
337
|
-
```shell
|
|
338
|
-
aztec-cli call <functionName> -a [functionArgs...] -c <contractArtifact> -ca <contractAddress> -f <fromAddress>
|
|
339
|
-
```
|
|
340
|
-
|
|
341
|
-
- `functionName`: Name of the function to view.
|
|
342
|
-
|
|
343
|
-
Options:
|
|
344
|
-
|
|
345
|
-
- `'-a, --args [functionArgs...]` (optional): Function arguments. Default: [].
|
|
346
|
-
- `-c, --contract-artifact <fileLocation>`: The compiled contract's artifact in JSON format. You can also use one of Aztec's example contracts found in (@aztec/noir-contracts)[https://www.npmjs.com/package/@aztec/noir-contracts], e.g. PrivateTokenContractArtifact.
|
|
347
|
-
- `-ca, --contract-address <address>`: Address of the contract.
|
|
348
|
-
- `-f, --from <string>`: Address of the caller. If empty, first account in the Private eXecution Environment (PXE) will be used.
|
|
349
|
-
- `-u, --rpc-url <string>`: URL of PXE Service. Default: `http://localhost:8080`.
|
|
350
|
-
|
|
351
|
-
This command simulates the execution of a view function on a deployed contract without modifying the state. It requires the contract's artifact, address, function name, and optionally, function arguments. The command displays the result of the view function.
|
|
352
|
-
|
|
353
|
-
Example usage:
|
|
354
|
-
|
|
355
|
-
```shell
|
|
356
|
-
aztec-cli call balanceOf -c path/to/contract.artifact.json -ca 0x123456789abcdef123456789abcdef12345678 -a balanceOf 0xabcdef1234567890abcdef1234567890abcdef12
|
|
357
|
-
```
|
|
358
|
-
|
|
359
|
-
### parse-parameter-struct
|
|
360
|
-
|
|
361
|
-
Helper for parsing an encoded string into a contract's parameter struct.
|
|
362
|
-
|
|
363
|
-
Syntax:
|
|
364
|
-
|
|
365
|
-
```shell
|
|
366
|
-
aztec-cli parse-parameter-struct <encodedString> <contractArtifact> <parameterName>
|
|
367
|
-
```
|
|
368
|
-
|
|
369
|
-
- `encodedString`: The encoded hex string.
|
|
370
|
-
- `contractArtifact`: The compiled contract's artifact in JSON format.
|
|
371
|
-
- `parameterName`: The name of the struct parameter to decode into.
|
|
372
|
-
|
|
373
|
-
This command is a helper for parsing an encoded hex string into a contract's parameter struct. It requires the encoded string, the contract's artifact, and the name of the struct parameter. The command decodes the string and displays the struct data.
|
|
374
|
-
|
|
375
|
-
Example usage:
|
|
376
|
-
|
|
377
|
-
```shell
|
|
378
|
-
aztec-cli parse-parameter-struct 0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890 path/to/contract.artifact.json paramName
|
|
379
|
-
```
|
|
380
|
-
|
|
381
|
-
### get-logs
|
|
382
|
-
|
|
383
|
-
Applies filter and returns the resulting unencrypted logs.
|
|
384
|
-
The filter is applied by doing an intersection of all its params.
|
|
385
|
-
|
|
386
|
-
Syntax:
|
|
387
|
-
|
|
388
|
-
```shell
|
|
389
|
-
aztec-cli get-logs --fromBlock <number>
|
|
390
|
-
```
|
|
391
|
-
|
|
392
|
-
Options:
|
|
393
|
-
|
|
394
|
-
- `-u, --rpc-url <string>`: URL of PXE Service. Default: `http://localhost:8080`.
|
|
395
|
-
|
|
396
|
-
This command retrieves and displays all the unencrypted logs from L2 blocks in the specified range or from a specific transaction.
|
|
397
|
-
Example usage:
|
|
398
|
-
|
|
399
|
-
```shell
|
|
400
|
-
aztec-cli get-logs --txHash 21fef567e01f8508e30843ebcef9c5f6ff27b29d66783cfcdbd070c3a9174234
|
|
401
|
-
aztec-cli get-logs --fromBlock 4 --toBlock 5 --contractAddress 0x1db5f68861c5960c37205d3d5b23466240359c115c49e45982865ea7ace69a02
|
|
402
|
-
aztec-cli get-logs --fromBlock 4 --toBlock 5 --contractAddress 0x1db5f68861c5960c37205d3d5b23466240359c115c49e45982865ea7ace69a02 --selector 00000005
|
|
403
|
-
```
|
|
404
|
-
|
|
405
|
-
Run `aztec-cli get-logs --help` for more information on the filtering options.
|
|
406
|
-
|
|
407
|
-
### block-number
|
|
408
|
-
|
|
409
|
-
Gets the current Aztec L2 block number.
|
|
410
|
-
|
|
411
|
-
Syntax:
|
|
412
|
-
|
|
413
|
-
```shell
|
|
414
|
-
aztec-cli block-number
|
|
415
|
-
```
|
|
416
|
-
|
|
417
|
-
Options:
|
|
418
|
-
|
|
419
|
-
- `-u, --rpc-url <string>`: URL of PXE Service. Default: `http://localhost:8080`.
|
|
420
|
-
|
|
421
|
-
This command retrieves and displays the current Aztec L2 block number.
|
|
422
|
-
|
|
423
|
-
### example-contracts
|
|
424
|
-
|
|
425
|
-
Lists the contracts available in [@aztec/noir-contracts](https://github.com/AztecProtocol/aztec-packages/tree/master/noir-contracts)
|
|
426
|
-
|
|
427
|
-
Syntax:
|
|
428
|
-
|
|
429
|
-
```shell
|
|
430
|
-
aztec-cli example-contracts
|
|
431
|
-
```
|
|
432
|
-
|
|
433
|
-
### get-node-info
|
|
434
|
-
|
|
435
|
-
Gets information of an Aztec node at the specified URL.
|
|
436
|
-
|
|
437
|
-
Syntax:
|
|
438
|
-
|
|
439
|
-
```shell
|
|
440
|
-
aztec-cli get-node-info
|
|
441
|
-
```
|
|
442
|
-
|
|
443
|
-
Options:
|
|
444
|
-
|
|
445
|
-
- `-u, --rpc-url <string>`: URL of PXE Service. Default: `http://localhost:8080`.
|
|
446
|
-
|
|
447
|
-
## Conclusion
|
|
448
|
-
|
|
449
|
-
That covers the available commands and their usage in the `aztec-cli`. You can now use these commands to interact with Aztec and perform various actions such as deploying contracts, creating accounts, executing functions, and retrieving blockchain data.
|
|
23
|
+
Run `aztec-cli --help` to get info on the commands.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { LogFn } from '@aztec/foundation/log';
|
|
2
|
+
export declare function blockNumber(nodeUrl: string, log: LogFn): Promise<void>;
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmxvY2tfbnVtYmVyLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY21kcy9henRlY19ub2RlL2Jsb2NrX251bWJlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEtBQUssRUFBRSxLQUFLLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUVuRCx3QkFBc0IsV0FBVyxDQUFDLE9BQU8sRUFBRSxNQUFNLEVBQUUsR0FBRyxFQUFFLEtBQUssaUJBSzVEIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block_number.d.ts","sourceRoot":"","sources":["../../../src/cmds/aztec_node/block_number.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,wBAAsB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,iBAK5D"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createAztecNodeClient } from '@aztec/aztec.js/node';
|
|
2
|
+
export async function blockNumber(nodeUrl, log) {
|
|
3
|
+
const aztecNode = createAztecNodeClient(nodeUrl);
|
|
4
|
+
const [latestNum, provenNum] = await Promise.all([
|
|
5
|
+
aztecNode.getBlockNumber(),
|
|
6
|
+
aztecNode.getProvenBlockNumber()
|
|
7
|
+
]);
|
|
8
|
+
log(`Latest block: ${latestNum}`);
|
|
9
|
+
log(`Proven block: ${provenNum}`);
|
|
10
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { LogFn } from '@aztec/foundation/log';
|
|
2
|
+
export declare function getBlock(nodeUrl: string, maybeBlockNumber: number | undefined, log: LogFn): Promise<void>;
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0X2Jsb2NrLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY21kcy9henRlY19ub2RlL2dldF9ibG9jay50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFQSxPQUFPLEtBQUssRUFBRSxLQUFLLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUluRCx3QkFBc0IsUUFBUSxDQUFDLE9BQU8sRUFBRSxNQUFNLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxHQUFHLFNBQVMsRUFBRSxHQUFHLEVBQUUsS0FBSyxpQkFJL0YifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get_block.d.ts","sourceRoot":"","sources":["../../../src/cmds/aztec_node/get_block.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAInD,wBAAsB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,EAAE,KAAK,iBAI/F"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createAztecNodeClient } from '@aztec/aztec.js/node';
|
|
2
|
+
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
3
|
+
import { inspectBlock } from '../../utils/inspect.js';
|
|
4
|
+
export async function getBlock(nodeUrl, maybeBlockNumber, log) {
|
|
5
|
+
const aztecNode = createAztecNodeClient(nodeUrl);
|
|
6
|
+
const blockNumber = maybeBlockNumber ? BlockNumber(maybeBlockNumber) : await aztecNode.getBlockNumber();
|
|
7
|
+
await inspectBlock(aztecNode, blockNumber, log, {
|
|
8
|
+
showTxs: true
|
|
9
|
+
});
|
|
10
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
2
|
+
export declare function getCurrentBaseFee(nodeUrl: string, debugLogger: Logger, log: LogFn): Promise<void>;
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0X2N1cnJlbnRfYmFzZV9mZWUuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jbWRzL2F6dGVjX25vZGUvZ2V0X2N1cnJlbnRfYmFzZV9mZWUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsT0FBTyxLQUFLLEVBQUUsS0FBSyxFQUFFLE1BQU0sRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBRTNELHdCQUFzQixpQkFBaUIsQ0FBQyxPQUFPLEVBQUUsTUFBTSxFQUFFLFdBQVcsRUFBRSxNQUFNLEVBQUUsR0FBRyxFQUFFLEtBQUssaUJBSXZGIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get_current_base_fee.d.ts","sourceRoot":"","sources":["../../../src/cmds/aztec_node/get_current_base_fee.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,iBAIvF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createAztecNodeClient } from '@aztec/aztec.js/node';
|
|
2
|
+
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
3
|
+
export async function getCurrentBaseFee(nodeUrl, debugLogger, log) {
|
|
4
|
+
const node = createAztecNodeClient(nodeUrl);
|
|
5
|
+
const fees = await node.getCurrentBaseFees();
|
|
6
|
+
log(`Current fees: ${jsonStringify(fees)}`);
|
|
7
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
+
import type { Fr } from '@aztec/aztec.js/fields';
|
|
3
|
+
import type { LogFn } from '@aztec/foundation/log';
|
|
4
|
+
export declare function getL1ToL2MessageWitness(nodeUrl: string, contractAddress: AztecAddress, messageHash: Fr, secret: Fr, log: LogFn): Promise<void>;
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0X2wxX3RvX2wyX21lc3NhZ2Vfd2l0bmVzcy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NtZHMvYXp0ZWNfbm9kZS9nZXRfbDFfdG9fbDJfbWVzc2FnZV93aXRuZXNzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLFlBQVksRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBQzlELE9BQU8sS0FBSyxFQUFFLEVBQUUsRUFBRSxNQUFNLHdCQUF3QixDQUFDO0FBRWpELE9BQU8sS0FBSyxFQUFFLEtBQUssRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBR25ELHdCQUFzQix1QkFBdUIsQ0FDM0MsT0FBTyxFQUFFLE1BQU0sRUFDZixlQUFlLEVBQUUsWUFBWSxFQUM3QixXQUFXLEVBQUUsRUFBRSxFQUNmLE1BQU0sRUFBRSxFQUFFLEVBQ1YsR0FBRyxFQUFFLEtBQUssaUJBZVgifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get_l1_to_l2_message_witness.d.ts","sourceRoot":"","sources":["../../../src/cmds/aztec_node/get_l1_to_l2_message_witness.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,MAAM,EACf,eAAe,EAAE,YAAY,EAC7B,WAAW,EAAE,EAAE,EACf,MAAM,EAAE,EAAE,EACV,GAAG,EAAE,KAAK,iBAeX"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createAztecNodeClient } from '@aztec/aztec.js/node';
|
|
2
|
+
import { getNonNullifiedL1ToL2MessageWitness } from '@aztec/stdlib/messaging';
|
|
3
|
+
export async function getL1ToL2MessageWitness(nodeUrl, contractAddress, messageHash, secret, log) {
|
|
4
|
+
const node = createAztecNodeClient(nodeUrl);
|
|
5
|
+
const messageWitness = await getNonNullifiedL1ToL2MessageWitness(node, contractAddress, messageHash, secret);
|
|
6
|
+
log(messageWitness === undefined ? `
|
|
7
|
+
L1 to L2 Message not found.
|
|
8
|
+
` : `
|
|
9
|
+
L1 to L2 message index: ${messageWitness[0]}
|
|
10
|
+
L1 to L2 message sibling path: ${messageWitness[1]}
|
|
11
|
+
`);
|
|
12
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
+
import type { LogId } from '@aztec/aztec.js/log';
|
|
3
|
+
import type { TxHash } from '@aztec/aztec.js/tx';
|
|
4
|
+
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
5
|
+
import type { LogFn } from '@aztec/foundation/log';
|
|
6
|
+
export declare function getLogs(txHash: TxHash, fromBlock: BlockNumber, toBlock: BlockNumber, afterLog: LogId, contractAddress: AztecAddress, nodeUrl: string, follow: boolean, log: LogFn): Promise<void>;
|
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0X2xvZ3MuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jbWRzL2F6dGVjX25vZGUvZ2V0X2xvZ3MudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsWUFBWSxFQUFFLE1BQU0sMkJBQTJCLENBQUM7QUFDOUQsT0FBTyxLQUFLLEVBQWEsS0FBSyxFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFFNUQsT0FBTyxLQUFLLEVBQUUsTUFBTSxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFDakQsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBQzlELE9BQU8sS0FBSyxFQUFFLEtBQUssRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBR25ELHdCQUFzQixPQUFPLENBQzNCLE1BQU0sRUFBRSxNQUFNLEVBQ2QsU0FBUyxFQUFFLFdBQVcsRUFDdEIsT0FBTyxFQUFFLFdBQVcsRUFDcEIsUUFBUSxFQUFFLEtBQUssRUFDZixlQUFlLEVBQUUsWUFBWSxFQUM3QixPQUFPLEVBQUUsTUFBTSxFQUNmLE1BQU0sRUFBRSxPQUFPLEVBQ2YsR0FBRyxFQUFFLEtBQUssaUJBbURYIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get_logs.d.ts","sourceRoot":"","sources":["../../../src/cmds/aztec_node/get_logs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAa,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,wBAAsB,OAAO,CAC3B,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,WAAW,EACtB,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,KAAK,EACf,eAAe,EAAE,YAAY,EAC7B,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,OAAO,EACf,GAAG,EAAE,KAAK,iBAmDX"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createAztecNodeClient } from '@aztec/aztec.js/node';
|
|
2
2
|
import { sleep } from '@aztec/foundation/sleep';
|
|
3
|
-
export async function getLogs(txHash, fromBlock, toBlock, afterLog, contractAddress,
|
|
4
|
-
const
|
|
3
|
+
export async function getLogs(txHash, fromBlock, toBlock, afterLog, contractAddress, nodeUrl, follow, log) {
|
|
4
|
+
const node = createAztecNodeClient(nodeUrl);
|
|
5
5
|
if (follow) {
|
|
6
6
|
if (txHash) {
|
|
7
7
|
throw Error('Cannot use --follow with --tx-hash');
|
|
@@ -18,7 +18,7 @@ export async function getLogs(txHash, fromBlock, toBlock, afterLog, contractAddr
|
|
|
18
18
|
contractAddress
|
|
19
19
|
};
|
|
20
20
|
const fetchLogs = async ()=>{
|
|
21
|
-
const response = await
|
|
21
|
+
const response = await node.getPublicLogs(filter);
|
|
22
22
|
const logs = response.logs;
|
|
23
23
|
if (!logs.length) {
|
|
24
24
|
const filterOptions = Object.entries(filter).filter(([, value])=>value !== undefined).map(([key, value])=>`${key}: ${value}`).join(', ');
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { LogFn } from '@aztec/foundation/log';
|
|
2
|
+
export declare function getNodeInfo(nodeUrl: string, json: boolean, log: LogFn, logJson: (output: any) => void): Promise<void>;
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0X25vZGVfaW5mby5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NtZHMvYXp0ZWNfbm9kZS9nZXRfbm9kZV9pbmZvLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sS0FBSyxFQUFFLEtBQUssRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBRW5ELHdCQUFzQixXQUFXLENBQUMsT0FBTyxFQUFFLE1BQU0sRUFBRSxJQUFJLEVBQUUsT0FBTyxFQUFFLEdBQUcsRUFBRSxLQUFLLEVBQUUsT0FBTyxFQUFFLENBQUMsTUFBTSxFQUFFLEdBQUcsS0FBSyxJQUFJLGlCQTJEM0cifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get_node_info.d.ts","sourceRoot":"","sources":["../../../src/cmds/aztec_node/get_node_info.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,wBAAsB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,iBA2D3G"}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import { createAztecNodeClient
|
|
2
|
-
export async function getNodeInfo(
|
|
3
|
-
|
|
4
|
-
if (pxeRequest) {
|
|
5
|
-
client = await createCompatibleClient(rpcUrl, debugLogger);
|
|
6
|
-
} else {
|
|
7
|
-
client = createAztecNodeClient(rpcUrl);
|
|
8
|
-
}
|
|
1
|
+
import { createAztecNodeClient } from '@aztec/aztec.js/node';
|
|
2
|
+
export async function getNodeInfo(nodeUrl, json, log, logJson) {
|
|
3
|
+
const client = createAztecNodeClient(nodeUrl);
|
|
9
4
|
const info = await client.getNodeInfo();
|
|
10
5
|
if (json) {
|
|
11
6
|
logJson({
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
2
|
+
import type { Command } from 'commander';
|
|
3
|
+
export declare function injectCommands(program: Command, log: LogFn, debugLogger: Logger): Command;
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jbWRzL2F6dGVjX25vZGUvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsS0FBSyxFQUFFLE1BQU0sRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBRTNELE9BQU8sS0FBSyxFQUFFLE9BQU8sRUFBRSxNQUFNLFdBQVcsQ0FBQztBQWF6Qyx3QkFBZ0IsY0FBYyxDQUFDLE9BQU8sRUFBRSxPQUFPLEVBQUUsR0FBRyxFQUFFLEtBQUssRUFBRSxXQUFXLEVBQUUsTUFBTSxXQXVFL0UifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cmds/aztec_node/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAazC,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,WAuE/E"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { logJson, nodeOption, parseAztecAddress, parseField, parseOptionalAztecAddress, parseOptionalInteger, parseOptionalLogId, parseOptionalTxHash } from '../../utils/commands.js';
|
|
2
|
+
export function injectCommands(program, log, debugLogger) {
|
|
3
|
+
program.command('get-block').description('Gets info for a given block or latest.').argument('[blockNumber]', 'Block height', parseOptionalInteger).addOption(nodeOption).action(async (blockNumber, options)=>{
|
|
4
|
+
const { getBlock } = await import('./get_block.js');
|
|
5
|
+
await getBlock(options.nodeUrl, blockNumber, log);
|
|
6
|
+
});
|
|
7
|
+
program.command('get-current-base-fee').description('Gets the current base fee.').addOption(nodeOption).action(async (options)=>{
|
|
8
|
+
const { getCurrentBaseFee } = await import('./get_current_base_fee.js');
|
|
9
|
+
await getCurrentBaseFee(options.rpcUrl, debugLogger, log);
|
|
10
|
+
});
|
|
11
|
+
program.command('get-l1-to-l2-message-witness').description('Gets a L1 to L2 message witness.').requiredOption('-ca, --contract-address <address>', 'Aztec address of the contract.', parseAztecAddress).requiredOption('--message-hash <messageHash>', 'The L1 to L2 message hash.', parseField).requiredOption('--secret <secret>', 'The secret used to claim the L1 to L2 message', parseField).addOption(nodeOption).action(async ({ contractAddress, messageHash, secret, nodeUrl })=>{
|
|
12
|
+
const { getL1ToL2MessageWitness } = await import('./get_l1_to_l2_message_witness.js');
|
|
13
|
+
await getL1ToL2MessageWitness(nodeUrl, contractAddress, messageHash, secret, log);
|
|
14
|
+
});
|
|
15
|
+
program.command('get-logs').description('Gets all the public logs from an intersection of all the filter params.').option('-tx, --tx-hash <txHash>', 'A transaction hash to get the receipt for.', parseOptionalTxHash).option('-fb, --from-block <blockNum>', 'Initial block number for getting logs (defaults to 1).', parseOptionalInteger).option('-tb, --to-block <blockNum>', 'Up to which block to fetch logs (defaults to latest).', parseOptionalInteger).option('-al --after-log <logId>', 'ID of a log after which to fetch the logs.', parseOptionalLogId).option('-ca, --contract-address <address>', 'Contract address to filter logs by.', parseOptionalAztecAddress).addOption(nodeOption).option('--follow', 'If set, will keep polling for new logs until interrupted.').action(async ({ txHash, fromBlock, toBlock, afterLog, contractAddress, aztecNodeRpcUrl: nodeUrl, follow })=>{
|
|
16
|
+
const { getLogs } = await import('./get_logs.js');
|
|
17
|
+
await getLogs(txHash, fromBlock, toBlock, afterLog, contractAddress, nodeUrl, follow, log);
|
|
18
|
+
});
|
|
19
|
+
program.command('block-number').description('Gets the current Aztec L2 block number.').addOption(nodeOption).action(async (options)=>{
|
|
20
|
+
const { blockNumber } = await import('./block_number.js');
|
|
21
|
+
await blockNumber(options.nodeUrl, log);
|
|
22
|
+
});
|
|
23
|
+
program.command('get-node-info').description('Gets the information of an Aztec node from a PXE or directly from an Aztec node.').option('--json', 'Emit output as json').addOption(nodeOption).action(async (options)=>{
|
|
24
|
+
const { getNodeInfo } = await import('./get_node_info.js');
|
|
25
|
+
await getNodeInfo(options.nodeUrl, options.json, log, logJson(log));
|
|
26
|
+
});
|
|
27
|
+
return program;
|
|
28
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
2
2
|
import type { Command } from 'commander';
|
|
3
3
|
export declare function injectCommands(program: Command, log: LogFn, debugLogger: Logger): Command;
|
|
4
|
-
//# sourceMappingURL=
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9jbWRzL2NvbnRyYWN0cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxLQUFLLEVBQUUsTUFBTSxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFFM0QsT0FBTyxLQUFLLEVBQUUsT0FBTyxFQUFFLE1BQU0sV0FBVyxDQUFDO0FBRXpDLHdCQUFnQixjQUFjLENBQUMsT0FBTyxFQUFFLE9BQU8sRUFBRSxHQUFHLEVBQUUsS0FBSyxFQUFFLFdBQVcsRUFBRSxNQUFNLFdBNkIvRSJ9
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
2
2
|
export declare function inspectContract(contractArtifactFile: string, debugLogger: Logger, log: LogFn): Promise<void>;
|
|
3
|
-
//# sourceMappingURL=
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5zcGVjdF9jb250cmFjdC5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NtZHMvY29udHJhY3RzL2luc3BlY3RfY29udHJhY3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxLQUFLLEVBQUUsS0FBSyxFQUFFLE1BQU0sRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBWTNELHdCQUFzQixlQUFlLENBQUMsb0JBQW9CLEVBQUUsTUFBTSxFQUFFLFdBQVcsRUFBRSxNQUFNLEVBQUUsR0FBRyxFQUFFLEtBQUssaUJBc0JsRyJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspect_contract.d.ts","sourceRoot":"","sources":["../../../src/cmds/contracts/inspect_contract.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAY3D,wBAAsB,eAAe,CAAC,oBAAoB,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"inspect_contract.d.ts","sourceRoot":"","sources":["../../../src/cmds/contracts/inspect_contract.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAY3D,wBAAsB,eAAe,CAAC,oBAAoB,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,iBAsBlG"}
|