MCPcopy Create free account
hub / github.com/AztecProtocol/aztec-packages / waitForNode

Function waitForNode

yarn-project/aztec.js/src/utils/node.ts:9–21  ·  view source on GitHub ↗
(node: AztecNode, logger?: Logger)

Source from the content-addressed store, hash-verified

7import { DefaultWaitOpts, type WaitOpts } from '../contract/wait_opts.js';
8
9export const waitForNode = async (node: AztecNode, logger?: Logger) => {
10 await retryUntil(async () => {
11 try {
12 logger?.verbose('Attempting to contact Aztec node...');
13 await node.getNodeInfo();
14 logger?.verbose('Contacted Aztec node');
15 return true;
16 } catch {
17 logger?.verbose('Failed to contact Aztec Node');
18 }
19 return undefined;
20 }, 'RPC Get Node Info');
21};
22
23/** Returns true if the receipt status is at least the desired status level. */
24function hasReachedStatus(receipt: TxReceipt, desiredStatus: TxStatus): boolean {

Callers 8

index.tsFile · 0.90
index.tsFile · 0.90
setupFunction · 0.90
index.tsFile · 0.90
setupLocalNetworkFunction · 0.90

Calls 3

retryUntilFunction · 0.90
verboseMethod · 0.80
getNodeInfoMethod · 0.65

Tested by 1

setupLocalNetworkFunction · 0.72