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.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new LocalNetManager(
algod,networkManager,algorand):LocalNetManager
Defined in: src/network-manager.ts:25
Parameters
Section titled “Parameters”The algod client to use for LocalNet operations
networkManager
Section titled “networkManager”algorand
Section titled “algorand”Returns
Section titled “Returns”LocalNetManager
Methods
Section titled “Methods”blockWarp()
Section titled “blockWarp()”blockWarp(
targetRound):Promise<void>
Defined in: src/network-manager.ts:62
Advances the blockchain by generating blocks until the target round is reached.
Parameters
Section titled “Parameters”targetRound
Section titled “targetRound”bigint
The round number to advance to
Returns
Section titled “Returns”Promise<void>
Throws
Section titled “Throws”Error if not connected to LocalNet
Example
Section titled “Example”// Advance LocalNet to round 100await algorand.network.localNet.blockWarp(100n)timeWarp()
Section titled “timeWarp()”timeWarp(
targetTimestamp):Promise<void>
Defined in: src/network-manager.ts:82
Advances the blockchain timestamp to a target Unix timestamp.
Parameters
Section titled “Parameters”targetTimestamp
Section titled “targetTimestamp”bigint
The target Unix timestamp in seconds
Returns
Section titled “Returns”Promise<void>
Throws
Section titled “Throws”Error if not connected to LocalNet
Example
Section titled “Example”// Advance LocalNet time by 1 hourconst oneHourFromNow = BigInt(Math.floor(Date.now() / 1000)) + 3600nawait algorand.network.localNet.timeWarp(oneHourFromNow)