@aztec/aztec 0.79.0 → 0.80.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.
|
@@ -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
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/aztec",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.80.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.80.0",
|
|
33
|
+
"@aztec/archiver": "0.80.0",
|
|
34
|
+
"@aztec/aztec-faucet": "0.80.0",
|
|
35
|
+
"@aztec/aztec-node": "0.80.0",
|
|
36
|
+
"@aztec/aztec.js": "0.80.0",
|
|
37
|
+
"@aztec/bb-prover": "0.80.0",
|
|
38
|
+
"@aztec/blob-sink": "0.80.0",
|
|
39
|
+
"@aztec/bot": "0.80.0",
|
|
40
|
+
"@aztec/builder": "0.80.0",
|
|
41
|
+
"@aztec/cli": "0.80.0",
|
|
42
|
+
"@aztec/cli-wallet": "0.80.0",
|
|
43
|
+
"@aztec/constants": "0.80.0",
|
|
44
|
+
"@aztec/entrypoints": "0.80.0",
|
|
45
|
+
"@aztec/ethereum": "0.80.0",
|
|
46
|
+
"@aztec/foundation": "0.80.0",
|
|
47
|
+
"@aztec/kv-store": "0.80.0",
|
|
48
|
+
"@aztec/noir-contracts.js": "0.80.0",
|
|
49
|
+
"@aztec/noir-protocol-circuits-types": "0.80.0",
|
|
50
|
+
"@aztec/p2p": "0.80.0",
|
|
51
|
+
"@aztec/p2p-bootstrap": "0.80.0",
|
|
52
|
+
"@aztec/protocol-contracts": "0.80.0",
|
|
53
|
+
"@aztec/prover-client": "0.80.0",
|
|
54
|
+
"@aztec/prover-node": "0.80.0",
|
|
55
|
+
"@aztec/pxe": "0.80.0",
|
|
56
|
+
"@aztec/stdlib": "0.80.0",
|
|
57
|
+
"@aztec/telemetry-client": "0.80.0",
|
|
58
|
+
"@aztec/txe": "0.80.0",
|
|
59
|
+
"@aztec/world-state": "0.80.0",
|
|
60
60
|
"@types/chalk": "^2.2.0",
|
|
61
61
|
"abitype": "^0.8.11",
|
|
62
62
|
"chalk": "^5.3.0",
|
|
@@ -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);
|