@aztec/aztec 2.0.0-rc.24 → 2.0.0-rc.26
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,6 +1,6 @@
|
|
|
1
1
|
import type { NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server';
|
|
2
2
|
import type { LogFn } from '@aztec/foundation/log';
|
|
3
|
-
import type
|
|
3
|
+
import { type AztecNode, type PXE } from '@aztec/stdlib/interfaces/client';
|
|
4
4
|
import type { TelemetryClient } from '@aztec/telemetry-client';
|
|
5
5
|
export declare function startBot(options: any, signalHandlers: (() => Promise<void>)[], services: NamespacedApiHandlers, userLog: LogFn): Promise<void>;
|
|
6
6
|
export declare function addBot(options: any, signalHandlers: (() => Promise<void>)[], services: NamespacedApiHandlers, deps: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start_bot.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_bot.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"start_bot.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_bot.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,GAAG,EAAyB,MAAM,iCAAiC,CAAC;AAClG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAU/D,wBAAsB,QAAQ,CAC5B,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EACvC,QAAQ,EAAE,qBAAqB,EAC/B,OAAO,EAAE,KAAK,iBA2Bf;AAED,wBAAgB,MAAM,CACpB,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EACvC,QAAQ,EAAE,qBAAqB,EAC/B,IAAI,EAAE;IAAE,GAAG,CAAC,EAAE,GAAG,CAAC;IAAC,IAAI,CAAC,EAAE,SAAS,CAAC;IAAC,SAAS,EAAE,eAAe,CAAA;CAAE,iBAWlE"}
|
|
@@ -1,22 +1,37 @@
|
|
|
1
1
|
import { BotRunner, botConfigMappings, getBotRunnerApiHandler } from '@aztec/bot';
|
|
2
|
-
import {
|
|
2
|
+
import { createAztecNodeClient } from '@aztec/stdlib/interfaces/client';
|
|
3
|
+
import { getConfigEnvVars as getTelemetryClientConfig, initTelemetryClient, makeTracedFetch } from '@aztec/telemetry-client';
|
|
3
4
|
import { extractRelevantOptions } from '../util.js';
|
|
5
|
+
import { getVersions } from '../versioning.js';
|
|
4
6
|
export async function startBot(options, signalHandlers, services, userLog) {
|
|
5
7
|
const { proverNode, archiver, sequencer, p2pBootstrap, txe, prover } = options;
|
|
6
8
|
if (proverNode || archiver || sequencer || p2pBootstrap || txe || prover) {
|
|
7
9
|
userLog(`Starting a bot with --prover-node, --prover, --archiver, --sequencer, --p2p-bootstrap, or --txe is not supported.`);
|
|
8
10
|
process.exit(1);
|
|
9
11
|
}
|
|
12
|
+
const fetch = makeTracedFetch([
|
|
13
|
+
1,
|
|
14
|
+
2,
|
|
15
|
+
3
|
|
16
|
+
], true);
|
|
17
|
+
const config = extractRelevantOptions(options, botConfigMappings, 'bot');
|
|
18
|
+
if (!config.nodeUrl) {
|
|
19
|
+
throw new Error('The bot requires access to a Node');
|
|
20
|
+
}
|
|
21
|
+
const node = createAztecNodeClient(config.nodeUrl, getVersions(), fetch);
|
|
10
22
|
// Start a PXE client that is used by the bot if required
|
|
11
23
|
let pxe;
|
|
12
24
|
if (options.pxe) {
|
|
13
25
|
const { addPXE } = await import('./start_pxe.js');
|
|
14
|
-
({ pxe } = await addPXE(options, signalHandlers, services, userLog
|
|
26
|
+
({ pxe } = await addPXE(options, signalHandlers, services, userLog, {
|
|
27
|
+
node
|
|
28
|
+
}));
|
|
15
29
|
}
|
|
16
30
|
const telemetry = initTelemetryClient(getTelemetryClientConfig());
|
|
17
31
|
await addBot(options, signalHandlers, services, {
|
|
18
32
|
pxe,
|
|
19
|
-
telemetry
|
|
33
|
+
telemetry,
|
|
34
|
+
node
|
|
20
35
|
});
|
|
21
36
|
}
|
|
22
37
|
export function addBot(options, signalHandlers, services, deps) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/aztec",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.26",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -28,37 +28,37 @@
|
|
|
28
28
|
"../package.common.json"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@aztec/accounts": "2.0.0-rc.
|
|
32
|
-
"@aztec/archiver": "2.0.0-rc.
|
|
33
|
-
"@aztec/aztec-faucet": "2.0.0-rc.
|
|
34
|
-
"@aztec/aztec-node": "2.0.0-rc.
|
|
35
|
-
"@aztec/aztec.js": "2.0.0-rc.
|
|
36
|
-
"@aztec/bb-prover": "2.0.0-rc.
|
|
37
|
-
"@aztec/bb.js": "2.0.0-rc.
|
|
38
|
-
"@aztec/blob-sink": "2.0.0-rc.
|
|
39
|
-
"@aztec/bot": "2.0.0-rc.
|
|
40
|
-
"@aztec/builder": "2.0.0-rc.
|
|
41
|
-
"@aztec/cli": "2.0.0-rc.
|
|
42
|
-
"@aztec/cli-wallet": "2.0.0-rc.
|
|
43
|
-
"@aztec/constants": "2.0.0-rc.
|
|
44
|
-
"@aztec/entrypoints": "2.0.0-rc.
|
|
45
|
-
"@aztec/ethereum": "2.0.0-rc.
|
|
46
|
-
"@aztec/foundation": "2.0.0-rc.
|
|
47
|
-
"@aztec/kv-store": "2.0.0-rc.
|
|
48
|
-
"@aztec/l1-artifacts": "2.0.0-rc.
|
|
49
|
-
"@aztec/node-lib": "2.0.0-rc.
|
|
50
|
-
"@aztec/noir-contracts.js": "2.0.0-rc.
|
|
51
|
-
"@aztec/noir-protocol-circuits-types": "2.0.0-rc.
|
|
52
|
-
"@aztec/p2p": "2.0.0-rc.
|
|
53
|
-
"@aztec/p2p-bootstrap": "2.0.0-rc.
|
|
54
|
-
"@aztec/protocol-contracts": "2.0.0-rc.
|
|
55
|
-
"@aztec/prover-client": "2.0.0-rc.
|
|
56
|
-
"@aztec/prover-node": "2.0.0-rc.
|
|
57
|
-
"@aztec/pxe": "2.0.0-rc.
|
|
58
|
-
"@aztec/stdlib": "2.0.0-rc.
|
|
59
|
-
"@aztec/telemetry-client": "2.0.0-rc.
|
|
60
|
-
"@aztec/txe": "2.0.0-rc.
|
|
61
|
-
"@aztec/world-state": "2.0.0-rc.
|
|
31
|
+
"@aztec/accounts": "2.0.0-rc.26",
|
|
32
|
+
"@aztec/archiver": "2.0.0-rc.26",
|
|
33
|
+
"@aztec/aztec-faucet": "2.0.0-rc.26",
|
|
34
|
+
"@aztec/aztec-node": "2.0.0-rc.26",
|
|
35
|
+
"@aztec/aztec.js": "2.0.0-rc.26",
|
|
36
|
+
"@aztec/bb-prover": "2.0.0-rc.26",
|
|
37
|
+
"@aztec/bb.js": "2.0.0-rc.26",
|
|
38
|
+
"@aztec/blob-sink": "2.0.0-rc.26",
|
|
39
|
+
"@aztec/bot": "2.0.0-rc.26",
|
|
40
|
+
"@aztec/builder": "2.0.0-rc.26",
|
|
41
|
+
"@aztec/cli": "2.0.0-rc.26",
|
|
42
|
+
"@aztec/cli-wallet": "2.0.0-rc.26",
|
|
43
|
+
"@aztec/constants": "2.0.0-rc.26",
|
|
44
|
+
"@aztec/entrypoints": "2.0.0-rc.26",
|
|
45
|
+
"@aztec/ethereum": "2.0.0-rc.26",
|
|
46
|
+
"@aztec/foundation": "2.0.0-rc.26",
|
|
47
|
+
"@aztec/kv-store": "2.0.0-rc.26",
|
|
48
|
+
"@aztec/l1-artifacts": "2.0.0-rc.26",
|
|
49
|
+
"@aztec/node-lib": "2.0.0-rc.26",
|
|
50
|
+
"@aztec/noir-contracts.js": "2.0.0-rc.26",
|
|
51
|
+
"@aztec/noir-protocol-circuits-types": "2.0.0-rc.26",
|
|
52
|
+
"@aztec/p2p": "2.0.0-rc.26",
|
|
53
|
+
"@aztec/p2p-bootstrap": "2.0.0-rc.26",
|
|
54
|
+
"@aztec/protocol-contracts": "2.0.0-rc.26",
|
|
55
|
+
"@aztec/prover-client": "2.0.0-rc.26",
|
|
56
|
+
"@aztec/prover-node": "2.0.0-rc.26",
|
|
57
|
+
"@aztec/pxe": "2.0.0-rc.26",
|
|
58
|
+
"@aztec/stdlib": "2.0.0-rc.26",
|
|
59
|
+
"@aztec/telemetry-client": "2.0.0-rc.26",
|
|
60
|
+
"@aztec/txe": "2.0.0-rc.26",
|
|
61
|
+
"@aztec/world-state": "2.0.0-rc.26",
|
|
62
62
|
"@types/chalk": "^2.2.0",
|
|
63
63
|
"abitype": "^0.8.11",
|
|
64
64
|
"chalk": "^5.3.0",
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { type BotConfig, BotRunner, 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 type
|
|
4
|
+
import { type AztecNode, type PXE, createAztecNodeClient } from '@aztec/stdlib/interfaces/client';
|
|
5
5
|
import type { TelemetryClient } from '@aztec/telemetry-client';
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
getConfigEnvVars as getTelemetryClientConfig,
|
|
8
|
+
initTelemetryClient,
|
|
9
|
+
makeTracedFetch,
|
|
10
|
+
} from '@aztec/telemetry-client';
|
|
7
11
|
|
|
8
12
|
import { extractRelevantOptions } from '../util.js';
|
|
13
|
+
import { getVersions } from '../versioning.js';
|
|
9
14
|
|
|
10
15
|
export async function startBot(
|
|
11
16
|
options: any,
|
|
@@ -20,15 +25,24 @@ export async function startBot(
|
|
|
20
25
|
);
|
|
21
26
|
process.exit(1);
|
|
22
27
|
}
|
|
28
|
+
|
|
29
|
+
const fetch = makeTracedFetch([1, 2, 3], true);
|
|
30
|
+
const config = extractRelevantOptions<BotConfig>(options, botConfigMappings, 'bot');
|
|
31
|
+
if (!config.nodeUrl) {
|
|
32
|
+
throw new Error('The bot requires access to a Node');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const node = createAztecNodeClient(config.nodeUrl, getVersions(), fetch);
|
|
36
|
+
|
|
23
37
|
// Start a PXE client that is used by the bot if required
|
|
24
38
|
let pxe: PXE | undefined;
|
|
25
39
|
if (options.pxe) {
|
|
26
40
|
const { addPXE } = await import('./start_pxe.js');
|
|
27
|
-
({ pxe } = await addPXE(options, signalHandlers, services, userLog));
|
|
41
|
+
({ pxe } = await addPXE(options, signalHandlers, services, userLog, { node }));
|
|
28
42
|
}
|
|
29
43
|
|
|
30
44
|
const telemetry = initTelemetryClient(getTelemetryClientConfig());
|
|
31
|
-
await addBot(options, signalHandlers, services, { pxe, telemetry });
|
|
45
|
+
await addBot(options, signalHandlers, services, { pxe, telemetry, node });
|
|
32
46
|
}
|
|
33
47
|
|
|
34
48
|
export function addBot(
|