@aztec/aztec 3.0.0-canary.a9708bd → 3.0.0-devnet.3
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/dest/bin/index.js +7 -9
- package/dest/cli/aztec_start_action.d.ts.map +1 -1
- package/dest/cli/aztec_start_action.js +2 -17
- package/dest/cli/aztec_start_options.d.ts +1 -1
- package/dest/cli/aztec_start_options.d.ts.map +1 -1
- package/dest/cli/aztec_start_options.js +105 -225
- package/dest/cli/cmds/start_archiver.d.ts.map +1 -1
- package/dest/cli/cmds/start_archiver.js +3 -3
- package/dest/cli/cmds/start_blob_sink.d.ts.map +1 -1
- package/dest/cli/cmds/start_blob_sink.js +1 -1
- package/dest/cli/cmds/start_bot.d.ts +3 -6
- package/dest/cli/cmds/start_bot.d.ts.map +1 -1
- package/dest/cli/cmds/start_bot.js +24 -13
- package/dest/cli/cmds/start_node.d.ts.map +1 -1
- package/dest/cli/cmds/start_node.js +9 -26
- package/dest/cli/cmds/start_prover_agent.d.ts.map +1 -1
- package/dest/cli/cmds/start_prover_agent.js +10 -1
- package/dest/cli/cmds/start_prover_broker.d.ts.map +1 -1
- package/dest/cli/cmds/start_prover_broker.js +7 -2
- package/dest/cli/cmds/start_prover_node.d.ts.map +1 -1
- package/dest/cli/cmds/start_prover_node.js +14 -9
- package/dest/cli/util.d.ts +6 -4
- package/dest/cli/util.d.ts.map +1 -1
- package/dest/cli/util.js +10 -10
- package/dest/cli/versioning.js +3 -3
- package/dest/examples/token.js +18 -16
- package/dest/examples/util.d.ts +1 -1
- package/dest/examples/util.d.ts.map +1 -1
- package/dest/examples/util.js +1 -1
- package/dest/index.d.ts +1 -1
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +1 -1
- package/dest/sandbox/banana_fpc.d.ts +4 -5
- package/dest/sandbox/banana_fpc.d.ts.map +1 -1
- package/dest/sandbox/banana_fpc.js +14 -18
- package/dest/sandbox/index.d.ts +2 -2
- package/dest/sandbox/index.d.ts.map +1 -1
- package/dest/sandbox/index.js +2 -2
- package/dest/sandbox/sandbox.d.ts +3 -12
- package/dest/sandbox/sandbox.d.ts.map +1 -1
- package/dest/sandbox/sandbox.js +19 -32
- package/dest/sandbox/sponsored_fpc.d.ts +3 -3
- package/dest/sandbox/sponsored_fpc.d.ts.map +1 -1
- package/dest/sandbox/sponsored_fpc.js +7 -8
- package/dest/testing/anvil_test_watcher.d.ts.map +1 -1
- package/dest/testing/anvil_test_watcher.js +3 -4
- package/dest/testing/cheat_codes.d.ts +6 -7
- package/dest/testing/cheat_codes.d.ts.map +1 -1
- package/dest/testing/cheat_codes.js +9 -10
- package/dest/testing/index.d.ts +0 -1
- package/dest/testing/index.d.ts.map +1 -1
- package/dest/testing/index.js +0 -1
- package/package.json +34 -33
- package/src/bin/index.ts +7 -9
- package/src/cli/aztec_start_action.ts +2 -14
- package/src/cli/aztec_start_options.ts +113 -232
- package/src/cli/cmds/start_archiver.ts +3 -3
- package/src/cli/cmds/start_blob_sink.ts +1 -1
- package/src/cli/cmds/start_bot.ts +35 -12
- package/src/cli/cmds/start_node.ts +12 -23
- package/src/cli/cmds/start_prover_agent.ts +6 -1
- package/src/cli/cmds/start_prover_broker.ts +16 -2
- package/src/cli/cmds/start_prover_node.ts +11 -11
- package/src/cli/util.ts +17 -14
- package/src/cli/versioning.ts +3 -3
- package/src/examples/token.ts +20 -17
- package/src/examples/util.ts +1 -1
- package/src/index.ts +3 -3
- package/src/sandbox/banana_fpc.ts +15 -20
- package/src/sandbox/index.ts +5 -2
- package/src/sandbox/sandbox.ts +21 -32
- package/src/sandbox/sponsored_fpc.ts +8 -10
- package/src/testing/anvil_test_watcher.ts +2 -5
- package/src/testing/cheat_codes.ts +10 -11
- package/src/testing/index.ts +0 -1
- package/dest/cli/chain_l2_config.d.ts +0 -31
- package/dest/cli/chain_l2_config.d.ts.map +0 -1
- package/dest/cli/chain_l2_config.js +0 -261
- package/dest/cli/cmds/start_faucet.d.ts +0 -4
- package/dest/cli/cmds/start_faucet.d.ts.map +0 -1
- package/dest/cli/cmds/start_faucet.js +0 -20
- package/dest/cli/cmds/start_pxe.d.ts +0 -16
- package/dest/cli/cmds/start_pxe.d.ts.map +0 -1
- package/dest/cli/cmds/start_pxe.js +0 -31
- package/dest/cli/get_l1_config.d.ts +0 -7
- package/dest/cli/get_l1_config.d.ts.map +0 -1
- package/dest/cli/get_l1_config.js +0 -13
- package/dest/testing/aztec_cheat_codes.d.ts +0 -59
- package/dest/testing/aztec_cheat_codes.d.ts.map +0 -1
- package/dest/testing/aztec_cheat_codes.js +0 -62
- package/src/cli/chain_l2_config.ts +0 -341
- package/src/cli/cmds/start_faucet.ts +0 -34
- package/src/cli/cmds/start_pxe.ts +0 -49
- package/src/cli/get_l1_config.ts +0 -19
- package/src/testing/aztec_cheat_codes.ts +0 -77
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
import { type ArchiverConfig, archiverConfigMappings } from '@aztec/archiver/config';
|
|
2
|
-
import { faucetConfigMapping } from '@aztec/aztec-faucet/config';
|
|
3
2
|
import { sequencerClientConfigMappings } from '@aztec/aztec-node/config';
|
|
4
3
|
import { blobSinkConfigMappings } from '@aztec/blob-sink/server';
|
|
5
4
|
import { botConfigMappings } from '@aztec/bot/config';
|
|
5
|
+
import { l1ContractAddressesMapping, l1ContractsConfigMappings, l1ReaderConfigMappings } from '@aztec/ethereum';
|
|
6
|
+
import { getKeys } from '@aztec/foundation/collection';
|
|
6
7
|
import {
|
|
7
8
|
type ConfigMapping,
|
|
8
9
|
type EnvVar,
|
|
9
|
-
SecretValue,
|
|
10
10
|
booleanConfigHelper,
|
|
11
11
|
isBooleanConfigValue,
|
|
12
12
|
omitConfigMappings,
|
|
13
13
|
} from '@aztec/foundation/config';
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
proverAgentConfigMappings,
|
|
19
|
-
proverBrokerConfigMappings,
|
|
20
|
-
} from '@aztec/prover-client/broker';
|
|
14
|
+
import { dataConfigMappings } from '@aztec/kv-store/config';
|
|
15
|
+
import { sharedNodeConfigMappings } from '@aztec/node-lib/config';
|
|
16
|
+
import { bootnodeConfigMappings, p2pConfigMappings } from '@aztec/p2p/config';
|
|
17
|
+
import { proverAgentConfigMappings, proverBrokerConfigMappings } from '@aztec/prover-client/broker';
|
|
21
18
|
import { proverNodeConfigMappings } from '@aztec/prover-node/config';
|
|
22
19
|
import { allPxeConfigMappings } from '@aztec/pxe/config';
|
|
20
|
+
import { chainConfigMappings } from '@aztec/stdlib/config';
|
|
23
21
|
import { telemetryClientConfigMappings } from '@aztec/telemetry-client';
|
|
22
|
+
import { worldStateConfigMappings } from '@aztec/world-state';
|
|
24
23
|
|
|
25
24
|
import { DefaultMnemonic } from '../mnemonic.js';
|
|
26
25
|
|
|
@@ -30,7 +29,7 @@ export interface AztecStartOption {
|
|
|
30
29
|
description: string;
|
|
31
30
|
defaultValue: any;
|
|
32
31
|
printDefault?: (val: any) => string;
|
|
33
|
-
|
|
32
|
+
env: EnvVar | undefined;
|
|
34
33
|
fallback?: EnvVar[];
|
|
35
34
|
parseVal?: (val: string) => any;
|
|
36
35
|
}
|
|
@@ -49,7 +48,7 @@ export const getOptions = (namespace: string, configMappings: Record<string, Con
|
|
|
49
48
|
description,
|
|
50
49
|
defaultValue: def,
|
|
51
50
|
printDefault,
|
|
52
|
-
|
|
51
|
+
env: env,
|
|
53
52
|
fallback,
|
|
54
53
|
parseVal: parseEnv,
|
|
55
54
|
});
|
|
@@ -57,17 +56,38 @@ export const getOptions = (namespace: string, configMappings: Record<string, Con
|
|
|
57
56
|
return options;
|
|
58
57
|
};
|
|
59
58
|
|
|
59
|
+
const configToFlag = (flag: string, configMapping: ConfigMapping, overrideDefaultValue?: any): AztecStartOption => {
|
|
60
|
+
if (!configMapping.isBoolean) {
|
|
61
|
+
flag += ' <value>';
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const flagConfig: AztecStartOption = {
|
|
65
|
+
flag,
|
|
66
|
+
env: undefined,
|
|
67
|
+
defaultValue: undefined,
|
|
68
|
+
parseVal: configMapping.parseEnv,
|
|
69
|
+
...configMapping,
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
if (overrideDefaultValue !== undefined) {
|
|
73
|
+
flagConfig.defaultValue = overrideDefaultValue;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return flagConfig;
|
|
77
|
+
};
|
|
78
|
+
|
|
60
79
|
// These are options used by multiple modules so should be inputted once
|
|
61
80
|
export const universalOptions = [
|
|
62
|
-
'l1RpcUrls',
|
|
63
81
|
'l1ConsensusHostUrls',
|
|
64
82
|
'l1ConsensusHostApiKeys',
|
|
65
83
|
'l1ConsensusHostApiKeyHeaders',
|
|
66
|
-
'l1ChainId',
|
|
67
|
-
'l1Contracts',
|
|
68
84
|
'p2pEnabled',
|
|
69
|
-
|
|
70
|
-
|
|
85
|
+
...getKeys(chainConfigMappings),
|
|
86
|
+
...getKeys(l1ContractsConfigMappings),
|
|
87
|
+
...getKeys(l1ContractAddressesMapping),
|
|
88
|
+
...getKeys(l1ReaderConfigMappings),
|
|
89
|
+
...getKeys(dataConfigMappings),
|
|
90
|
+
...getKeys(worldStateConfigMappings),
|
|
71
91
|
];
|
|
72
92
|
|
|
73
93
|
export const NETWORK_FLAG = 'network';
|
|
@@ -79,45 +99,33 @@ export const aztecStartOptions: { [key: string]: AztecStartOption[] } = {
|
|
|
79
99
|
flag: `--${NETWORK_FLAG} <value>`,
|
|
80
100
|
description: 'Network to run Aztec on',
|
|
81
101
|
defaultValue: undefined,
|
|
82
|
-
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
flag: `--auto-update <value>`,
|
|
86
|
-
description: 'Configure auto updates',
|
|
87
|
-
envVar: 'AUTO_UPDATE',
|
|
88
|
-
defaultValue: 'disabled',
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
flag: `--auto-update-url <value>`,
|
|
92
|
-
description: 'Configure where to get updates from',
|
|
93
|
-
envVar: 'AUTO_UPDATE_URL',
|
|
94
|
-
defaultValue: undefined,
|
|
102
|
+
env: 'NETWORK',
|
|
95
103
|
},
|
|
104
|
+
|
|
105
|
+
configToFlag('--auto-update', sharedNodeConfigMappings.autoUpdate),
|
|
106
|
+
configToFlag('--auto-update-url', sharedNodeConfigMappings.autoUpdateUrl),
|
|
107
|
+
|
|
108
|
+
configToFlag('--sync-mode', sharedNodeConfigMappings.syncMode),
|
|
109
|
+
configToFlag('--snapshots-urls', sharedNodeConfigMappings.snapshotsUrls),
|
|
96
110
|
],
|
|
97
111
|
SANDBOX: [
|
|
98
112
|
{
|
|
99
113
|
flag: '--sandbox',
|
|
100
114
|
description: 'Starts Aztec Sandbox',
|
|
101
115
|
defaultValue: undefined,
|
|
102
|
-
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
flag: '--sandbox.noPXE',
|
|
106
|
-
description: 'Do not expose PXE service on sandbox start',
|
|
107
|
-
envVar: 'NO_PXE',
|
|
108
|
-
...booleanConfigHelper(),
|
|
116
|
+
env: undefined,
|
|
109
117
|
},
|
|
110
118
|
{
|
|
111
119
|
flag: '--sandbox.l1Mnemonic <value>',
|
|
112
120
|
description: 'Mnemonic for L1 accounts. Will be used ',
|
|
113
121
|
defaultValue: DefaultMnemonic,
|
|
114
|
-
|
|
122
|
+
env: 'MNEMONIC',
|
|
115
123
|
},
|
|
116
124
|
{
|
|
117
125
|
flag: '--sandbox.deployAztecContractsSalt <value>',
|
|
118
126
|
description:
|
|
119
127
|
'Numeric salt for deploying L1 Aztec contracts before starting the sandbox. Needs mnemonic or private key to be set.',
|
|
120
|
-
|
|
128
|
+
env: 'DEPLOY_AZTEC_CONTRACTS_SALT',
|
|
121
129
|
defaultValue: undefined,
|
|
122
130
|
parseVal: (val: string) => (val ? parseInt(val) : undefined),
|
|
123
131
|
},
|
|
@@ -127,120 +135,43 @@ export const aztecStartOptions: { [key: string]: AztecStartOption[] } = {
|
|
|
127
135
|
flag: '--port <value>',
|
|
128
136
|
description: 'Port to run the Aztec Services on',
|
|
129
137
|
defaultValue: 8080,
|
|
130
|
-
|
|
138
|
+
env: 'AZTEC_PORT',
|
|
131
139
|
parseVal: val => parseInt(val, 10),
|
|
132
140
|
},
|
|
133
141
|
{
|
|
134
142
|
flag: '--admin-port <value>',
|
|
135
|
-
description: 'Port to run admin APIs of Aztec Services on
|
|
143
|
+
description: 'Port to run admin APIs of Aztec Services on',
|
|
136
144
|
defaultValue: 8880,
|
|
137
|
-
|
|
145
|
+
env: 'AZTEC_ADMIN_PORT',
|
|
138
146
|
parseVal: val => parseInt(val, 10),
|
|
139
147
|
},
|
|
140
148
|
{
|
|
141
149
|
flag: '--api-prefix <value>',
|
|
142
150
|
description: 'Prefix for API routes on any service that is started',
|
|
143
151
|
defaultValue: '',
|
|
144
|
-
|
|
152
|
+
env: 'API_PREFIX',
|
|
145
153
|
},
|
|
146
154
|
],
|
|
147
155
|
ETHEREUM: [
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
defaultValue: 31337,
|
|
159
|
-
envVar: 'L1_CHAIN_ID',
|
|
160
|
-
parseVal: val => parseInt(val, 10),
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
flag: '--l1-consensus-host-urls <value>',
|
|
164
|
-
description: 'List of URLs of the Ethereum consensus nodes that services will connect to (comma separated)',
|
|
165
|
-
defaultValue: [],
|
|
166
|
-
envVar: 'L1_CONSENSUS_HOST_URLS',
|
|
167
|
-
parseVal: (val: string) => val.split(',').map(url => url.trim().replace(/\/$/, '')),
|
|
168
|
-
},
|
|
169
|
-
{
|
|
170
|
-
flag: '--l1-consensus-host-api-keys <value>',
|
|
171
|
-
description: 'List of API keys for the corresponding Ethereum consensus nodes',
|
|
172
|
-
defaultValue: [],
|
|
173
|
-
envVar: 'L1_CONSENSUS_HOST_API_KEYS',
|
|
174
|
-
parseVal: (val: string) => val.split(',').map(key => new SecretValue(key)),
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
flag: '--l1-consensus-host-api-key-headers <value>',
|
|
178
|
-
description:
|
|
179
|
-
'List of API key headers for the corresponding Ethereum consensus nodes. If not set, the api key for the corresponding node will be appended to the URL as ?key=<api-key>',
|
|
180
|
-
defaultValue: [],
|
|
181
|
-
envVar: 'L1_CONSENSUS_HOST_API_KEY_HEADERS',
|
|
182
|
-
parseVal: (val: string) => val.split(',').map(url => url.trim()),
|
|
183
|
-
},
|
|
156
|
+
configToFlag('--l1-chain-id', l1ReaderConfigMappings.l1ChainId),
|
|
157
|
+
// Do not set default for CLI: keep undefined unless provided via flag or env
|
|
158
|
+
configToFlag('--l1-rpc-urls', { ...l1ReaderConfigMappings.l1RpcUrls, defaultValue: undefined }),
|
|
159
|
+
configToFlag('--l1-consensus-host-urls', blobSinkConfigMappings.l1ConsensusHostUrls),
|
|
160
|
+
configToFlag('--l1-consensus-host-api-keys', blobSinkConfigMappings.l1ConsensusHostApiKeys),
|
|
161
|
+
configToFlag('--l1-consensus-host-api-key-headers', blobSinkConfigMappings.l1ConsensusHostApiKeyHeaders),
|
|
162
|
+
],
|
|
163
|
+
'L1 CONTRACTS': [
|
|
164
|
+
configToFlag('--registry-address', l1ContractAddressesMapping.registryAddress),
|
|
165
|
+
configToFlag('--rollup-version', chainConfigMappings.rollupVersion),
|
|
184
166
|
],
|
|
185
167
|
STORAGE: [
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
description: 'Where to store data for services. If not set, will store temporarily',
|
|
189
|
-
defaultValue: undefined,
|
|
190
|
-
envVar: 'DATA_DIRECTORY',
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
flag: '--data-store-map-size-kb <value>',
|
|
194
|
-
description:
|
|
195
|
-
'The maximum possible size of the data store DB in KB. Can be overridden by component-specific options.',
|
|
196
|
-
defaultValue: undefined,
|
|
197
|
-
envVar: 'DATA_STORE_MAP_SIZE_KB',
|
|
198
|
-
parseVal: (val: string) => parseInt(val, 10),
|
|
199
|
-
},
|
|
168
|
+
configToFlag('--data-directory', dataConfigMappings.dataDirectory),
|
|
169
|
+
configToFlag('--data-store-map-size-kb', dataConfigMappings.dataStoreMapSizeKb),
|
|
200
170
|
],
|
|
201
|
-
'
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
defaultValue: undefined,
|
|
206
|
-
envVar: 'ROLLUP_CONTRACT_ADDRESS',
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
flag: '--registry-address <value>',
|
|
210
|
-
description: 'The deployed L1 registry contract address',
|
|
211
|
-
defaultValue: undefined,
|
|
212
|
-
envVar: 'REGISTRY_CONTRACT_ADDRESS',
|
|
213
|
-
},
|
|
214
|
-
{
|
|
215
|
-
flag: '--inbox-address <value>',
|
|
216
|
-
description: 'The deployed L1 -> L2 inbox contract address',
|
|
217
|
-
defaultValue: undefined,
|
|
218
|
-
envVar: 'INBOX_CONTRACT_ADDRESS',
|
|
219
|
-
},
|
|
220
|
-
{
|
|
221
|
-
flag: '--outbox-address <value>',
|
|
222
|
-
description: 'The deployed L2 -> L1 outbox contract address',
|
|
223
|
-
defaultValue: undefined,
|
|
224
|
-
envVar: 'OUTBOX_CONTRACT_ADDRESS',
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
flag: '--fee-juice-address <value>',
|
|
228
|
-
description: 'The deployed L1 Fee Juice contract address',
|
|
229
|
-
defaultValue: undefined,
|
|
230
|
-
envVar: 'FEE_JUICE_CONTRACT_ADDRESS',
|
|
231
|
-
},
|
|
232
|
-
{
|
|
233
|
-
flag: '--staking-asset-address <value>',
|
|
234
|
-
description: 'The deployed L1 Staking Asset contract address',
|
|
235
|
-
defaultValue: undefined,
|
|
236
|
-
envVar: 'STAKING_ASSET_CONTRACT_ADDRESS',
|
|
237
|
-
},
|
|
238
|
-
{
|
|
239
|
-
flag: '--fee-juice-portal-address <value>',
|
|
240
|
-
description: 'The deployed L1 Fee Juice portal contract address',
|
|
241
|
-
defaultValue: undefined,
|
|
242
|
-
envVar: 'FEE_JUICE_PORTAL_CONTRACT_ADDRESS',
|
|
243
|
-
},
|
|
171
|
+
'WORLD STATE': [
|
|
172
|
+
configToFlag('--world-state-data-directory', worldStateConfigMappings.worldStateDataDirectory),
|
|
173
|
+
configToFlag('--world-state-db-map-size-kb', worldStateConfigMappings.worldStateDbMapSizeKb),
|
|
174
|
+
configToFlag('--world-state-block-history', worldStateConfigMappings.worldStateBlockHistory),
|
|
244
175
|
],
|
|
245
176
|
// We can't easily auto-generate node options as they're parts of modules defined below
|
|
246
177
|
'AZTEC NODE': [
|
|
@@ -248,87 +179,44 @@ export const aztecStartOptions: { [key: string]: AztecStartOption[] } = {
|
|
|
248
179
|
flag: '--node',
|
|
249
180
|
description: 'Starts Aztec Node with options',
|
|
250
181
|
defaultValue: undefined,
|
|
251
|
-
|
|
252
|
-
},
|
|
253
|
-
{
|
|
254
|
-
flag: '--node.archiverUrl <value>',
|
|
255
|
-
description: 'URL for an archiver service',
|
|
256
|
-
defaultValue: undefined,
|
|
257
|
-
envVar: 'ARCHIVER_URL',
|
|
258
|
-
},
|
|
259
|
-
{
|
|
260
|
-
flag: '--node.assumeProvenThroughBlockNumber <value>',
|
|
261
|
-
description:
|
|
262
|
-
'Cheats the rollup contract into assuming every block until this one is proven. Useful for speeding up bootstraps.',
|
|
263
|
-
envVar: 'ASSUME_PROVEN_THROUGH_BLOCK_NUMBER',
|
|
264
|
-
parseVal: (val: string) => parseInt(val, 10),
|
|
265
|
-
defaultValue: 0,
|
|
266
|
-
},
|
|
267
|
-
{
|
|
268
|
-
flag: '--node.worldStateBlockCheckIntervalMS <value>',
|
|
269
|
-
description: 'Frequency in which to check for blocks in ms',
|
|
270
|
-
defaultValue: 100,
|
|
271
|
-
envVar: 'WS_BLOCK_CHECK_INTERVAL_MS',
|
|
272
|
-
parseVal: val => parseInt(val, 10),
|
|
273
|
-
},
|
|
274
|
-
{
|
|
275
|
-
flag: '--node.syncMode <value>',
|
|
276
|
-
description:
|
|
277
|
-
'Set sync mode to `full` to always sync via L1, `snapshot` to download a snapshot if there is no local data, `force-snapshot` to download even if there is local data.',
|
|
278
|
-
defaultValue: 'snapshot',
|
|
279
|
-
envVar: 'SYNC_MODE',
|
|
280
|
-
},
|
|
281
|
-
{
|
|
282
|
-
flag: '--node.snapshotsUrl <value>',
|
|
283
|
-
description: 'Base URL for downloading snapshots for snapshot sync.',
|
|
284
|
-
defaultValue: undefined,
|
|
285
|
-
envVar: 'SYNC_SNAPSHOTS_URL',
|
|
182
|
+
env: undefined,
|
|
286
183
|
},
|
|
287
184
|
],
|
|
288
|
-
'P2P SUBSYSTEM': [
|
|
289
|
-
{
|
|
290
|
-
flag: '--p2p-enabled [value]',
|
|
291
|
-
description: 'Enable P2P subsystem',
|
|
292
|
-
envVar: 'P2P_ENABLED',
|
|
293
|
-
...booleanConfigHelper(),
|
|
294
|
-
},
|
|
295
|
-
...getOptions('p2p', p2pConfigMappings),
|
|
296
|
-
],
|
|
297
|
-
TELEMETRY: [...getOptions('tel', telemetryClientConfigMappings)],
|
|
298
|
-
PXE: [
|
|
299
|
-
{
|
|
300
|
-
flag: '--pxe',
|
|
301
|
-
description: 'Starts Aztec PXE with options',
|
|
302
|
-
defaultValue: undefined,
|
|
303
|
-
envVar: undefined,
|
|
304
|
-
},
|
|
305
|
-
...getOptions('pxe', allPxeConfigMappings),
|
|
306
|
-
],
|
|
307
185
|
ARCHIVER: [
|
|
308
186
|
{
|
|
309
187
|
flag: '--archiver',
|
|
310
188
|
description: 'Starts Aztec Archiver with options',
|
|
311
189
|
defaultValue: undefined,
|
|
312
|
-
|
|
190
|
+
env: undefined,
|
|
313
191
|
},
|
|
314
|
-
|
|
315
|
-
|
|
192
|
+
...getOptions(
|
|
193
|
+
'archiver',
|
|
194
|
+
omitConfigMappings(archiverConfigMappings, Object.keys(l1ContractsConfigMappings) as (keyof ArchiverConfig)[]),
|
|
195
|
+
),
|
|
316
196
|
],
|
|
317
197
|
SEQUENCER: [
|
|
318
198
|
{
|
|
319
199
|
flag: '--sequencer',
|
|
320
200
|
description: 'Starts Aztec Sequencer with options',
|
|
321
201
|
defaultValue: undefined,
|
|
322
|
-
|
|
202
|
+
env: undefined,
|
|
323
203
|
},
|
|
324
|
-
...getOptions(
|
|
204
|
+
...getOptions(
|
|
205
|
+
'sequencer',
|
|
206
|
+
omitConfigMappings(sequencerClientConfigMappings, [
|
|
207
|
+
'fakeProcessingDelayPerTxMs',
|
|
208
|
+
'skipCollectingAttestations',
|
|
209
|
+
'skipInvalidateBlockAsProposer',
|
|
210
|
+
'blobSinkMapSizeKb',
|
|
211
|
+
]),
|
|
212
|
+
),
|
|
325
213
|
],
|
|
326
214
|
'BLOB SINK': [
|
|
327
215
|
{
|
|
328
216
|
flag: '--blob-sink',
|
|
329
217
|
description: 'Starts Aztec Blob Sink with options',
|
|
330
218
|
defaultValue: undefined,
|
|
331
|
-
|
|
219
|
+
env: undefined,
|
|
332
220
|
},
|
|
333
221
|
...getOptions('blobSink', blobSinkConfigMappings),
|
|
334
222
|
],
|
|
@@ -337,22 +225,18 @@ export const aztecStartOptions: { [key: string]: AztecStartOption[] } = {
|
|
|
337
225
|
flag: '--prover-node',
|
|
338
226
|
description: 'Starts Aztec Prover Node with options',
|
|
339
227
|
defaultValue: undefined,
|
|
340
|
-
|
|
341
|
-
},
|
|
342
|
-
{
|
|
343
|
-
flag: '--proverNode.archiverUrl <value>',
|
|
344
|
-
description: 'URL for an archiver service',
|
|
345
|
-
defaultValue: undefined,
|
|
346
|
-
envVar: 'ARCHIVER_URL',
|
|
228
|
+
env: undefined,
|
|
347
229
|
},
|
|
348
230
|
...getOptions(
|
|
349
231
|
'proverNode',
|
|
350
232
|
omitConfigMappings(proverNodeConfigMappings, [
|
|
351
233
|
// filter out options passed separately
|
|
352
|
-
...(
|
|
353
|
-
...(
|
|
354
|
-
...(
|
|
355
|
-
...(
|
|
234
|
+
...getKeys(archiverConfigMappings),
|
|
235
|
+
...getKeys(proverBrokerConfigMappings),
|
|
236
|
+
...getKeys(proverAgentConfigMappings),
|
|
237
|
+
...getKeys(p2pConfigMappings),
|
|
238
|
+
...getKeys(worldStateConfigMappings),
|
|
239
|
+
...getKeys(sharedNodeConfigMappings),
|
|
356
240
|
]),
|
|
357
241
|
),
|
|
358
242
|
],
|
|
@@ -361,7 +245,7 @@ export const aztecStartOptions: { [key: string]: AztecStartOption[] } = {
|
|
|
361
245
|
flag: '--prover-broker',
|
|
362
246
|
description: 'Starts Aztec proving job broker',
|
|
363
247
|
defaultValue: undefined,
|
|
364
|
-
|
|
248
|
+
env: undefined,
|
|
365
249
|
},
|
|
366
250
|
...getOptions(
|
|
367
251
|
'proverBroker',
|
|
@@ -374,16 +258,25 @@ export const aztecStartOptions: { [key: string]: AztecStartOption[] } = {
|
|
|
374
258
|
flag: '--prover-agent',
|
|
375
259
|
description: 'Starts Aztec Prover Agent with options',
|
|
376
260
|
defaultValue: undefined,
|
|
377
|
-
|
|
261
|
+
env: undefined,
|
|
378
262
|
},
|
|
379
263
|
...getOptions('proverAgent', proverAgentConfigMappings),
|
|
380
264
|
],
|
|
265
|
+
'P2P SUBSYSTEM': [
|
|
266
|
+
{
|
|
267
|
+
flag: '--p2p-enabled [value]',
|
|
268
|
+
description: 'Enable P2P subsystem',
|
|
269
|
+
env: 'P2P_ENABLED',
|
|
270
|
+
...booleanConfigHelper(),
|
|
271
|
+
},
|
|
272
|
+
...getOptions('p2p', p2pConfigMappings),
|
|
273
|
+
],
|
|
381
274
|
'P2P BOOTSTRAP': [
|
|
382
275
|
{
|
|
383
276
|
flag: '--p2p-bootstrap',
|
|
384
277
|
description: 'Starts Aztec P2P Bootstrap with options',
|
|
385
278
|
defaultValue: undefined,
|
|
386
|
-
|
|
279
|
+
env: undefined,
|
|
387
280
|
},
|
|
388
281
|
...getOptions(
|
|
389
282
|
'p2pBootstrap',
|
|
@@ -396,43 +289,31 @@ export const aztecStartOptions: { [key: string]: AztecStartOption[] } = {
|
|
|
396
289
|
]),
|
|
397
290
|
),
|
|
398
291
|
],
|
|
292
|
+
TELEMETRY: [...getOptions('tel', telemetryClientConfigMappings)],
|
|
399
293
|
BOT: [
|
|
400
294
|
{
|
|
401
295
|
flag: '--bot',
|
|
402
296
|
description: 'Starts Aztec Bot with options',
|
|
403
297
|
defaultValue: undefined,
|
|
404
|
-
|
|
298
|
+
env: undefined,
|
|
405
299
|
},
|
|
406
300
|
...getOptions('bot', botConfigMappings),
|
|
407
301
|
],
|
|
408
|
-
|
|
302
|
+
PXE: [
|
|
409
303
|
{
|
|
410
|
-
flag: '--
|
|
411
|
-
description: 'Starts Aztec
|
|
304
|
+
flag: '--pxe',
|
|
305
|
+
description: 'Starts Aztec PXE with options',
|
|
412
306
|
defaultValue: undefined,
|
|
413
|
-
|
|
307
|
+
env: undefined,
|
|
414
308
|
},
|
|
309
|
+
...getOptions('pxe', allPxeConfigMappings),
|
|
415
310
|
],
|
|
416
|
-
|
|
311
|
+
TXE: [
|
|
417
312
|
{
|
|
418
|
-
flag: '--
|
|
419
|
-
description: 'Starts
|
|
313
|
+
flag: '--txe',
|
|
314
|
+
description: 'Starts Aztec TXE with options',
|
|
420
315
|
defaultValue: undefined,
|
|
421
|
-
|
|
422
|
-
},
|
|
423
|
-
{
|
|
424
|
-
flag: '--faucet.apiServer',
|
|
425
|
-
description: 'Starts a simple HTTP server to access the faucet',
|
|
426
|
-
defaultValue: true,
|
|
427
|
-
envVar: undefined,
|
|
428
|
-
},
|
|
429
|
-
{
|
|
430
|
-
flag: '--faucet.apiServerPort <value>',
|
|
431
|
-
description: 'The port on which to start the api server on',
|
|
432
|
-
defaultValue: 8080,
|
|
433
|
-
envVar: undefined,
|
|
434
|
-
parseVal: val => parseInt(val, 10),
|
|
316
|
+
env: undefined,
|
|
435
317
|
},
|
|
436
|
-
...getOptions('faucet', faucetConfigMapping),
|
|
437
318
|
],
|
|
438
319
|
};
|
|
@@ -5,15 +5,15 @@ import {
|
|
|
5
5
|
archiverConfigMappings,
|
|
6
6
|
getArchiverConfigFromEnv,
|
|
7
7
|
} from '@aztec/archiver';
|
|
8
|
-
import { createLogger } from '@aztec/aztec.js';
|
|
8
|
+
import { createLogger } from '@aztec/aztec.js/log';
|
|
9
9
|
import { type BlobSinkConfig, blobSinkConfigMapping, createBlobSinkClient } from '@aztec/blob-sink/client';
|
|
10
|
+
import { getL1Config } from '@aztec/cli/config';
|
|
10
11
|
import type { NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server';
|
|
11
12
|
import { type DataStoreConfig, dataConfigMappings } from '@aztec/kv-store/config';
|
|
12
13
|
import { createStore } from '@aztec/kv-store/lmdb-v2';
|
|
13
14
|
import { ArchiverApiSchema } from '@aztec/stdlib/interfaces/server';
|
|
14
15
|
import { getConfigEnvVars as getTelemetryClientConfig, initTelemetryClient } from '@aztec/telemetry-client';
|
|
15
16
|
|
|
16
|
-
import { getL1Config } from '../get_l1_config.js';
|
|
17
17
|
import { extractRelevantOptions } from '../util.js';
|
|
18
18
|
|
|
19
19
|
export type { ArchiverConfig, DataStoreConfig };
|
|
@@ -32,7 +32,7 @@ export async function startArchiver(
|
|
|
32
32
|
);
|
|
33
33
|
|
|
34
34
|
let archiverConfig = { ...envConfig, ...cliOptions };
|
|
35
|
-
archiverConfig.
|
|
35
|
+
archiverConfig.dataStoreMapSizeKb = archiverConfig.archiverStoreMapSizeKb ?? archiverConfig.dataStoreMapSizeKb;
|
|
36
36
|
|
|
37
37
|
if (!archiverConfig.l1Contracts.registryAddress || archiverConfig.l1Contracts.registryAddress.isZero()) {
|
|
38
38
|
throw new Error('L1 registry address is required to start an Archiver');
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
createBlobSinkServer,
|
|
5
5
|
getBlobSinkConfigFromEnv,
|
|
6
6
|
} from '@aztec/blob-sink/server';
|
|
7
|
+
import { getL1Config } from '@aztec/cli/config';
|
|
7
8
|
import type { LogFn } from '@aztec/foundation/log';
|
|
8
9
|
import { getConfigEnvVars as getTelemetryClientConfig, initTelemetryClient } from '@aztec/telemetry-client';
|
|
9
10
|
|
|
10
|
-
import { getL1Config } from '../get_l1_config.js';
|
|
11
11
|
import { extractRelevantOptions } from '../util.js';
|
|
12
12
|
|
|
13
13
|
export async function startBlobSink(options: any, signalHandlers: (() => Promise<void>)[], userLog: LogFn) {
|
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
import { type BotConfig, BotRunner, botConfigMappings, getBotRunnerApiHandler } from '@aztec/bot';
|
|
1
|
+
import { type BotConfig, BotRunner, BotStore, botConfigMappings, getBotRunnerApiHandler } from '@aztec/bot';
|
|
2
2
|
import type { NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server';
|
|
3
3
|
import type { LogFn } from '@aztec/foundation/log';
|
|
4
|
-
import
|
|
4
|
+
import { createStore, openTmpStore } from '@aztec/kv-store/lmdb-v2';
|
|
5
|
+
import { type CliPXEOptions, type PXEConfig, allPxeConfigMappings } from '@aztec/pxe/config';
|
|
6
|
+
import { type AztecNode, type AztecNodeAdmin, createAztecNodeClient } from '@aztec/stdlib/interfaces/client';
|
|
5
7
|
import type { TelemetryClient } from '@aztec/telemetry-client';
|
|
6
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
getConfigEnvVars as getTelemetryClientConfig,
|
|
10
|
+
initTelemetryClient,
|
|
11
|
+
makeTracedFetch,
|
|
12
|
+
} from '@aztec/telemetry-client';
|
|
13
|
+
import { TestWallet } from '@aztec/test-wallet/server';
|
|
7
14
|
|
|
8
15
|
import { extractRelevantOptions } from '../util.js';
|
|
16
|
+
import { getVersions } from '../versioning.js';
|
|
9
17
|
|
|
10
18
|
export async function startBot(
|
|
11
19
|
options: any,
|
|
@@ -20,26 +28,41 @@ export async function startBot(
|
|
|
20
28
|
);
|
|
21
29
|
process.exit(1);
|
|
22
30
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
31
|
+
|
|
32
|
+
const fetch = makeTracedFetch([1, 2, 3], true);
|
|
33
|
+
const config = extractRelevantOptions<BotConfig>(options, botConfigMappings, 'bot');
|
|
34
|
+
if (!config.nodeUrl) {
|
|
35
|
+
throw new Error('The bot requires access to a Node');
|
|
28
36
|
}
|
|
29
37
|
|
|
38
|
+
const aztecNode = createAztecNodeClient(config.nodeUrl, getVersions(), fetch);
|
|
39
|
+
|
|
40
|
+
const pxeConfig = extractRelevantOptions<PXEConfig & CliPXEOptions>(options, allPxeConfigMappings, 'pxe');
|
|
41
|
+
const wallet = await TestWallet.create(aztecNode, pxeConfig);
|
|
42
|
+
|
|
30
43
|
const telemetry = initTelemetryClient(getTelemetryClientConfig());
|
|
31
|
-
await addBot(options, signalHandlers, services,
|
|
44
|
+
await addBot(options, signalHandlers, services, wallet, aztecNode, telemetry, undefined);
|
|
32
45
|
}
|
|
33
46
|
|
|
34
|
-
export function addBot(
|
|
47
|
+
export async function addBot(
|
|
35
48
|
options: any,
|
|
36
49
|
signalHandlers: (() => Promise<void>)[],
|
|
37
50
|
services: NamespacedApiHandlers,
|
|
38
|
-
|
|
51
|
+
wallet: TestWallet,
|
|
52
|
+
aztecNode: AztecNode,
|
|
53
|
+
telemetry: TelemetryClient,
|
|
54
|
+
aztecNodeAdmin?: AztecNodeAdmin,
|
|
39
55
|
) {
|
|
40
56
|
const config = extractRelevantOptions<BotConfig>(options, botConfigMappings, 'bot');
|
|
41
57
|
|
|
42
|
-
const
|
|
58
|
+
const db = await (config.dataDirectory
|
|
59
|
+
? createStore('bot', BotStore.SCHEMA_VERSION, config)
|
|
60
|
+
: openTmpStore('bot', true, config.dataStoreMapSizeKb));
|
|
61
|
+
|
|
62
|
+
const store = new BotStore(db);
|
|
63
|
+
await store.cleanupOldClaims();
|
|
64
|
+
|
|
65
|
+
const botRunner = new BotRunner(config, wallet, aztecNode, telemetry, aztecNodeAdmin, store);
|
|
43
66
|
if (!config.noStart) {
|
|
44
67
|
void botRunner.start(); // Do not block since bot setup takes time
|
|
45
68
|
}
|