QanetTestEnvironment
Midnight.js API Reference v2.0.2
Midnight.js API Reference / @midnight-ntwrk/midnight-js-testing / QanetTestEnvironment
Class: QanetTestEnvironment
Test environment configuration for the Midnight QA network. Provides URLs and endpoints for QA network services.
Extendsβ
Constructorsβ
Constructorβ
new QanetTestEnvironment(
logger):QanetTestEnvironment
Creates a new TestEnvironment instance.
Parametersβ
loggerβ
Logger
Logger instance for recording operations
Returnsβ
QanetTestEnvironment
Inherited fromβ
RemoteTestEnvironment.constructor
Methodsβ
getEnvironmentConfiguration()β
getEnvironmentConfiguration():
EnvironmentConfiguration
Returns the configuration for the QA network environment services.
Returnsβ
Object containing URLs for QA network 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