@aztec/aztec 0.77.0 → 0.77.1
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/cli/aztec_start_action.d.ts.map +1 -1
- package/dest/cli/aztec_start_action.js +5 -0
- package/dest/cli/aztec_start_options.d.ts.map +1 -1
- package/dest/cli/aztec_start_options.js +8 -0
- package/dest/cli/chain_l2_config.d.ts +17 -0
- package/dest/cli/chain_l2_config.d.ts.map +1 -0
- package/dest/cli/chain_l2_config.js +52 -0
- package/dest/cli/cmds/start_prover_broker.d.ts.map +1 -1
- package/dest/cli/cmds/start_prover_broker.js +6 -0
- package/package.json +29 -29
- package/src/cli/aztec_start_action.ts +5 -0
- package/src/cli/aztec_start_options.ts +8 -0
- package/src/cli/chain_l2_config.ts +68 -0
- package/src/cli/cmds/start_prover_broker.ts +9 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aztec_start_action.d.ts","sourceRoot":"","sources":["../../src/cli/aztec_start_action.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"aztec_start_action.d.ts","sourceRoot":"","sources":["../../src/cli/aztec_start_action.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAmB3D,wBAAsB,UAAU,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,iBAyFjF"}
|
|
@@ -7,6 +7,7 @@ import { readFileSync } from 'fs';
|
|
|
7
7
|
import { dirname, resolve } from 'path';
|
|
8
8
|
import { createSandbox } from '../sandbox/index.js';
|
|
9
9
|
import { github, splash } from '../splash.js';
|
|
10
|
+
import { enrichEnvironmentWithChainConfig } from './chain_l2_config.js';
|
|
10
11
|
import { extractNamespacedOptions, installSignalHandlers } from './util.js';
|
|
11
12
|
import { getVersions } from './versioning.js';
|
|
12
13
|
const packageJsonPath = resolve(dirname(fileURLToPath(import.meta.url)), '../../package.json');
|
|
@@ -43,6 +44,10 @@ export async function aztecStart(options, userLog, debugLogger) {
|
|
|
43
44
|
userLog(`Not exposing PXE API through JSON-RPC server`);
|
|
44
45
|
}
|
|
45
46
|
} else {
|
|
47
|
+
// If a network is specified, enrich the environment with the chain config
|
|
48
|
+
if (options.network) {
|
|
49
|
+
await enrichEnvironmentWithChainConfig(options.network);
|
|
50
|
+
}
|
|
46
51
|
if (options.node) {
|
|
47
52
|
const { startNode } = await import('./cmds/start_node.js');
|
|
48
53
|
({ config } = await startNode(options, signalHandlers, services, userLog));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aztec_start_options.d.ts","sourceRoot":"","sources":["../../src/cli/aztec_start_options.ts"],"names":[],"mappings":"AAKA,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,GAAG,SAAS,CAAC;IAC9B,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,MAAM,CAAC;IACpC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,GAAG,CAAC;CACjC;AAED,eAAO,MAAM,UAAU,cAAe,MAAM,kBAAkB,OAAO,MAAM,EAAE,aAAa,CAAC,uBAiB1F,CAAC;AAGF,eAAO,MAAM,gBAAgB,UAA2E,CAAC;AAGzG,eAAO,MAAM,iBAAiB,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"aztec_start_options.d.ts","sourceRoot":"","sources":["../../src/cli/aztec_start_options.ts"],"names":[],"mappings":"AAKA,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,GAAG,SAAS,CAAC;IAC9B,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,MAAM,CAAC;IACpC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,GAAG,CAAC;CACjC;AAED,eAAO,MAAM,UAAU,cAAe,MAAM,kBAAkB,OAAO,MAAM,EAAE,aAAa,CAAC,uBAiB1F,CAAC;AAGF,eAAO,MAAM,gBAAgB,UAA2E,CAAC;AAGzG,eAAO,MAAM,iBAAiB,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAAA;CAwTlE,CAAC"}
|
|
@@ -38,6 +38,14 @@ export const universalOptions = [
|
|
|
38
38
|
];
|
|
39
39
|
// Define categories and options
|
|
40
40
|
export const aztecStartOptions = {
|
|
41
|
+
NETWORK: [
|
|
42
|
+
{
|
|
43
|
+
flag: '--network <value>',
|
|
44
|
+
description: 'Network to run Aztec on',
|
|
45
|
+
defaultValue: undefined,
|
|
46
|
+
envVar: 'NETWORK'
|
|
47
|
+
}
|
|
48
|
+
],
|
|
41
49
|
SANDBOX: [
|
|
42
50
|
{
|
|
43
51
|
flag: '--sandbox',
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type NetworkNames = 'testnet-ignition';
|
|
2
|
+
export type L2ChainConfig = {
|
|
3
|
+
l1ChainId: number;
|
|
4
|
+
ethereumSlotDuration: number;
|
|
5
|
+
aztecSlotDuration: number;
|
|
6
|
+
aztecEpochDuration: number;
|
|
7
|
+
aztecProofSubmissionWindow: number;
|
|
8
|
+
testAccounts: boolean;
|
|
9
|
+
p2pEnabled: boolean;
|
|
10
|
+
p2pBootstrapNodes: string[];
|
|
11
|
+
registryAddress: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const testnetIgnitionL2ChainConfig: L2ChainConfig;
|
|
14
|
+
export declare function getBootnodes(networkName: NetworkNames): Promise<any>;
|
|
15
|
+
export declare function getL2ChainConfig(networkName: NetworkNames): Promise<L2ChainConfig | undefined>;
|
|
16
|
+
export declare function enrichEnvironmentWithChainConfig(networkName: NetworkNames): Promise<void>;
|
|
17
|
+
//# sourceMappingURL=chain_l2_config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chain_l2_config.d.ts","sourceRoot":"","sources":["../../src/cli/chain_l2_config.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,kBAAkB,CAAC;AAE9C,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,0BAA0B,EAAE,MAAM,CAAC;IACnC,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,aAU1C,CAAC;AAEF,wBAAsB,YAAY,CAAC,WAAW,EAAE,YAAY,gBAQ3D;AAED,wBAAsB,gBAAgB,CAAC,WAAW,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAOpG;AAUD,wBAAsB,gCAAgC,CAAC,WAAW,EAAE,YAAY,iBAc/E"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export const testnetIgnitionL2ChainConfig = {
|
|
2
|
+
l1ChainId: 11155111,
|
|
3
|
+
ethereumSlotDuration: 12,
|
|
4
|
+
aztecSlotDuration: 36,
|
|
5
|
+
aztecEpochDuration: 32,
|
|
6
|
+
aztecProofSubmissionWindow: 64,
|
|
7
|
+
testAccounts: true,
|
|
8
|
+
p2pEnabled: true,
|
|
9
|
+
p2pBootstrapNodes: [],
|
|
10
|
+
registryAddress: '0x12b3ebc176a1646b911391eab3760764f2e05fe3'
|
|
11
|
+
};
|
|
12
|
+
export async function getBootnodes(networkName) {
|
|
13
|
+
const url = `http://static.aztec.network/${networkName}/bootnodes.json`;
|
|
14
|
+
const response = await fetch(url);
|
|
15
|
+
if (!response.ok) {
|
|
16
|
+
throw new Error(`Failed to fetch basic contract addresses from ${url}`);
|
|
17
|
+
}
|
|
18
|
+
const json = await response.json();
|
|
19
|
+
return json['bootnodes'];
|
|
20
|
+
}
|
|
21
|
+
export async function getL2ChainConfig(networkName) {
|
|
22
|
+
if (networkName === 'testnet-ignition') {
|
|
23
|
+
const config = {
|
|
24
|
+
...testnetIgnitionL2ChainConfig
|
|
25
|
+
};
|
|
26
|
+
config.p2pBootstrapNodes = await getBootnodes(networkName);
|
|
27
|
+
return config;
|
|
28
|
+
}
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
function enrichVar(envVar, value) {
|
|
32
|
+
// Don't override
|
|
33
|
+
if (process.env[envVar]) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
process.env[envVar] = value;
|
|
37
|
+
}
|
|
38
|
+
export async function enrichEnvironmentWithChainConfig(networkName) {
|
|
39
|
+
const config = await getL2ChainConfig(networkName);
|
|
40
|
+
if (!config) {
|
|
41
|
+
throw new Error(`Unknown network name: ${networkName}`);
|
|
42
|
+
}
|
|
43
|
+
enrichVar('ETHEREUM_SLOT_DURATION', config.ethereumSlotDuration.toString());
|
|
44
|
+
enrichVar('AZTEC_SLOT_DURATION', config.aztecSlotDuration.toString());
|
|
45
|
+
enrichVar('AZTEC_EPOCH_DURATION', config.aztecEpochDuration.toString());
|
|
46
|
+
enrichVar('AZTEC_PROOF_SUBMISSION_WINDOW', config.aztecProofSubmissionWindow.toString());
|
|
47
|
+
enrichVar('P2P_BOOTSTRAP_NODES', config.p2pBootstrapNodes.join(','));
|
|
48
|
+
enrichVar('TEST_ACCOUNTS', config.testAccounts.toString());
|
|
49
|
+
enrichVar('P2P_ENABLED', config.p2pEnabled.toString());
|
|
50
|
+
enrichVar('L1_CHAIN_ID', config.l1ChainId.toString());
|
|
51
|
+
enrichVar('REGISTRY_CONTRACT_ADDRESS', config.registryAddress);
|
|
52
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start_prover_broker.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_prover_broker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EACL,KAAK,kBAAkB,EAIxB,MAAM,6BAA6B,CAAC;AAErC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"start_prover_broker.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_prover_broker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EACL,KAAK,kBAAkB,EAIxB,MAAM,6BAA6B,CAAC;AAErC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAMxE,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EACvC,QAAQ,EAAE,qBAAqB,EAC/B,OAAO,EAAE,KAAK,GACb,OAAO,CAAC;IAAE,MAAM,EAAE,gBAAgB,CAAC;IAAC,MAAM,EAAE,kBAAkB,CAAA;CAAE,CAAC,CAyBnE"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ProvingJobBrokerSchema, createAndStartProvingBroker, proverBrokerConfigMappings } from '@aztec/prover-client/broker';
|
|
2
2
|
import { getProverNodeBrokerConfigFromEnv } from '@aztec/prover-node';
|
|
3
3
|
import { getConfigEnvVars as getTelemetryClientConfig, initTelemetryClient } from '@aztec/telemetry-client';
|
|
4
|
+
import { getL1Config } from '../get_l1_config.js';
|
|
4
5
|
import { extractRelevantOptions } from '../util.js';
|
|
5
6
|
export async function startProverBroker(options, signalHandlers, services, userLog) {
|
|
6
7
|
if (options.node || options.sequencer || options.pxe || options.p2pBootstrap || options.txe) {
|
|
@@ -11,6 +12,11 @@ export async function startProverBroker(options, signalHandlers, services, userL
|
|
|
11
12
|
...getProverNodeBrokerConfigFromEnv(),
|
|
12
13
|
...extractRelevantOptions(options, proverBrokerConfigMappings, 'proverBroker')
|
|
13
14
|
};
|
|
15
|
+
if (!config.l1Contracts.registryAddress || config.l1Contracts.registryAddress.isZero()) {
|
|
16
|
+
throw new Error('L1 registry address is required to start Aztec Node without --deploy-aztec-contracts option');
|
|
17
|
+
}
|
|
18
|
+
const { addresses } = await getL1Config(config.l1Contracts.registryAddress, config.l1RpcUrls, config.l1ChainId);
|
|
19
|
+
config.l1Contracts = addresses;
|
|
14
20
|
const client = initTelemetryClient(getTelemetryClientConfig());
|
|
15
21
|
const broker = await createAndStartProvingBroker(config, client);
|
|
16
22
|
services.proverBroker = [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/aztec",
|
|
3
|
-
"version": "0.77.
|
|
3
|
+
"version": "0.77.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js"
|
|
@@ -29,34 +29,34 @@
|
|
|
29
29
|
"../package.common.json"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@aztec/accounts": "0.77.
|
|
33
|
-
"@aztec/archiver": "0.77.
|
|
34
|
-
"@aztec/aztec-faucet": "0.77.
|
|
35
|
-
"@aztec/aztec-node": "0.77.
|
|
36
|
-
"@aztec/aztec.js": "0.77.
|
|
37
|
-
"@aztec/bb-prover": "0.77.
|
|
38
|
-
"@aztec/blob-sink": "0.77.
|
|
39
|
-
"@aztec/bot": "0.77.
|
|
40
|
-
"@aztec/builder": "0.77.
|
|
41
|
-
"@aztec/cli": "0.77.
|
|
42
|
-
"@aztec/cli-wallet": "0.77.
|
|
43
|
-
"@aztec/constants": "0.77.
|
|
44
|
-
"@aztec/entrypoints": "0.77.
|
|
45
|
-
"@aztec/ethereum": "0.77.
|
|
46
|
-
"@aztec/foundation": "0.77.
|
|
47
|
-
"@aztec/kv-store": "0.77.
|
|
48
|
-
"@aztec/noir-contracts.js": "0.77.
|
|
49
|
-
"@aztec/noir-protocol-circuits-types": "0.77.
|
|
50
|
-
"@aztec/p2p": "0.77.
|
|
51
|
-
"@aztec/p2p-bootstrap": "0.77.
|
|
52
|
-
"@aztec/protocol-contracts": "0.77.
|
|
53
|
-
"@aztec/prover-client": "0.77.
|
|
54
|
-
"@aztec/prover-node": "0.77.
|
|
55
|
-
"@aztec/pxe": "0.77.
|
|
56
|
-
"@aztec/stdlib": "0.77.
|
|
57
|
-
"@aztec/telemetry-client": "0.77.
|
|
58
|
-
"@aztec/txe": "0.77.
|
|
59
|
-
"@aztec/world-state": "0.77.
|
|
32
|
+
"@aztec/accounts": "0.77.1",
|
|
33
|
+
"@aztec/archiver": "0.77.1",
|
|
34
|
+
"@aztec/aztec-faucet": "0.77.1",
|
|
35
|
+
"@aztec/aztec-node": "0.77.1",
|
|
36
|
+
"@aztec/aztec.js": "0.77.1",
|
|
37
|
+
"@aztec/bb-prover": "0.77.1",
|
|
38
|
+
"@aztec/blob-sink": "0.77.1",
|
|
39
|
+
"@aztec/bot": "0.77.1",
|
|
40
|
+
"@aztec/builder": "0.77.1",
|
|
41
|
+
"@aztec/cli": "0.77.1",
|
|
42
|
+
"@aztec/cli-wallet": "0.77.1",
|
|
43
|
+
"@aztec/constants": "0.77.1",
|
|
44
|
+
"@aztec/entrypoints": "0.77.1",
|
|
45
|
+
"@aztec/ethereum": "0.77.1",
|
|
46
|
+
"@aztec/foundation": "0.77.1",
|
|
47
|
+
"@aztec/kv-store": "0.77.1",
|
|
48
|
+
"@aztec/noir-contracts.js": "0.77.1",
|
|
49
|
+
"@aztec/noir-protocol-circuits-types": "0.77.1",
|
|
50
|
+
"@aztec/p2p": "0.77.1",
|
|
51
|
+
"@aztec/p2p-bootstrap": "0.77.1",
|
|
52
|
+
"@aztec/protocol-contracts": "0.77.1",
|
|
53
|
+
"@aztec/prover-client": "0.77.1",
|
|
54
|
+
"@aztec/prover-node": "0.77.1",
|
|
55
|
+
"@aztec/pxe": "0.77.1",
|
|
56
|
+
"@aztec/stdlib": "0.77.1",
|
|
57
|
+
"@aztec/telemetry-client": "0.77.1",
|
|
58
|
+
"@aztec/txe": "0.77.1",
|
|
59
|
+
"@aztec/world-state": "0.77.1",
|
|
60
60
|
"@types/chalk": "^2.2.0",
|
|
61
61
|
"abitype": "^0.8.11",
|
|
62
62
|
"chalk": "^5.3.0",
|
|
@@ -15,6 +15,7 @@ import { dirname, resolve } from 'path';
|
|
|
15
15
|
|
|
16
16
|
import { createSandbox } from '../sandbox/index.js';
|
|
17
17
|
import { github, splash } from '../splash.js';
|
|
18
|
+
import { enrichEnvironmentWithChainConfig } from './chain_l2_config.js';
|
|
18
19
|
import { extractNamespacedOptions, installSignalHandlers } from './util.js';
|
|
19
20
|
import { getVersions } from './versioning.js';
|
|
20
21
|
|
|
@@ -53,6 +54,10 @@ export async function aztecStart(options: any, userLog: LogFn, debugLogger: Logg
|
|
|
53
54
|
userLog(`Not exposing PXE API through JSON-RPC server`);
|
|
54
55
|
}
|
|
55
56
|
} else {
|
|
57
|
+
// If a network is specified, enrich the environment with the chain config
|
|
58
|
+
if (options.network) {
|
|
59
|
+
await enrichEnvironmentWithChainConfig(options.network);
|
|
60
|
+
}
|
|
56
61
|
if (options.node) {
|
|
57
62
|
const { startNode } = await import('./cmds/start_node.js');
|
|
58
63
|
({ config } = await startNode(options, signalHandlers, services, userLog));
|
|
@@ -57,6 +57,14 @@ export const universalOptions = ['l1RpcUrls', 'l1ChainId', 'l1Contracts', 'p2pEn
|
|
|
57
57
|
|
|
58
58
|
// Define categories and options
|
|
59
59
|
export const aztecStartOptions: { [key: string]: AztecStartOption[] } = {
|
|
60
|
+
NETWORK: [
|
|
61
|
+
{
|
|
62
|
+
flag: '--network <value>',
|
|
63
|
+
description: 'Network to run Aztec on',
|
|
64
|
+
defaultValue: undefined,
|
|
65
|
+
envVar: 'NETWORK',
|
|
66
|
+
},
|
|
67
|
+
],
|
|
60
68
|
SANDBOX: [
|
|
61
69
|
{
|
|
62
70
|
flag: '--sandbox',
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export type NetworkNames = 'testnet-ignition';
|
|
2
|
+
|
|
3
|
+
export type L2ChainConfig = {
|
|
4
|
+
l1ChainId: number;
|
|
5
|
+
ethereumSlotDuration: number;
|
|
6
|
+
aztecSlotDuration: number;
|
|
7
|
+
aztecEpochDuration: number;
|
|
8
|
+
aztecProofSubmissionWindow: number;
|
|
9
|
+
testAccounts: boolean;
|
|
10
|
+
p2pEnabled: boolean;
|
|
11
|
+
p2pBootstrapNodes: string[];
|
|
12
|
+
registryAddress: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const testnetIgnitionL2ChainConfig: L2ChainConfig = {
|
|
16
|
+
l1ChainId: 11155111,
|
|
17
|
+
ethereumSlotDuration: 12,
|
|
18
|
+
aztecSlotDuration: 36,
|
|
19
|
+
aztecEpochDuration: 32,
|
|
20
|
+
aztecProofSubmissionWindow: 64,
|
|
21
|
+
testAccounts: true,
|
|
22
|
+
p2pEnabled: true,
|
|
23
|
+
p2pBootstrapNodes: [],
|
|
24
|
+
registryAddress: '0x12b3ebc176a1646b911391eab3760764f2e05fe3',
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export async function getBootnodes(networkName: NetworkNames) {
|
|
28
|
+
const url = `http://static.aztec.network/${networkName}/bootnodes.json`;
|
|
29
|
+
const response = await fetch(url);
|
|
30
|
+
if (!response.ok) {
|
|
31
|
+
throw new Error(`Failed to fetch basic contract addresses from ${url}`);
|
|
32
|
+
}
|
|
33
|
+
const json = await response.json();
|
|
34
|
+
return json['bootnodes'];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export async function getL2ChainConfig(networkName: NetworkNames): Promise<L2ChainConfig | undefined> {
|
|
38
|
+
if (networkName === 'testnet-ignition') {
|
|
39
|
+
const config = { ...testnetIgnitionL2ChainConfig };
|
|
40
|
+
config.p2pBootstrapNodes = await getBootnodes(networkName);
|
|
41
|
+
return config;
|
|
42
|
+
}
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function enrichVar(envVar: string, value: string) {
|
|
47
|
+
// Don't override
|
|
48
|
+
if (process.env[envVar]) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
process.env[envVar] = value;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export async function enrichEnvironmentWithChainConfig(networkName: NetworkNames) {
|
|
55
|
+
const config = await getL2ChainConfig(networkName);
|
|
56
|
+
if (!config) {
|
|
57
|
+
throw new Error(`Unknown network name: ${networkName}`);
|
|
58
|
+
}
|
|
59
|
+
enrichVar('ETHEREUM_SLOT_DURATION', config.ethereumSlotDuration.toString());
|
|
60
|
+
enrichVar('AZTEC_SLOT_DURATION', config.aztecSlotDuration.toString());
|
|
61
|
+
enrichVar('AZTEC_EPOCH_DURATION', config.aztecEpochDuration.toString());
|
|
62
|
+
enrichVar('AZTEC_PROOF_SUBMISSION_WINDOW', config.aztecProofSubmissionWindow.toString());
|
|
63
|
+
enrichVar('P2P_BOOTSTRAP_NODES', config.p2pBootstrapNodes.join(','));
|
|
64
|
+
enrichVar('TEST_ACCOUNTS', config.testAccounts.toString());
|
|
65
|
+
enrichVar('P2P_ENABLED', config.p2pEnabled.toString());
|
|
66
|
+
enrichVar('L1_CHAIN_ID', config.l1ChainId.toString());
|
|
67
|
+
enrichVar('REGISTRY_CONTRACT_ADDRESS', config.registryAddress);
|
|
68
|
+
}
|
|
@@ -10,6 +10,7 @@ import { getProverNodeBrokerConfigFromEnv } from '@aztec/prover-node';
|
|
|
10
10
|
import type { ProvingJobBroker } from '@aztec/stdlib/interfaces/server';
|
|
11
11
|
import { getConfigEnvVars as getTelemetryClientConfig, initTelemetryClient } from '@aztec/telemetry-client';
|
|
12
12
|
|
|
13
|
+
import { getL1Config } from '../get_l1_config.js';
|
|
13
14
|
import { extractRelevantOptions } from '../util.js';
|
|
14
15
|
|
|
15
16
|
export async function startProverBroker(
|
|
@@ -28,6 +29,14 @@ export async function startProverBroker(
|
|
|
28
29
|
...extractRelevantOptions<ProverBrokerConfig>(options, proverBrokerConfigMappings, 'proverBroker'), // override with command line options
|
|
29
30
|
};
|
|
30
31
|
|
|
32
|
+
if (!config.l1Contracts.registryAddress || config.l1Contracts.registryAddress.isZero()) {
|
|
33
|
+
throw new Error('L1 registry address is required to start Aztec Node without --deploy-aztec-contracts option');
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const { addresses } = await getL1Config(config.l1Contracts.registryAddress, config.l1RpcUrls, config.l1ChainId);
|
|
37
|
+
|
|
38
|
+
config.l1Contracts = addresses;
|
|
39
|
+
|
|
31
40
|
const client = initTelemetryClient(getTelemetryClientConfig());
|
|
32
41
|
const broker = await createAndStartProvingBroker(config, client);
|
|
33
42
|
services.proverBroker = [broker, ProvingJobBrokerSchema];
|