Skip to content

LocalNetManager

Defined in: src/network-manager.ts:19

Manager for LocalNet-specific network operations. These methods only work on LocalNet and will throw an error if called on other networks.

new LocalNetManager(algod, networkManager, algorand): LocalNetManager

Defined in: src/network-manager.ts:25

AlgodClient

The algod client to use for LocalNet operations

NetworkManager

AlgorandClient

LocalNetManager

blockWarp(targetRound): Promise<void>

Defined in: src/network-manager.ts:62

Advances the blockchain by generating blocks until the target round is reached.

bigint

The round number to advance to

Promise<void>

Error if not connected to LocalNet

// Advance LocalNet to round 100
await algorand.network.localNet.blockWarp(100n)

timeWarp(targetTimestamp): Promise<void>

Defined in: src/network-manager.ts:82

Advances the blockchain timestamp to a target Unix timestamp.

bigint

The target Unix timestamp in seconds

Promise<void>

Error if not connected to LocalNet

// Advance LocalNet time by 1 hour
const oneHourFromNow = BigInt(Math.floor(Date.now() / 1000)) + 3600n
await algorand.network.localNet.timeWarp(oneHourFromNow)