The TesterService is a part of a NestJS application that automates cross-chain transaction testing for various blockchain networks. It periodically schedules and executes tasks to simulate transactions between different chains using different bridge contracts.
• Installation
• Usage
• Configuration
• Service Details
To use the TesterService, ensure you have the following dependencies installed in your NestJS project:
yarn install
The TesterService is initialized on NestJS module startup. It reads configuration data and sets up scheduled tasks to execute cross-chain transactions.
yarn start
The service uses @nestjs/schedule
to schedule tasks at regular intervals. These tasks are responsible for simulating cross-chain transactions using specified bridge contracts lnv2/lnv3
.
The service reads configuration data from local file /.maintain/configure.json
.
Classes and Interfaces
• ChainInfo: Holds information about a blockchain network.
• BridgeConnectInfo: Contains connection details for a bridge contract.
• LnProviderInfo: Contains information about a liquidity provider.
• LnBridge: Represents a bridge with liquidity providers and configuration details.
onModuleInit
This method is called when the module is initialized. It sets up the configuration and schedules tasks for each bridge.
initConfigure
Initializes the configuration for chains and bridges. It reads the configuration from the ConfigureService and sets up the necessary data structures.
requestBridge
Simulates a real cross-chain transaction using the specified bridge. It constructs the necessary parameters and sends the transaction.
The TesterService logs important events information such as task scheduling, transaction execution, and errors using the NestJS logger.