Skip to content

Commit d77a75b

Browse files
authored
fix: less aggressive version check for bots (#16962)
2 parents 486c3c7 + 9401033 commit d77a75b

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

yarn-project/aztec/src/cli/cmds/start_bot.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
import { type BotConfig, BotRunner, botConfigMappings, getBotRunnerApiHandler } from '@aztec/bot';
22
import type { NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server';
33
import type { LogFn } from '@aztec/foundation/log';
4-
import type { AztecNode, PXE } from '@aztec/stdlib/interfaces/client';
4+
import { type AztecNode, type PXE, createAztecNodeClient } from '@aztec/stdlib/interfaces/client';
55
import type { TelemetryClient } from '@aztec/telemetry-client';
6-
import { getConfigEnvVars as getTelemetryClientConfig, initTelemetryClient } from '@aztec/telemetry-client';
6+
import {
7+
getConfigEnvVars as getTelemetryClientConfig,
8+
initTelemetryClient,
9+
makeTracedFetch,
10+
} from '@aztec/telemetry-client';
711

812
import { extractRelevantOptions } from '../util.js';
13+
import { getVersions } from '../versioning.js';
914

1015
export async function startBot(
1116
options: any,
@@ -20,15 +25,19 @@ export async function startBot(
2025
);
2126
process.exit(1);
2227
}
28+
29+
const fetch = makeTracedFetch([1, 2, 3], true);
30+
const node = createAztecNodeClient(options.nodeUrl, getVersions(), fetch);
31+
2332
// Start a PXE client that is used by the bot if required
2433
let pxe: PXE | undefined;
2534
if (options.pxe) {
2635
const { addPXE } = await import('./start_pxe.js');
27-
({ pxe } = await addPXE(options, signalHandlers, services, userLog));
36+
({ pxe } = await addPXE(options, signalHandlers, services, userLog, { node }));
2837
}
2938

3039
const telemetry = initTelemetryClient(getTelemetryClientConfig());
31-
await addBot(options, signalHandlers, services, { pxe, telemetry });
40+
await addBot(options, signalHandlers, services, { pxe, telemetry, node });
3241
}
3342

3443
export function addBot(

0 commit comments

Comments
 (0)