@aztec/aztec 0.0.1-fake-ceab37513c → 0.0.6-commit.a2d1860fe9
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 +1 -1
- package/dest/bin/index.d.ts +1 -1
- package/dest/bin/index.js +14 -9
- package/dest/cli/admin_api_key_store.d.ts +45 -0
- package/dest/cli/admin_api_key_store.d.ts.map +1 -0
- package/dest/cli/admin_api_key_store.js +98 -0
- package/dest/cli/aztec_start_action.d.ts +1 -1
- package/dest/cli/aztec_start_action.d.ts.map +1 -1
- package/dest/cli/aztec_start_action.js +59 -34
- 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 +46 -45
- package/dest/cli/cli.d.ts +1 -1
- package/dest/cli/cli.js +7 -7
- package/dest/cli/cmds/compile.d.ts +4 -0
- package/dest/cli/cmds/compile.d.ts.map +1 -0
- package/dest/cli/cmds/compile.js +95 -0
- package/dest/cli/cmds/migrate_ha_db.d.ts +3 -0
- package/dest/cli/cmds/migrate_ha_db.d.ts.map +1 -0
- package/dest/cli/cmds/migrate_ha_db.js +27 -0
- package/dest/cli/cmds/start_archiver.d.ts +1 -1
- package/dest/cli/cmds/start_archiver.d.ts.map +1 -1
- package/dest/cli/cmds/start_archiver.js +12 -14
- package/dest/cli/cmds/start_bot.d.ts +4 -7
- package/dest/cli/cmds/start_bot.d.ts.map +1 -1
- package/dest/cli/cmds/start_bot.js +18 -18
- package/dest/cli/cmds/start_node.d.ts +1 -1
- package/dest/cli/cmds/start_node.d.ts.map +1 -1
- package/dest/cli/cmds/start_node.js +71 -27
- package/dest/cli/cmds/start_p2p_bootstrap.d.ts +2 -2
- package/dest/cli/cmds/start_p2p_bootstrap.d.ts.map +1 -1
- package/dest/cli/cmds/start_p2p_bootstrap.js +2 -3
- package/dest/cli/cmds/start_prover_agent.d.ts +1 -1
- package/dest/cli/cmds/start_prover_agent.d.ts.map +1 -1
- package/dest/cli/cmds/start_prover_agent.js +4 -4
- package/dest/cli/cmds/start_prover_broker.d.ts +1 -1
- package/dest/cli/cmds/start_prover_broker.d.ts.map +1 -1
- package/dest/cli/cmds/start_prover_broker.js +4 -4
- package/dest/cli/cmds/start_txe.d.ts +1 -1
- package/dest/cli/index.d.ts +1 -1
- package/dest/cli/preload_crs.d.ts +1 -1
- package/dest/cli/release_version.d.ts +1 -1
- package/dest/cli/util.d.ts +12 -19
- package/dest/cli/util.d.ts.map +1 -1
- package/dest/cli/util.js +16 -11
- package/dest/cli/versioning.d.ts +1 -1
- package/dest/cli/versioning.js +3 -3
- package/dest/examples/token.d.ts +1 -1
- package/dest/examples/token.js +21 -19
- package/dest/examples/util.d.ts +3 -3
- package/dest/examples/util.d.ts.map +1 -1
- package/dest/examples/util.js +1 -1
- package/dest/index.d.ts +2 -2
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +1 -1
- package/dest/local-network/banana_fpc.d.ts +10 -0
- package/dest/local-network/banana_fpc.d.ts.map +1 -0
- package/dest/{sandbox → local-network}/banana_fpc.js +17 -21
- package/dest/local-network/index.d.ts +4 -0
- package/dest/local-network/index.d.ts.map +1 -0
- package/dest/local-network/index.js +3 -0
- package/dest/local-network/local-network.d.ts +73 -0
- package/dest/local-network/local-network.d.ts.map +1 -0
- package/dest/{sandbox/sandbox.js → local-network/local-network.js} +83 -66
- package/dest/local-network/sponsored_fpc.d.ts +5 -0
- package/dest/local-network/sponsored_fpc.d.ts.map +1 -0
- package/dest/{sandbox → local-network}/sponsored_fpc.js +7 -8
- package/dest/mnemonic.d.ts +1 -1
- package/dest/splash.d.ts +1 -1
- package/dest/testing/anvil_test_watcher.d.ts +12 -4
- package/dest/testing/anvil_test_watcher.d.ts.map +1 -1
- package/dest/testing/anvil_test_watcher.js +69 -31
- package/dest/testing/cheat_codes.d.ts +7 -8
- package/dest/testing/cheat_codes.d.ts.map +1 -1
- package/dest/testing/cheat_codes.js +9 -10
- package/dest/testing/epoch_test_settler.d.ts +19 -0
- package/dest/testing/epoch_test_settler.d.ts.map +1 -0
- package/dest/testing/epoch_test_settler.js +62 -0
- package/dest/testing/index.d.ts +2 -2
- package/dest/testing/index.d.ts.map +1 -1
- package/dest/testing/index.js +1 -1
- package/package.json +41 -37
- package/scripts/aztec.sh +62 -0
- package/scripts/extract_function.js +47 -0
- package/scripts/flamegraph.sh +59 -0
- package/scripts/init.sh +35 -0
- package/scripts/new.sh +59 -0
- package/scripts/setup_project.sh +31 -0
- package/src/bin/index.ts +15 -9
- package/src/cli/admin_api_key_store.ts +128 -0
- package/src/cli/aztec_start_action.ts +62 -26
- package/src/cli/aztec_start_options.ts +47 -43
- package/src/cli/cli.ts +11 -11
- package/src/cli/cmds/compile.ts +107 -0
- package/src/cli/cmds/migrate_ha_db.ts +43 -0
- package/src/cli/cmds/start_archiver.ts +8 -19
- package/src/cli/cmds/start_bot.ts +27 -15
- package/src/cli/cmds/start_node.ts +64 -23
- package/src/cli/cmds/start_p2p_bootstrap.ts +3 -3
- package/src/cli/cmds/start_prover_agent.ts +4 -12
- package/src/cli/cmds/start_prover_broker.ts +7 -3
- package/src/cli/util.ts +23 -26
- package/src/cli/versioning.ts +3 -3
- package/src/examples/token.ts +20 -19
- package/src/examples/util.ts +2 -2
- package/src/index.ts +5 -5
- package/src/{sandbox → local-network}/banana_fpc.ts +24 -25
- package/src/local-network/index.ts +7 -0
- package/src/local-network/local-network.ts +267 -0
- package/src/local-network/sponsored_fpc.ts +26 -0
- package/src/testing/anvil_test_watcher.ts +77 -34
- package/src/testing/cheat_codes.ts +13 -13
- package/src/testing/epoch_test_settler.ts +71 -0
- package/src/testing/index.ts +1 -1
- package/dest/cli/cmds/start_blob_sink.d.ts +0 -3
- package/dest/cli/cmds/start_blob_sink.d.ts.map +0 -1
- package/dest/cli/cmds/start_blob_sink.js +0 -33
- package/dest/cli/cmds/start_prover_node.d.ts +0 -7
- package/dest/cli/cmds/start_prover_node.d.ts.map +0 -1
- package/dest/cli/cmds/start_prover_node.js +0 -108
- 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/sandbox/banana_fpc.d.ts +0 -11
- package/dest/sandbox/banana_fpc.d.ts.map +0 -1
- package/dest/sandbox/index.d.ts +0 -4
- package/dest/sandbox/index.d.ts.map +0 -1
- package/dest/sandbox/index.js +0 -3
- package/dest/sandbox/sandbox.d.ts +0 -84
- package/dest/sandbox/sandbox.d.ts.map +0 -1
- package/dest/sandbox/sponsored_fpc.d.ts +0 -4
- package/dest/sandbox/sponsored_fpc.d.ts.map +0 -1
- 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/cmds/start_blob_sink.ts +0 -57
- package/src/cli/cmds/start_prover_node.ts +0 -124
- package/src/cli/cmds/start_pxe.ts +0 -49
- package/src/sandbox/index.ts +0 -4
- package/src/sandbox/sandbox.ts +0 -253
- package/src/sandbox/sponsored_fpc.ts +0 -27
- package/src/testing/aztec_cheat_codes.ts +0 -77
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ Aztec is a package that allows for a simple development environment on Aztec sta
|
|
|
8
8
|
|
|
9
9
|
The easiest way to run is by using `docker compose up`. This will create two containers:
|
|
10
10
|
|
|
11
|
-
1. The
|
|
11
|
+
1. The local network listening on port `8080`
|
|
12
12
|
2. An anvil instance listening on port `8545`
|
|
13
13
|
|
|
14
14
|
### Node Server
|
package/dest/bin/index.d.ts
CHANGED
package/dest/bin/index.js
CHANGED
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
//
|
|
3
3
|
import { injectCommands as injectBuilderCommands } from '@aztec/builder';
|
|
4
|
-
import { injectCommands as
|
|
5
|
-
import {
|
|
4
|
+
import { injectCommands as injectAztecNodeCommands } from '@aztec/cli/aztec_node';
|
|
5
|
+
import { enrichEnvironmentWithChainName } from '@aztec/cli/config/chain';
|
|
6
|
+
import { enrichEnvironmentWithNetworkConfig } from '@aztec/cli/config/network';
|
|
6
7
|
import { injectCommands as injectContractCommands } from '@aztec/cli/contracts';
|
|
7
8
|
import { injectCommands as injectInfrastructureCommands } from '@aztec/cli/infrastructure';
|
|
8
9
|
import { injectCommands as injectL1Commands } from '@aztec/cli/l1';
|
|
9
10
|
import { injectCommands as injectMiscCommands } from '@aztec/cli/misc';
|
|
10
|
-
import { injectCommands as
|
|
11
|
+
import { injectCommands as injectValidatorKeysCommands } from '@aztec/cli/validator_keys';
|
|
11
12
|
import { getActiveNetworkName } from '@aztec/foundation/config';
|
|
12
13
|
import { createConsoleLogger, createLogger } from '@aztec/foundation/log';
|
|
13
14
|
import { Command } from 'commander';
|
|
14
|
-
import {
|
|
15
|
+
import { injectCompileCommand } from '../cli/cmds/compile.js';
|
|
16
|
+
import { injectMigrateCommand } from '../cli/cmds/migrate_ha_db.js';
|
|
15
17
|
import { injectAztecCommands } from '../cli/index.js';
|
|
16
18
|
import { getCliVersion } from '../cli/release_version.js';
|
|
19
|
+
const NETWORK_FLAG = 'network';
|
|
17
20
|
const userLog = createConsoleLogger();
|
|
18
21
|
const debugLogger = createLogger('cli');
|
|
19
22
|
/** CLI & full node main entrypoint */ async function main() {
|
|
@@ -31,18 +34,20 @@ const debugLogger = createLogger('cli');
|
|
|
31
34
|
}
|
|
32
35
|
const networkName = getActiveNetworkName(networkValue);
|
|
33
36
|
await enrichEnvironmentWithNetworkConfig(networkName);
|
|
34
|
-
|
|
37
|
+
enrichEnvironmentWithChainName(networkName);
|
|
35
38
|
const cliVersion = getCliVersion();
|
|
36
39
|
let program = new Command('aztec');
|
|
37
|
-
program.description('Aztec command line interface').version(cliVersion);
|
|
40
|
+
program.description('Aztec command line interface').version(cliVersion).enablePositionalOptions();
|
|
38
41
|
program = injectAztecCommands(program, userLog, debugLogger);
|
|
39
42
|
program = injectBuilderCommands(program);
|
|
40
43
|
program = injectContractCommands(program, userLog, debugLogger);
|
|
41
|
-
program = injectInfrastructureCommands(program, userLog
|
|
44
|
+
program = injectInfrastructureCommands(program, userLog);
|
|
42
45
|
program = injectL1Commands(program, userLog, debugLogger);
|
|
43
|
-
program =
|
|
46
|
+
program = injectAztecNodeCommands(program, userLog, debugLogger);
|
|
44
47
|
program = injectMiscCommands(program, userLog);
|
|
45
|
-
program =
|
|
48
|
+
program = injectValidatorKeysCommands(program, userLog);
|
|
49
|
+
program = injectCompileCommand(program, userLog);
|
|
50
|
+
program = injectMigrateCommand(program, userLog);
|
|
46
51
|
await program.parseAsync(process.argv);
|
|
47
52
|
}
|
|
48
53
|
main().catch((err)=>{
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Logger } from '@aztec/foundation/log';
|
|
2
|
+
/**
|
|
3
|
+
* Result of resolving the admin API key.
|
|
4
|
+
* Contains the SHA-256 hex hash of the API key to be used by the auth middleware,
|
|
5
|
+
* and optionally the raw key when newly generated (so the caller can display it).
|
|
6
|
+
*/
|
|
7
|
+
export interface AdminApiKeyResolution {
|
|
8
|
+
/** The SHA-256 hash of the API key. */
|
|
9
|
+
apiKeyHash: Buffer;
|
|
10
|
+
/**
|
|
11
|
+
* The raw API key, only present when a new key was generated during this call.
|
|
12
|
+
* The caller MUST display this to the operator — it will not be stored or returned again.
|
|
13
|
+
*/
|
|
14
|
+
rawKey?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface ResolveAdminApiKeyOptions {
|
|
17
|
+
/** SHA-256 hex hash of a pre-generated API key. When set, the node uses this hash directly. */
|
|
18
|
+
adminApiKeyHash?: string;
|
|
19
|
+
/** If true, disable admin API key auth entirely. */
|
|
20
|
+
noAdminApiKey?: boolean;
|
|
21
|
+
/** If true, force-generate a new key even if one is already persisted. */
|
|
22
|
+
resetAdminApiKey?: boolean;
|
|
23
|
+
/** Root data directory for persistent storage. */
|
|
24
|
+
dataDirectory?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Resolves the admin API key for the admin RPC endpoint.
|
|
28
|
+
*
|
|
29
|
+
* Strategy:
|
|
30
|
+
* 1. If opt-out flag is set (`noAdminApiKey`), return undefined (no auth).
|
|
31
|
+
* 2. If a pre-generated hash is provided (`adminApiKeyHash`), use it directly.
|
|
32
|
+
* 3. If a data directory exists, look for a persisted hash file
|
|
33
|
+
* at `<dataDirectory>/admin/api_key_hash`:
|
|
34
|
+
* - If `resetAdminApiKey` is set, skip loading and force-generate a new key.
|
|
35
|
+
* - Found: use the stored hash (operator already saved the key from first run).
|
|
36
|
+
* - Not found: auto-generate a random key, display it once, persist the hash.
|
|
37
|
+
* 3. If no data directory: generate a random key
|
|
38
|
+
* each run and display it (cannot persist).
|
|
39
|
+
*
|
|
40
|
+
* @param options - The options for resolving the admin API key.
|
|
41
|
+
* @param log - Logger for outputting the key and status messages.
|
|
42
|
+
* @returns The resolved API key hash, or undefined if auth is disabled.
|
|
43
|
+
*/
|
|
44
|
+
export declare function resolveAdminApiKey(options: ResolveAdminApiKeyOptions, log: Logger): Promise<AdminApiKeyResolution | undefined>;
|
|
45
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWRtaW5fYXBpX2tleV9zdG9yZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NsaS9hZG1pbl9hcGlfa2V5X3N0b3JlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLE9BQU8sS0FBSyxFQUFFLE1BQU0sRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBU3BEOzs7O0dBSUc7QUFDSCxNQUFNLFdBQVcscUJBQXFCO0lBQ3BDLHVDQUF1QztJQUN2QyxVQUFVLEVBQUUsTUFBTSxDQUFDO0lBQ25COzs7T0FHRztJQUNILE1BQU0sQ0FBQyxFQUFFLE1BQU0sQ0FBQztDQUNqQjtBQUVELE1BQU0sV0FBVyx5QkFBeUI7SUFDeEMsK0ZBQStGO0lBQy9GLGVBQWUsQ0FBQyxFQUFFLE1BQU0sQ0FBQztJQUN6QixvREFBb0Q7SUFDcEQsYUFBYSxDQUFDLEVBQUUsT0FBTyxDQUFDO0lBQ3hCLDBFQUEwRTtJQUMxRSxnQkFBZ0IsQ0FBQyxFQUFFLE9BQU8sQ0FBQztJQUMzQixrREFBa0Q7SUFDbEQsYUFBYSxDQUFDLEVBQUUsTUFBTSxDQUFDO0NBQ3hCO0FBRUQ7Ozs7Ozs7Ozs7Ozs7Ozs7O0dBaUJHO0FBQ0gsd0JBQXNCLGtCQUFrQixDQUN0QyxPQUFPLEVBQUUseUJBQXlCLEVBQ2xDLEdBQUcsRUFBRSxNQUFNLEdBQ1YsT0FBTyxDQUFDLHFCQUFxQixHQUFHLFNBQVMsQ0FBQyxDQTJENUMifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin_api_key_store.d.ts","sourceRoot":"","sources":["../../src/cli/admin_api_key_store.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AASpD;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC,uCAAuC;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,yBAAyB;IACxC,+FAA+F;IAC/F,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,oDAAoD;IACpD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,0EAA0E;IAC1E,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,kDAAkD;IAClD,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,yBAAyB,EAClC,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CA2D5C"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { randomBytes } from '@aztec/foundation/crypto/random';
|
|
2
|
+
import { sha256Hash } from '@aztec/foundation/json-rpc/server';
|
|
3
|
+
import { promises as fs } from 'fs';
|
|
4
|
+
import { join } from 'path';
|
|
5
|
+
/** Subdirectory under dataDirectory for admin API key storage. */ const ADMIN_STORE_DIR = 'admin';
|
|
6
|
+
const HASH_FILE_NAME = 'api_key_hash';
|
|
7
|
+
/**
|
|
8
|
+
* Resolves the admin API key for the admin RPC endpoint.
|
|
9
|
+
*
|
|
10
|
+
* Strategy:
|
|
11
|
+
* 1. If opt-out flag is set (`noAdminApiKey`), return undefined (no auth).
|
|
12
|
+
* 2. If a pre-generated hash is provided (`adminApiKeyHash`), use it directly.
|
|
13
|
+
* 3. If a data directory exists, look for a persisted hash file
|
|
14
|
+
* at `<dataDirectory>/admin/api_key_hash`:
|
|
15
|
+
* - If `resetAdminApiKey` is set, skip loading and force-generate a new key.
|
|
16
|
+
* - Found: use the stored hash (operator already saved the key from first run).
|
|
17
|
+
* - Not found: auto-generate a random key, display it once, persist the hash.
|
|
18
|
+
* 3. If no data directory: generate a random key
|
|
19
|
+
* each run and display it (cannot persist).
|
|
20
|
+
*
|
|
21
|
+
* @param options - The options for resolving the admin API key.
|
|
22
|
+
* @param log - Logger for outputting the key and status messages.
|
|
23
|
+
* @returns The resolved API key hash, or undefined if auth is disabled.
|
|
24
|
+
*/ export async function resolveAdminApiKey(options, log) {
|
|
25
|
+
// Operator explicitly opted out of admin auth
|
|
26
|
+
if (options.noAdminApiKey) {
|
|
27
|
+
log.warn('Admin API key authentication is DISABLED (--no-admin-api-key / AZTEC_NO_ADMIN_API_KEY)');
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
// Operator provided a pre-generated hash (e.g. via AZTEC_ADMIN_API_KEY_HASH env var)
|
|
31
|
+
if (options.adminApiKeyHash) {
|
|
32
|
+
const hex = options.adminApiKeyHash.trim();
|
|
33
|
+
if (hex.length !== 64 || !/^[0-9a-f]{64}$/.test(hex)) {
|
|
34
|
+
throw new Error(`Invalid admin API key hash: expected 64-char hex string, got "${hex}"`);
|
|
35
|
+
}
|
|
36
|
+
log.info('Admin API key authentication enabled (using pre-configured key hash)');
|
|
37
|
+
return {
|
|
38
|
+
apiKeyHash: Buffer.from(hex, 'hex')
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
// Persistent storage available, load or generate key
|
|
42
|
+
if (options.dataDirectory) {
|
|
43
|
+
const adminDir = join(options.dataDirectory, ADMIN_STORE_DIR);
|
|
44
|
+
const hashFilePath = join(adminDir, HASH_FILE_NAME);
|
|
45
|
+
// Unless a reset is forced, try to load the existing hash from disk
|
|
46
|
+
if (!options.resetAdminApiKey) {
|
|
47
|
+
try {
|
|
48
|
+
const storedHash = (await fs.readFile(hashFilePath, 'utf-8')).trim();
|
|
49
|
+
if (storedHash.length === 64) {
|
|
50
|
+
log.info('Admin API key authentication enabled (loaded stored key hash from disk)');
|
|
51
|
+
return {
|
|
52
|
+
apiKeyHash: Buffer.from(storedHash, 'hex')
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
log.warn(`Invalid stored admin API key hash at ${hashFilePath}, regenerating...`);
|
|
56
|
+
} catch (err) {
|
|
57
|
+
if (err.code !== 'ENOENT') {
|
|
58
|
+
log.warn(`Failed to read admin API key hash from ${hashFilePath}: ${err.message}`);
|
|
59
|
+
}
|
|
60
|
+
// File doesn't exist — fall through to generate
|
|
61
|
+
}
|
|
62
|
+
} else {
|
|
63
|
+
log.warn('Admin API key reset requested — generating a new key');
|
|
64
|
+
}
|
|
65
|
+
// Generate a new key, persist the hash, and return the raw key for the caller to display
|
|
66
|
+
const { rawKey, hash } = generateApiKey();
|
|
67
|
+
await fs.mkdir(adminDir, {
|
|
68
|
+
recursive: true
|
|
69
|
+
});
|
|
70
|
+
await fs.writeFile(hashFilePath, hash.toString('hex'), 'utf-8');
|
|
71
|
+
// Set restrictive permissions (owner read/write only)
|
|
72
|
+
await fs.chmod(hashFilePath, 0o600);
|
|
73
|
+
log.info('Admin API key authentication enabled (new key generated and hash persisted to disk)');
|
|
74
|
+
return {
|
|
75
|
+
apiKeyHash: hash,
|
|
76
|
+
rawKey
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
// No data directory, generate a temporary key per session
|
|
80
|
+
const { rawKey, hash } = generateApiKey();
|
|
81
|
+
log.warn('No data directory configured — admin API key cannot be persisted.');
|
|
82
|
+
log.warn('A temporary key has been generated for this session only.');
|
|
83
|
+
return {
|
|
84
|
+
apiKeyHash: hash,
|
|
85
|
+
rawKey
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Generates a cryptographically random API key and its SHA-256 hash.
|
|
90
|
+
* @returns The raw key (hex string) and its SHA-256 hash as a Buffer.
|
|
91
|
+
*/ function generateApiKey() {
|
|
92
|
+
const rawKey = randomBytes(32).toString('hex');
|
|
93
|
+
const hash = sha256Hash(rawKey);
|
|
94
|
+
return {
|
|
95
|
+
rawKey,
|
|
96
|
+
hash
|
|
97
|
+
};
|
|
98
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { LogFn, Logger } from '@aztec/foundation/log';
|
|
2
2
|
export declare function aztecStart(options: any, userLog: LogFn, debugLogger: Logger): Promise<void>;
|
|
3
|
-
//# sourceMappingURL=
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXp0ZWNfc3RhcnRfYWN0aW9uLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY2xpL2F6dGVjX3N0YXJ0X2FjdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFNQSxPQUFPLEtBQUssRUFBRSxLQUFLLEVBQUUsTUFBTSxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFhM0Qsd0JBQXNCLFVBQVUsQ0FBQyxPQUFPLEVBQUUsR0FBRyxFQUFFLE9BQU8sRUFBRSxLQUFLLEVBQUUsV0FBVyxFQUFFLE1BQU0saUJBd0lqRiJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aztec_start_action.d.ts","sourceRoot":"","sources":["../../src/cli/aztec_start_action.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"aztec_start_action.d.ts","sourceRoot":"","sources":["../../src/cli/aztec_start_action.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAa3D,wBAAsB,UAAU,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,iBAwIjF"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { createNamespacedSafeJsonRpcServer, startHttpRpcServer } from '@aztec/foundation/json-rpc/server';
|
|
2
|
-
import { AztecNodeApiSchema
|
|
1
|
+
import { createNamespacedSafeJsonRpcServer, getApiKeyAuthMiddleware, startHttpRpcServer } from '@aztec/foundation/json-rpc/server';
|
|
2
|
+
import { AztecNodeApiSchema } from '@aztec/stdlib/interfaces/client';
|
|
3
3
|
import { getVersioningMiddleware } from '@aztec/stdlib/versioning';
|
|
4
4
|
import { getOtelJsonRpcPropagationMiddleware } from '@aztec/telemetry-client';
|
|
5
|
-
import {
|
|
5
|
+
import { createLocalNetwork } from '../local-network/index.js';
|
|
6
6
|
import { github, splash } from '../splash.js';
|
|
7
|
+
import { resolveAdminApiKey } from './admin_api_key_store.js';
|
|
7
8
|
import { getCliVersion } from './release_version.js';
|
|
8
9
|
import { extractNamespacedOptions, installSignalHandlers } from './util.js';
|
|
9
10
|
import { getVersions } from './versioning.js';
|
|
@@ -13,19 +14,22 @@ export async function aztecStart(options, userLog, debugLogger) {
|
|
|
13
14
|
const services = {};
|
|
14
15
|
const adminServices = {};
|
|
15
16
|
let config = undefined;
|
|
16
|
-
if (options.
|
|
17
|
+
if (options.localNetwork) {
|
|
17
18
|
const cliVersion = getCliVersion();
|
|
18
|
-
const
|
|
19
|
-
|
|
19
|
+
const localNetwork = extractNamespacedOptions(options, 'local-network');
|
|
20
|
+
localNetwork.testAccounts = true;
|
|
20
21
|
userLog(`${splash}\n${github}\n\n`);
|
|
21
|
-
userLog(`Setting up Aztec
|
|
22
|
-
const { node,
|
|
23
|
-
l1Mnemonic:
|
|
22
|
+
userLog(`Setting up Aztec local network ${cliVersion}, please stand by...`);
|
|
23
|
+
const { node, stop } = await createLocalNetwork({
|
|
24
|
+
l1Mnemonic: localNetwork.l1Mnemonic,
|
|
24
25
|
l1RpcUrls: options.l1RpcUrls,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
testAccounts: localNetwork.testAccounts,
|
|
27
|
+
realProofs: false,
|
|
28
|
+
// Setting the epoch duration to 2 by default for local network. This allows the epoch to be "proven" faster, so
|
|
29
|
+
// the users can consume out hash without having to wait for a long time.
|
|
30
|
+
// Note: We are not proving anything in the local network (realProofs == false). But in `createLocalNetwork`,
|
|
31
|
+
// the EpochTestSettler will set the out hash to the outbox when an epoch is complete.
|
|
32
|
+
aztecEpochDuration: 2
|
|
29
33
|
}, userLog);
|
|
30
34
|
// Start Node and PXE JSON-RPC server
|
|
31
35
|
signalHandlers.push(stop);
|
|
@@ -33,30 +37,17 @@ export async function aztecStart(options, userLog, debugLogger) {
|
|
|
33
37
|
node,
|
|
34
38
|
AztecNodeApiSchema
|
|
35
39
|
];
|
|
36
|
-
if (!sandboxOptions.noPXE) {
|
|
37
|
-
services.pxe = [
|
|
38
|
-
pxe,
|
|
39
|
-
PXESchema
|
|
40
|
-
];
|
|
41
|
-
} else {
|
|
42
|
-
userLog(`Not exposing PXE API through JSON-RPC server`);
|
|
43
|
-
}
|
|
44
40
|
} else {
|
|
41
|
+
// Route --prover-node through startNode
|
|
42
|
+
if (options.proverNode && !options.node) {
|
|
43
|
+
options.node = true;
|
|
44
|
+
}
|
|
45
45
|
if (options.node) {
|
|
46
46
|
const { startNode } = await import('./cmds/start_node.js');
|
|
47
47
|
({ config } = await startNode(options, signalHandlers, services, adminServices, userLog));
|
|
48
48
|
} else if (options.bot) {
|
|
49
49
|
const { startBot } = await import('./cmds/start_bot.js');
|
|
50
50
|
await startBot(options, signalHandlers, services, userLog);
|
|
51
|
-
} else if (options.proverNode) {
|
|
52
|
-
const { startProverNode } = await import('./cmds/start_prover_node.js');
|
|
53
|
-
({ config } = await startProverNode(options, signalHandlers, services, userLog));
|
|
54
|
-
} else if (options.blobSink) {
|
|
55
|
-
const { startBlobSink } = await import('./cmds/start_blob_sink.js');
|
|
56
|
-
await startBlobSink(options, signalHandlers, userLog);
|
|
57
|
-
} else if (options.pxe) {
|
|
58
|
-
const { startPXE } = await import('./cmds/start_pxe.js');
|
|
59
|
-
({ config } = await startPXE(options, signalHandlers, services, userLog));
|
|
60
51
|
} else if (options.archiver) {
|
|
61
52
|
const { startArchiver } = await import('./cmds/start_archiver.js');
|
|
62
53
|
({ config } = await startArchiver(options, signalHandlers, services));
|
|
@@ -101,13 +92,26 @@ export async function aztecStart(options, userLog, debugLogger) {
|
|
|
101
92
|
}
|
|
102
93
|
// If there are any admin services, start a separate JSON-RPC server for them
|
|
103
94
|
if (Object.entries(adminServices).length > 0) {
|
|
95
|
+
const adminMiddlewares = [
|
|
96
|
+
getOtelJsonRpcPropagationMiddleware(),
|
|
97
|
+
getVersioningMiddleware(versions)
|
|
98
|
+
];
|
|
99
|
+
// Resolve the admin API key (auto-generated and persisted, or opt-out)
|
|
100
|
+
const apiKeyResolution = await resolveAdminApiKey({
|
|
101
|
+
adminApiKeyHash: options.adminApiKeyHash,
|
|
102
|
+
noAdminApiKey: options.noAdminApiKey,
|
|
103
|
+
resetAdminApiKey: options.resetAdminApiKey,
|
|
104
|
+
dataDirectory: options.dataDirectory
|
|
105
|
+
}, debugLogger);
|
|
106
|
+
if (apiKeyResolution) {
|
|
107
|
+
adminMiddlewares.unshift(getApiKeyAuthMiddleware(apiKeyResolution.apiKeyHash));
|
|
108
|
+
} else {
|
|
109
|
+
debugLogger.warn('No admin API key set — admin endpoint is unauthenticated');
|
|
110
|
+
}
|
|
104
111
|
const rpcServer = createNamespacedSafeJsonRpcServer(adminServices, {
|
|
105
112
|
http200OnError: false,
|
|
106
113
|
log: debugLogger,
|
|
107
|
-
middlewares:
|
|
108
|
-
getOtelJsonRpcPropagationMiddleware(),
|
|
109
|
-
getVersioningMiddleware(versions)
|
|
110
|
-
],
|
|
114
|
+
middlewares: adminMiddlewares,
|
|
111
115
|
maxBatchSize: options.rpcMaxBatchSize,
|
|
112
116
|
maxBodySizeBytes: options.rpcMaxBodySize
|
|
113
117
|
});
|
|
@@ -115,5 +119,26 @@ export async function aztecStart(options, userLog, debugLogger) {
|
|
|
115
119
|
port: options.adminPort
|
|
116
120
|
});
|
|
117
121
|
debugLogger.info(`Aztec Server admin API listening on port ${port}`, versions);
|
|
122
|
+
// Display the API key after the server has started
|
|
123
|
+
// Uses userLog which is never filtered by LOG_LEVEL.
|
|
124
|
+
if (apiKeyResolution?.rawKey) {
|
|
125
|
+
const separator = '='.repeat(70);
|
|
126
|
+
userLog('');
|
|
127
|
+
userLog(separator);
|
|
128
|
+
userLog(' ADMIN API KEY (save this — it will NOT be shown again)');
|
|
129
|
+
userLog('');
|
|
130
|
+
userLog(` ${apiKeyResolution.rawKey}`);
|
|
131
|
+
userLog('');
|
|
132
|
+
userLog(` Use via header: x-api-key: <key>`);
|
|
133
|
+
userLog(` Or via header: Authorization: Bearer <key>`);
|
|
134
|
+
if (options.dataDirectory) {
|
|
135
|
+
userLog('');
|
|
136
|
+
userLog(' The key hash has been persisted — on next restart, the same key will be used.');
|
|
137
|
+
}
|
|
138
|
+
userLog('');
|
|
139
|
+
userLog(' To disable admin auth: --no-admin-api-key or AZTEC_NO_ADMIN_API_KEY=true');
|
|
140
|
+
userLog(separator);
|
|
141
|
+
userLog('');
|
|
142
|
+
}
|
|
118
143
|
}
|
|
119
144
|
}
|
|
@@ -14,4 +14,4 @@ export declare const NETWORK_FLAG = "network";
|
|
|
14
14
|
export declare const aztecStartOptions: {
|
|
15
15
|
[key: string]: AztecStartOption[];
|
|
16
16
|
};
|
|
17
|
-
//# sourceMappingURL=
|
|
17
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXp0ZWNfc3RhcnRfb3B0aW9ucy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NsaS9henRlY19zdGFydF9vcHRpb25zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQU9BLE9BQU8sRUFDTCxLQUFLLGFBQWEsRUFDbEIsS0FBSyxNQUFNLEVBSVosTUFBTSwwQkFBMEIsQ0FBQztBQWVsQyxNQUFNLFdBQVcsZ0JBQWdCO0lBQy9CLElBQUksRUFBRSxNQUFNLENBQUM7SUFDYixXQUFXLEVBQUUsTUFBTSxDQUFDO0lBQ3BCLFlBQVksRUFBRSxHQUFHLENBQUM7SUFDbEIsWUFBWSxDQUFDLEVBQUUsQ0FBQyxHQUFHLEVBQUUsR0FBRyxLQUFLLE1BQU0sQ0FBQztJQUNwQyxHQUFHLEVBQUUsTUFBTSxHQUFHLFNBQVMsQ0FBQztJQUN4QixRQUFRLENBQUMsRUFBRSxNQUFNLEVBQUUsQ0FBQztJQUNwQixRQUFRLENBQUMsRUFBRSxDQUFDLEdBQUcsRUFBRSxNQUFNLEtBQUssR0FBRyxDQUFDO0NBQ2pDO0FBRUQsZUFBTyxNQUFNLFVBQVUsMEZBb0J0QixDQUFDO0FBdUJGLGVBQU8sTUFBTSxnQkFBZ0IsVUFZNUIsQ0FBQztBQUVGLGVBQU8sTUFBTSxZQUFZLFlBQVksQ0FBQztBQUd0QyxlQUFPLE1BQU0saUJBQWlCLEVBQUU7SUFBRSxDQUFDLEdBQUcsRUFBRSxNQUFNLEdBQUcsZ0JBQWdCLEVBQUUsQ0FBQTtDQXNPbEUsQ0FBQyJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aztec_start_options.d.ts","sourceRoot":"","sources":["../../src/cli/aztec_start_options.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"aztec_start_options.d.ts","sourceRoot":"","sources":["../../src/cli/aztec_start_options.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,MAAM,EAIZ,MAAM,0BAA0B,CAAC;AAelC,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,GAAG,CAAC;IAClB,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,MAAM,CAAC;IACpC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,GAAG,CAAC;CACjC;AAED,eAAO,MAAM,UAAU,0FAoBtB,CAAC;AAuBF,eAAO,MAAM,gBAAgB,UAY5B,CAAC;AAEF,eAAO,MAAM,YAAY,YAAY,CAAC;AAGtC,eAAO,MAAM,iBAAiB,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAAA;CAsOlE,CAAC"}
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { archiverConfigMappings } from '@aztec/archiver/config';
|
|
2
|
-
import {
|
|
3
|
-
import { blobSinkConfigMappings } from '@aztec/blob-sink/server';
|
|
2
|
+
import { blobClientConfigMapping } from '@aztec/blob-client/client/config';
|
|
4
3
|
import { botConfigMappings } from '@aztec/bot/config';
|
|
5
|
-
import {
|
|
4
|
+
import { l1ContractsConfigMappings } from '@aztec/ethereum/config';
|
|
5
|
+
import { l1ContractAddressesMapping } from '@aztec/ethereum/l1-contract-addresses';
|
|
6
|
+
import { l1ReaderConfigMappings } from '@aztec/ethereum/l1-reader';
|
|
6
7
|
import { getKeys } from '@aztec/foundation/collection';
|
|
7
8
|
import { booleanConfigHelper, isBooleanConfigValue, omitConfigMappings } from '@aztec/foundation/config';
|
|
8
9
|
import { dataConfigMappings } from '@aztec/kv-store/config';
|
|
9
10
|
import { sharedNodeConfigMappings } from '@aztec/node-lib/config';
|
|
10
11
|
import { bootnodeConfigMappings, p2pConfigMappings } from '@aztec/p2p/config';
|
|
11
|
-
import { proverAgentConfigMappings, proverBrokerConfigMappings } from '@aztec/prover-client/broker';
|
|
12
|
+
import { proverAgentConfigMappings, proverBrokerConfigMappings } from '@aztec/prover-client/broker/config';
|
|
12
13
|
import { proverNodeConfigMappings } from '@aztec/prover-node/config';
|
|
13
14
|
import { allPxeConfigMappings } from '@aztec/pxe/config';
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
15
|
+
import { sequencerClientConfigMappings } from '@aztec/sequencer-client/config';
|
|
16
|
+
import { chainConfigMappings, nodeRpcConfigMappings } from '@aztec/stdlib/config';
|
|
17
|
+
import { telemetryClientConfigMappings } from '@aztec/telemetry-client/config';
|
|
18
|
+
import { worldStateConfigMappings } from '@aztec/world-state/config';
|
|
17
19
|
import { DefaultMnemonic } from '../mnemonic.js';
|
|
18
20
|
export const getOptions = (namespace, configMappings)=>{
|
|
19
21
|
const options = [];
|
|
@@ -56,6 +58,7 @@ export const universalOptions = [
|
|
|
56
58
|
'l1ConsensusHostApiKeys',
|
|
57
59
|
'l1ConsensusHostApiKeyHeaders',
|
|
58
60
|
'p2pEnabled',
|
|
61
|
+
'fishermanMode',
|
|
59
62
|
...getKeys(chainConfigMappings),
|
|
60
63
|
...getKeys(l1ContractsConfigMappings),
|
|
61
64
|
...getKeys(l1ContractAddressesMapping),
|
|
@@ -76,33 +79,21 @@ export const aztecStartOptions = {
|
|
|
76
79
|
configToFlag('--auto-update', sharedNodeConfigMappings.autoUpdate),
|
|
77
80
|
configToFlag('--auto-update-url', sharedNodeConfigMappings.autoUpdateUrl),
|
|
78
81
|
configToFlag('--sync-mode', sharedNodeConfigMappings.syncMode),
|
|
79
|
-
configToFlag('--snapshots-urls', sharedNodeConfigMappings.snapshotsUrls)
|
|
82
|
+
configToFlag('--snapshots-urls', sharedNodeConfigMappings.snapshotsUrls),
|
|
83
|
+
configToFlag('--fisherman-mode', sharedNodeConfigMappings.fishermanMode)
|
|
80
84
|
],
|
|
81
|
-
|
|
85
|
+
LOCAL_NETWORK: [
|
|
82
86
|
{
|
|
83
|
-
flag: '--
|
|
84
|
-
description: 'Starts Aztec
|
|
87
|
+
flag: '--local-network',
|
|
88
|
+
description: 'Starts Aztec Local Network',
|
|
85
89
|
defaultValue: undefined,
|
|
86
90
|
env: undefined
|
|
87
91
|
},
|
|
88
92
|
{
|
|
89
|
-
flag: '--
|
|
90
|
-
description: 'Do not expose PXE service on sandbox start',
|
|
91
|
-
env: 'NO_PXE',
|
|
92
|
-
...booleanConfigHelper()
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
flag: '--sandbox.l1Mnemonic <value>',
|
|
93
|
+
flag: '--local-network.l1Mnemonic <value>',
|
|
96
94
|
description: 'Mnemonic for L1 accounts. Will be used ',
|
|
97
95
|
defaultValue: DefaultMnemonic,
|
|
98
96
|
env: 'MNEMONIC'
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
flag: '--sandbox.deployAztecContractsSalt <value>',
|
|
102
|
-
description: 'Numeric salt for deploying L1 Aztec contracts before starting the sandbox. Needs mnemonic or private key to be set.',
|
|
103
|
-
env: 'DEPLOY_AZTEC_CONTRACTS_SALT',
|
|
104
|
-
defaultValue: undefined,
|
|
105
|
-
parseVal: (val)=>val ? parseInt(val) : undefined
|
|
106
97
|
}
|
|
107
98
|
],
|
|
108
99
|
API: [
|
|
@@ -115,17 +106,39 @@ export const aztecStartOptions = {
|
|
|
115
106
|
},
|
|
116
107
|
{
|
|
117
108
|
flag: '--admin-port <value>',
|
|
118
|
-
description: 'Port to run admin APIs of Aztec Services on
|
|
109
|
+
description: 'Port to run admin APIs of Aztec Services on',
|
|
119
110
|
defaultValue: 8880,
|
|
120
111
|
env: 'AZTEC_ADMIN_PORT',
|
|
121
112
|
parseVal: (val)=>parseInt(val, 10)
|
|
122
113
|
},
|
|
114
|
+
{
|
|
115
|
+
flag: '--admin-api-key-hash <value>',
|
|
116
|
+
description: 'SHA-256 hex hash of a pre-generated admin API key. When set, the node uses this hash for authentication instead of auto-generating a key.',
|
|
117
|
+
defaultValue: undefined,
|
|
118
|
+
env: 'AZTEC_ADMIN_API_KEY_HASH'
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
flag: '--no-admin-api-key',
|
|
122
|
+
description: 'Disable API key authentication on the admin RPC endpoint. By default, a key is auto-generated, displayed once, and its hash is persisted.',
|
|
123
|
+
defaultValue: false,
|
|
124
|
+
env: 'AZTEC_NO_ADMIN_API_KEY',
|
|
125
|
+
parseVal: (val)=>val === 'true' || val === '1'
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
flag: '--reset-admin-api-key',
|
|
129
|
+
description: 'Force-generate a new admin API key, replacing any previously persisted key hash. The new key is displayed once at startup.',
|
|
130
|
+
defaultValue: false,
|
|
131
|
+
env: 'AZTEC_RESET_ADMIN_API_KEY',
|
|
132
|
+
parseVal: (val)=>val === 'true' || val === '1'
|
|
133
|
+
},
|
|
123
134
|
{
|
|
124
135
|
flag: '--api-prefix <value>',
|
|
125
136
|
description: 'Prefix for API routes on any service that is started',
|
|
126
137
|
defaultValue: '',
|
|
127
138
|
env: 'API_PREFIX'
|
|
128
|
-
}
|
|
139
|
+
},
|
|
140
|
+
configToFlag('--rpcMaxBatchSize', nodeRpcConfigMappings.rpcMaxBatchSize),
|
|
141
|
+
configToFlag('--rpcMaxBodySize', nodeRpcConfigMappings.rpcMaxBodySize)
|
|
129
142
|
],
|
|
130
143
|
ETHEREUM: [
|
|
131
144
|
configToFlag('--l1-chain-id', l1ReaderConfigMappings.l1ChainId),
|
|
@@ -134,9 +147,9 @@ export const aztecStartOptions = {
|
|
|
134
147
|
...l1ReaderConfigMappings.l1RpcUrls,
|
|
135
148
|
defaultValue: undefined
|
|
136
149
|
}),
|
|
137
|
-
configToFlag('--l1-consensus-host-urls',
|
|
138
|
-
configToFlag('--l1-consensus-host-api-keys',
|
|
139
|
-
configToFlag('--l1-consensus-host-api-key-headers',
|
|
150
|
+
configToFlag('--l1-consensus-host-urls', blobClientConfigMapping.l1ConsensusHostUrls),
|
|
151
|
+
configToFlag('--l1-consensus-host-api-keys', blobClientConfigMapping.l1ConsensusHostApiKeys),
|
|
152
|
+
configToFlag('--l1-consensus-host-api-key-headers', blobClientConfigMapping.l1ConsensusHostApiKeyHeaders)
|
|
140
153
|
],
|
|
141
154
|
'L1 CONTRACTS': [
|
|
142
155
|
configToFlag('--registry-address', l1ContractAddressesMapping.registryAddress),
|
|
@@ -149,7 +162,7 @@ export const aztecStartOptions = {
|
|
|
149
162
|
'WORLD STATE': [
|
|
150
163
|
configToFlag('--world-state-data-directory', worldStateConfigMappings.worldStateDataDirectory),
|
|
151
164
|
configToFlag('--world-state-db-map-size-kb', worldStateConfigMappings.worldStateDbMapSizeKb),
|
|
152
|
-
configToFlag('--world-state-
|
|
165
|
+
configToFlag('--world-state-checkpoint-history', worldStateConfigMappings.worldStateCheckpointHistory)
|
|
153
166
|
],
|
|
154
167
|
// We can't easily auto-generate node options as they're parts of modules defined below
|
|
155
168
|
'AZTEC NODE': [
|
|
@@ -178,20 +191,12 @@ export const aztecStartOptions = {
|
|
|
178
191
|
},
|
|
179
192
|
...getOptions('sequencer', omitConfigMappings(sequencerClientConfigMappings, [
|
|
180
193
|
'fakeProcessingDelayPerTxMs',
|
|
194
|
+
'fakeThrowAfterProcessingTxCount',
|
|
181
195
|
'skipCollectingAttestations',
|
|
182
196
|
'skipInvalidateBlockAsProposer',
|
|
183
197
|
'blobSinkMapSizeKb'
|
|
184
198
|
]))
|
|
185
199
|
],
|
|
186
|
-
'BLOB SINK': [
|
|
187
|
-
{
|
|
188
|
-
flag: '--blob-sink',
|
|
189
|
-
description: 'Starts Aztec Blob Sink with options',
|
|
190
|
-
defaultValue: undefined,
|
|
191
|
-
env: undefined
|
|
192
|
-
},
|
|
193
|
-
...getOptions('blobSink', blobSinkConfigMappings)
|
|
194
|
-
],
|
|
195
200
|
'PROVER NODE': [
|
|
196
201
|
{
|
|
197
202
|
flag: '--prover-node',
|
|
@@ -201,12 +206,8 @@ export const aztecStartOptions = {
|
|
|
201
206
|
},
|
|
202
207
|
...getOptions('proverNode', omitConfigMappings(proverNodeConfigMappings, [
|
|
203
208
|
// filter out options passed separately
|
|
204
|
-
...getKeys(archiverConfigMappings),
|
|
205
209
|
...getKeys(proverBrokerConfigMappings),
|
|
206
|
-
...getKeys(proverAgentConfigMappings)
|
|
207
|
-
...getKeys(p2pConfigMappings),
|
|
208
|
-
...getKeys(worldStateConfigMappings),
|
|
209
|
-
...getKeys(sharedNodeConfigMappings)
|
|
210
|
+
...getKeys(proverAgentConfigMappings)
|
|
210
211
|
]))
|
|
211
212
|
],
|
|
212
213
|
'PROVER BROKER': [
|
package/dest/cli/cli.d.ts
CHANGED
|
@@ -6,4 +6,4 @@ import { Command } from 'commander';
|
|
|
6
6
|
* @param debugLogger - logger for logging debug messages.
|
|
7
7
|
*/
|
|
8
8
|
export declare function injectAztecCommands(program: Command, userLog: LogFn, debugLogger: Logger): Command;
|
|
9
|
-
//# sourceMappingURL=
|
|
9
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xpLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY2xpL2NsaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxLQUFLLEVBQUUsTUFBTSxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFFM0QsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLFdBQVcsQ0FBQztBQUtwQzs7OztHQUlHO0FBQ0gsd0JBQWdCLG1CQUFtQixDQUFDLE9BQU8sRUFBRSxPQUFPLEVBQUUsT0FBTyxFQUFFLEtBQUssRUFBRSxXQUFXLEVBQUUsTUFBTSxHQUFHLE9BQU8sQ0EyQ2xHIn0=
|
package/dest/cli/cli.js
CHANGED
|
@@ -20,15 +20,15 @@ import { addOptions, printAztecStartHelpText } from './util.js';
|
|
|
20
20
|
program.configureHelp({
|
|
21
21
|
sortSubcommands: true
|
|
22
22
|
});
|
|
23
|
-
|
|
23
|
+
if (process.env.AZTEC_SHELL_WRAPPER) {
|
|
24
|
+
program.addHelpText('after', `
|
|
25
|
+
Additional commands:
|
|
24
26
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
$ aztec start --txe
|
|
29
|
-
then runs
|
|
30
|
-
$ aztec-nargo test --silence-warnings --oracle-resolver=<TXE_ADDRESS> [options]
|
|
27
|
+
init [folder] [options] creates a new Aztec Noir project.
|
|
28
|
+
new <path> [options] creates a new Aztec Noir project in a new directory.
|
|
29
|
+
test [options] starts a TXE and runs "nargo test" using it as the oracle resolver.
|
|
31
30
|
`);
|
|
31
|
+
}
|
|
32
32
|
program.command('preload-crs').description('Preload the points data needed for proving and verifying').action(async (options)=>{
|
|
33
33
|
const { preloadCrs } = await import('./preload_crs.js');
|
|
34
34
|
return await preloadCrs(options, userLog, debugLogger);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { LogFn } from '@aztec/foundation/log';
|
|
2
|
+
import type { Command } from 'commander';
|
|
3
|
+
export declare function injectCompileCommand(program: Command, log: LogFn): Command;
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcGlsZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NsaS9jbWRzL2NvbXBpbGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsS0FBSyxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFHbkQsT0FBTyxLQUFLLEVBQUUsT0FBTyxFQUFFLE1BQU0sV0FBVyxDQUFDO0FBaUZ6Qyx3QkFBZ0Isb0JBQW9CLENBQUMsT0FBTyxFQUFFLE9BQU8sRUFBRSxHQUFHLEVBQUUsS0FBSyxHQUFHLE9BQU8sQ0FzQjFFIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/compile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiFzC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,GAAG,OAAO,CAsB1E"}
|