Skip to content

Commit 903861d

Browse files
authored
fix: parse node url when starting a bot (#16969)
2 parents 3965512 + fcbbb3d commit 903861d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ export async function startBot(
2727
}
2828

2929
const fetch = makeTracedFetch([1, 2, 3], true);
30-
const node = createAztecNodeClient(options.nodeUrl, getVersions(), fetch);
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);
3136

3237
// Start a PXE client that is used by the bot if required
3338
let pxe: PXE | undefined;

0 commit comments

Comments
 (0)