Skip to content

Commit

Permalink
fix: bot nodeUrl (#7811)
Browse files Browse the repository at this point in the history
  • Loading branch information
spypsy authored Aug 7, 2024
1 parent e83f5ae commit fca0d12
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion yarn-project/aztec/src/cli/cmds/start_node.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { aztecNodeConfigMappings, createAztecNodeRpcServer, sequencerClientConfigMappings } from '@aztec/aztec-node';
import { aztecNodeConfigMappings, createAztecNodeRpcServer } from '@aztec/aztec-node';
import { type PXE } from '@aztec/circuit-types';
import { type ServerList } from '@aztec/foundation/json-rpc/server';
import { type LogFn } from '@aztec/foundation/log';
Expand Down
10 changes: 6 additions & 4 deletions yarn-project/aztec/src/cli/cmds/start_pxe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,13 @@ export async function addPXE(
let nodeUrl;
if (pxeConfig.network) {
if (isValidNetwork(pxeConfig.network)) {
if (!pxeConfig.apiKey) {
userLog(`API Key is required to connect to ${pxeConfig.network}`);
if (!pxeConfig.apiKey && !pxeConfig.nodeUrl) {
userLog(`API Key or Aztec Node URL is required to connect to ${pxeConfig.network}`);
process.exit(1);
}
nodeUrl = `https://api.aztec.network/${pxeConfig.network}/aztec-node-1/${pxeConfig.apiKey}`;
} else if (pxeConfig.apiKey) {
nodeUrl = `https://api.aztec.network/${pxeConfig.network}/aztec-node-1/${pxeConfig.apiKey}`;
} else if (pxeConfig.nodeUrl) {
nodeUrl = pxeConfig.nodeUrl;
} else {
userLog(`Network ${pxeConfig.network} is not supported`);
process.exit(1);
Expand Down

0 comments on commit fca0d12

Please sign in to comment.