@aztec/aztec 0.79.0 → 0.81.0
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/chain_l2_config.d.ts.map +1 -1
- package/dest/cli/chain_l2_config.js +3 -1
- package/dest/cli/cmds/start_archiver.d.ts.map +1 -1
- package/dest/cli/cmds/start_archiver.js +18 -9
- package/dest/cli/cmds/start_p2p_bootstrap.js +1 -1
- package/package.json +29 -29
- package/src/cli/chain_l2_config.ts +7 -2
- package/src/cli/cmds/start_archiver.ts +22 -12
- package/src/cli/cmds/start_p2p_bootstrap.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain_l2_config.d.ts","sourceRoot":"","sources":["../../src/cli/chain_l2_config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chain_l2_config.d.ts","sourceRoot":"","sources":["../../src/cli/chain_l2_config.ts"],"names":[],"mappings":"AAIA,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;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,aAY1C,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,iBAiB/E"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import path from 'path';
|
|
1
2
|
export const testnetIgnitionL2ChainConfig = {
|
|
2
3
|
l1ChainId: 11155111,
|
|
3
4
|
ethereumSlotDuration: 12,
|
|
@@ -46,11 +47,12 @@ export async function enrichEnvironmentWithChainConfig(networkName) {
|
|
|
46
47
|
enrichVar('AZTEC_SLOT_DURATION', config.aztecSlotDuration.toString());
|
|
47
48
|
enrichVar('AZTEC_EPOCH_DURATION', config.aztecEpochDuration.toString());
|
|
48
49
|
enrichVar('AZTEC_PROOF_SUBMISSION_WINDOW', config.aztecProofSubmissionWindow.toString());
|
|
49
|
-
enrichVar('
|
|
50
|
+
enrichVar('BOOTSTRAP_NODES', config.p2pBootstrapNodes.join(','));
|
|
50
51
|
enrichVar('TEST_ACCOUNTS', config.testAccounts.toString());
|
|
51
52
|
enrichVar('P2P_ENABLED', config.p2pEnabled.toString());
|
|
52
53
|
enrichVar('L1_CHAIN_ID', config.l1ChainId.toString());
|
|
53
54
|
enrichVar('REGISTRY_CONTRACT_ADDRESS', config.registryAddress);
|
|
54
55
|
enrichVar('SEQ_MIN_TX_PER_BLOCK', config.seqMinTxsPerBlock.toString());
|
|
55
56
|
enrichVar('SEQ_MAX_TX_PER_BLOCK', config.seqMaxTxsPerBlock.toString());
|
|
57
|
+
enrichVar('DATA_DIRECTORY', path.join(process.env.HOME || '~', '.aztec', networkName, 'data'));
|
|
56
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start_archiver.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_archiver.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"start_archiver.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_archiver.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EAIpB,MAAM,iBAAiB,CAAC;AAQzB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EAAE,KAAK,eAAe,EAA4C,MAAM,wBAAwB,CAAC;AAQxG,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,CAAC;AAEhD,oCAAoC;AACpC,wBAAsB,aAAa,CACjC,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EACvC,QAAQ,EAAE,qBAAqB,GAC9B,OAAO,CAAC;IAAE,MAAM,EAAE,cAAc,GAAG,eAAe,CAAA;CAAE,CAAC,CAkCvD"}
|
|
@@ -1,32 +1,41 @@
|
|
|
1
|
-
import { Archiver, KVArchiverDataStore, archiverConfigMappings } from '@aztec/archiver';
|
|
1
|
+
import { Archiver, KVArchiverDataStore, archiverConfigMappings, getArchiverConfigFromEnv } from '@aztec/archiver';
|
|
2
2
|
import { createLogger } from '@aztec/aztec.js';
|
|
3
|
-
import { createBlobSinkClient } from '@aztec/blob-sink/client';
|
|
4
|
-
import { dataConfigMappings } from '@aztec/kv-store/config';
|
|
3
|
+
import { blobSinkConfigMapping, createBlobSinkClient, getBlobSinkConfigFromEnv } from '@aztec/blob-sink/client';
|
|
4
|
+
import { dataConfigMappings, getDataConfigFromEnv } from '@aztec/kv-store/config';
|
|
5
5
|
import { createStore } from '@aztec/kv-store/lmdb-v2';
|
|
6
6
|
import { ArchiverApiSchema } from '@aztec/stdlib/interfaces/server';
|
|
7
7
|
import { getConfigEnvVars as getTelemetryClientConfig, initTelemetryClient } from '@aztec/telemetry-client';
|
|
8
8
|
import { getL1Config } from '../get_l1_config.js';
|
|
9
9
|
import { extractRelevantOptions } from '../util.js';
|
|
10
10
|
/** Starts a standalone archiver. */ export async function startArchiver(options, signalHandlers, services) {
|
|
11
|
-
|
|
11
|
+
const envConfig = {
|
|
12
|
+
...getArchiverConfigFromEnv(),
|
|
13
|
+
...getDataConfigFromEnv(),
|
|
14
|
+
...getBlobSinkConfigFromEnv()
|
|
15
|
+
};
|
|
16
|
+
const cliOptions = extractRelevantOptions(options, {
|
|
12
17
|
...archiverConfigMappings,
|
|
13
|
-
...dataConfigMappings
|
|
18
|
+
...dataConfigMappings,
|
|
19
|
+
...blobSinkConfigMapping
|
|
14
20
|
}, 'archiver');
|
|
21
|
+
let archiverConfig = {
|
|
22
|
+
...envConfig,
|
|
23
|
+
...cliOptions
|
|
24
|
+
};
|
|
15
25
|
if (!archiverConfig.l1Contracts.registryAddress || archiverConfig.l1Contracts.registryAddress.isZero()) {
|
|
16
26
|
throw new Error('L1 registry address is required to start an Archiver');
|
|
17
27
|
}
|
|
18
|
-
const { addresses, config } = await getL1Config(archiverConfig.l1Contracts.registryAddress, archiverConfig.l1RpcUrls, archiverConfig.l1ChainId);
|
|
28
|
+
const { addresses, config: l1Config } = await getL1Config(archiverConfig.l1Contracts.registryAddress, archiverConfig.l1RpcUrls, archiverConfig.l1ChainId);
|
|
19
29
|
archiverConfig.l1Contracts = addresses;
|
|
20
30
|
archiverConfig = {
|
|
21
31
|
...archiverConfig,
|
|
22
|
-
...
|
|
32
|
+
...l1Config
|
|
23
33
|
};
|
|
24
34
|
const storeLog = createLogger('archiver:lmdb');
|
|
25
35
|
const store = await createStore('archiver', KVArchiverDataStore.SCHEMA_VERSION, archiverConfig, storeLog);
|
|
26
36
|
const archiverStore = new KVArchiverDataStore(store, archiverConfig.maxLogs);
|
|
27
37
|
const telemetry = initTelemetryClient(getTelemetryClientConfig());
|
|
28
|
-
|
|
29
|
-
const blobSinkClient = createBlobSinkClient();
|
|
38
|
+
const blobSinkClient = createBlobSinkClient(archiverConfig);
|
|
30
39
|
const archiver = await Archiver.createAndSync(archiverConfig, archiverStore, {
|
|
31
40
|
telemetry,
|
|
32
41
|
blobSinkClient
|
|
@@ -19,7 +19,7 @@ export async function startP2PBootstrap(options, signalHandlers, services, userL
|
|
|
19
19
|
node,
|
|
20
20
|
P2PBootstrapApiSchema
|
|
21
21
|
];
|
|
22
|
-
userLog(`P2P bootstrap node started on ${config.
|
|
22
|
+
userLog(`P2P bootstrap node started on ${config.p2pIp}:${config.p2pPort}`);
|
|
23
23
|
return {
|
|
24
24
|
config: emptyChainConfig
|
|
25
25
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/aztec",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.81.0",
|
|
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.
|
|
33
|
-
"@aztec/archiver": "0.
|
|
34
|
-
"@aztec/aztec-faucet": "0.
|
|
35
|
-
"@aztec/aztec-node": "0.
|
|
36
|
-
"@aztec/aztec.js": "0.
|
|
37
|
-
"@aztec/bb-prover": "0.
|
|
38
|
-
"@aztec/blob-sink": "0.
|
|
39
|
-
"@aztec/bot": "0.
|
|
40
|
-
"@aztec/builder": "0.
|
|
41
|
-
"@aztec/cli": "0.
|
|
42
|
-
"@aztec/cli-wallet": "0.
|
|
43
|
-
"@aztec/constants": "0.
|
|
44
|
-
"@aztec/entrypoints": "0.
|
|
45
|
-
"@aztec/ethereum": "0.
|
|
46
|
-
"@aztec/foundation": "0.
|
|
47
|
-
"@aztec/kv-store": "0.
|
|
48
|
-
"@aztec/noir-contracts.js": "0.
|
|
49
|
-
"@aztec/noir-protocol-circuits-types": "0.
|
|
50
|
-
"@aztec/p2p": "0.
|
|
51
|
-
"@aztec/p2p-bootstrap": "0.
|
|
52
|
-
"@aztec/protocol-contracts": "0.
|
|
53
|
-
"@aztec/prover-client": "0.
|
|
54
|
-
"@aztec/prover-node": "0.
|
|
55
|
-
"@aztec/pxe": "0.
|
|
56
|
-
"@aztec/stdlib": "0.
|
|
57
|
-
"@aztec/telemetry-client": "0.
|
|
58
|
-
"@aztec/txe": "0.
|
|
59
|
-
"@aztec/world-state": "0.
|
|
32
|
+
"@aztec/accounts": "0.81.0",
|
|
33
|
+
"@aztec/archiver": "0.81.0",
|
|
34
|
+
"@aztec/aztec-faucet": "0.81.0",
|
|
35
|
+
"@aztec/aztec-node": "0.81.0",
|
|
36
|
+
"@aztec/aztec.js": "0.81.0",
|
|
37
|
+
"@aztec/bb-prover": "0.81.0",
|
|
38
|
+
"@aztec/blob-sink": "0.81.0",
|
|
39
|
+
"@aztec/bot": "0.81.0",
|
|
40
|
+
"@aztec/builder": "0.81.0",
|
|
41
|
+
"@aztec/cli": "0.81.0",
|
|
42
|
+
"@aztec/cli-wallet": "0.81.0",
|
|
43
|
+
"@aztec/constants": "0.81.0",
|
|
44
|
+
"@aztec/entrypoints": "0.81.0",
|
|
45
|
+
"@aztec/ethereum": "0.81.0",
|
|
46
|
+
"@aztec/foundation": "0.81.0",
|
|
47
|
+
"@aztec/kv-store": "0.81.0",
|
|
48
|
+
"@aztec/noir-contracts.js": "0.81.0",
|
|
49
|
+
"@aztec/noir-protocol-circuits-types": "0.81.0",
|
|
50
|
+
"@aztec/p2p": "0.81.0",
|
|
51
|
+
"@aztec/p2p-bootstrap": "0.81.0",
|
|
52
|
+
"@aztec/protocol-contracts": "0.81.0",
|
|
53
|
+
"@aztec/prover-client": "0.81.0",
|
|
54
|
+
"@aztec/prover-node": "0.81.0",
|
|
55
|
+
"@aztec/pxe": "0.81.0",
|
|
56
|
+
"@aztec/stdlib": "0.81.0",
|
|
57
|
+
"@aztec/telemetry-client": "0.81.0",
|
|
58
|
+
"@aztec/txe": "0.81.0",
|
|
59
|
+
"@aztec/world-state": "0.81.0",
|
|
60
60
|
"@types/chalk": "^2.2.0",
|
|
61
61
|
"abitype": "^0.8.11",
|
|
62
62
|
"chalk": "^5.3.0",
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import type { EnvVar } from '@aztec/foundation/config';
|
|
2
|
+
|
|
3
|
+
import path from 'path';
|
|
4
|
+
|
|
1
5
|
export type NetworkNames = 'testnet-ignition';
|
|
2
6
|
|
|
3
7
|
export type L2ChainConfig = {
|
|
@@ -47,7 +51,7 @@ export async function getL2ChainConfig(networkName: NetworkNames): Promise<L2Cha
|
|
|
47
51
|
return undefined;
|
|
48
52
|
}
|
|
49
53
|
|
|
50
|
-
function enrichVar(envVar:
|
|
54
|
+
function enrichVar(envVar: EnvVar, value: string) {
|
|
51
55
|
// Don't override
|
|
52
56
|
if (process.env[envVar]) {
|
|
53
57
|
return;
|
|
@@ -64,11 +68,12 @@ export async function enrichEnvironmentWithChainConfig(networkName: NetworkNames
|
|
|
64
68
|
enrichVar('AZTEC_SLOT_DURATION', config.aztecSlotDuration.toString());
|
|
65
69
|
enrichVar('AZTEC_EPOCH_DURATION', config.aztecEpochDuration.toString());
|
|
66
70
|
enrichVar('AZTEC_PROOF_SUBMISSION_WINDOW', config.aztecProofSubmissionWindow.toString());
|
|
67
|
-
enrichVar('
|
|
71
|
+
enrichVar('BOOTSTRAP_NODES', config.p2pBootstrapNodes.join(','));
|
|
68
72
|
enrichVar('TEST_ACCOUNTS', config.testAccounts.toString());
|
|
69
73
|
enrichVar('P2P_ENABLED', config.p2pEnabled.toString());
|
|
70
74
|
enrichVar('L1_CHAIN_ID', config.l1ChainId.toString());
|
|
71
75
|
enrichVar('REGISTRY_CONTRACT_ADDRESS', config.registryAddress);
|
|
72
76
|
enrichVar('SEQ_MIN_TX_PER_BLOCK', config.seqMinTxsPerBlock.toString());
|
|
73
77
|
enrichVar('SEQ_MAX_TX_PER_BLOCK', config.seqMaxTxsPerBlock.toString());
|
|
78
|
+
enrichVar('DATA_DIRECTORY', path.join(process.env.HOME || '~', '.aztec', networkName, 'data'));
|
|
74
79
|
}
|
|
@@ -1,8 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Archiver,
|
|
3
|
+
type ArchiverConfig,
|
|
4
|
+
KVArchiverDataStore,
|
|
5
|
+
archiverConfigMappings,
|
|
6
|
+
getArchiverConfigFromEnv,
|
|
7
|
+
} from '@aztec/archiver';
|
|
2
8
|
import { createLogger } from '@aztec/aztec.js';
|
|
3
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
type BlobSinkConfig,
|
|
11
|
+
blobSinkConfigMapping,
|
|
12
|
+
createBlobSinkClient,
|
|
13
|
+
getBlobSinkConfigFromEnv,
|
|
14
|
+
} from '@aztec/blob-sink/client';
|
|
4
15
|
import type { NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server';
|
|
5
|
-
import { type DataStoreConfig, dataConfigMappings } from '@aztec/kv-store/config';
|
|
16
|
+
import { type DataStoreConfig, dataConfigMappings, getDataConfigFromEnv } from '@aztec/kv-store/config';
|
|
6
17
|
import { createStore } from '@aztec/kv-store/lmdb-v2';
|
|
7
18
|
import { ArchiverApiSchema } from '@aztec/stdlib/interfaces/server';
|
|
8
19
|
import { getConfigEnvVars as getTelemetryClientConfig, initTelemetryClient } from '@aztec/telemetry-client';
|
|
@@ -18,35 +29,34 @@ export async function startArchiver(
|
|
|
18
29
|
signalHandlers: (() => Promise<void>)[],
|
|
19
30
|
services: NamespacedApiHandlers,
|
|
20
31
|
): Promise<{ config: ArchiverConfig & DataStoreConfig }> {
|
|
21
|
-
|
|
32
|
+
const envConfig = { ...getArchiverConfigFromEnv(), ...getDataConfigFromEnv(), ...getBlobSinkConfigFromEnv() };
|
|
33
|
+
const cliOptions = extractRelevantOptions<ArchiverConfig & DataStoreConfig & BlobSinkConfig>(
|
|
22
34
|
options,
|
|
23
|
-
{
|
|
24
|
-
...archiverConfigMappings,
|
|
25
|
-
...dataConfigMappings,
|
|
26
|
-
},
|
|
35
|
+
{ ...archiverConfigMappings, ...dataConfigMappings, ...blobSinkConfigMapping },
|
|
27
36
|
'archiver',
|
|
28
37
|
);
|
|
29
38
|
|
|
39
|
+
let archiverConfig = { ...envConfig, ...cliOptions };
|
|
40
|
+
|
|
30
41
|
if (!archiverConfig.l1Contracts.registryAddress || archiverConfig.l1Contracts.registryAddress.isZero()) {
|
|
31
42
|
throw new Error('L1 registry address is required to start an Archiver');
|
|
32
43
|
}
|
|
33
44
|
|
|
34
|
-
const { addresses, config } = await getL1Config(
|
|
45
|
+
const { addresses, config: l1Config } = await getL1Config(
|
|
35
46
|
archiverConfig.l1Contracts.registryAddress,
|
|
36
47
|
archiverConfig.l1RpcUrls,
|
|
37
48
|
archiverConfig.l1ChainId,
|
|
38
49
|
);
|
|
39
50
|
|
|
40
51
|
archiverConfig.l1Contracts = addresses;
|
|
41
|
-
archiverConfig = { ...archiverConfig, ...
|
|
52
|
+
archiverConfig = { ...archiverConfig, ...l1Config };
|
|
42
53
|
|
|
43
54
|
const storeLog = createLogger('archiver:lmdb');
|
|
44
55
|
const store = await createStore('archiver', KVArchiverDataStore.SCHEMA_VERSION, archiverConfig, storeLog);
|
|
45
56
|
const archiverStore = new KVArchiverDataStore(store, archiverConfig.maxLogs);
|
|
46
57
|
|
|
47
58
|
const telemetry = initTelemetryClient(getTelemetryClientConfig());
|
|
48
|
-
|
|
49
|
-
const blobSinkClient = createBlobSinkClient();
|
|
59
|
+
const blobSinkClient = createBlobSinkClient(archiverConfig);
|
|
50
60
|
const archiver = await Archiver.createAndSync(archiverConfig, archiverStore, { telemetry, blobSinkClient }, true);
|
|
51
61
|
services.archiver = [archiver, ArchiverApiSchema];
|
|
52
62
|
signalHandlers.push(archiver.stop);
|
|
@@ -24,6 +24,6 @@ export async function startP2PBootstrap(
|
|
|
24
24
|
await node.start(config);
|
|
25
25
|
signalHandlers.push(() => node.stop());
|
|
26
26
|
services.bootstrap = [node, P2PBootstrapApiSchema];
|
|
27
|
-
userLog(`P2P bootstrap node started on ${config.
|
|
27
|
+
userLog(`P2P bootstrap node started on ${config.p2pIp}:${config.p2pPort}`);
|
|
28
28
|
return { config: emptyChainConfig };
|
|
29
29
|
}
|