DevnetTestEnvironment
Midnight.js API Reference v2.0.2
Midnight.js API Reference / @midnight-ntwrk/midnight-js-testing / DevnetTestEnvironment
Class: DevnetTestEnvironment
Test environment configuration for the Midnight devnet network. Provides URLs and endpoints for devnet services.
Extends
Constructors
Constructor
new DevnetTestEnvironment(
logger):DevnetTestEnvironment
Creates a new TestEnvironment instance.
Parameters
logger
Logger
Logger instance for recording operations
Returns
DevnetTestEnvironment
Inherited from
RemoteTestEnvironment.constructor
Methods
getEnvironmentConfiguration()
getEnvironmentConfiguration():
EnvironmentConfiguration
Returns the configuration for the devnet environment services.
Returns
Object containing URLs for devnet services:
- indexer: GraphQL API endpoint for the indexer
- indexerWS: WebSocket endpoint for the indexer
- node: RPC endpoint for the blockchain node
- faucet: API endpoint for requesting test tokens
- proofServer: URL for the proof generation server
Overrides
RemoteTestEnvironment.getEnvironmentConfiguration
getMidnightWalletProvider()
getMidnightWalletProvider():
Promise<MidnightWalletProvider>
Starts a single wallet instance.
Returns
Promise<MidnightWalletProvider>
A promise that resolves to the started wallet
Throws
If no wallet could be started
Inherited from
RemoteTestEnvironment.getMidnightWalletProvider
healthCheck()
healthCheck():
Promise<void>
Performs a health check for the environment. Checks the health of the node, indexer, and optionally the faucet services.
Returns
Promise<void>
A promise that resolves when the health check is complete.
Inherited from
RemoteTestEnvironment.healthCheck
shutdown()
shutdown(
saveWalletState?):Promise<void>
Shuts down the test environment by closing all walletProviders and stopping the proof server.
Parameters
saveWalletState?
boolean
Returns
Promise<void>
Inherited from
RemoteTestEnvironment.shutdown
start()
start(
maybeProofServerContainer?):Promise<EnvironmentConfiguration>
Starts the test environment by initializing the proof server and environment configuration.
Parameters
maybeProofServerContainer?
Optional proof server container to use instead of creating a new one
Returns
Promise<EnvironmentConfiguration>
The environment configuration
Inherited from
startMidnightWalletProviders()
startMidnightWalletProviders(
amount,seeds):Promise<MidnightWalletProvider[]>
Creates and starts the specified number of wallet providers.
Parameters
amount
number = 1
seeds
undefined | string[]
Returns
Promise<MidnightWalletProvider[]>
Array of started wallet providers