UNPKG

@muirglacier/testcontainers

Version:

A collection of TypeScript + JavaScript tools and libraries for DeFi Blockchain developers to build decentralized finance for Bitcoin

42 lines 1.63 kB
import Dockerode, { DockerOptions, Network } from 'dockerode'; import { MasterNodeRegTestContainer } from './Masternode'; import { RegTestContainer } from './index'; export declare class ContainerGroup { protected readonly containers: RegTestContainer[]; protected readonly name: string; protected readonly docker: Dockerode; protected network?: Network; constructor(containers?: RegTestContainer[], name?: string, options?: DockerOptions); /** * @param {number} index of masternode in group * @return {MasterNodeRegTestContainer} casted as MN convenience but it might be just a RegTestContainer */ get(index: number): MasterNodeRegTestContainer; start(): Promise<void>; /** * Require network, else error exceptionally. * Not a clean design, but it keep the complexity of this implementation low. */ protected requireNetwork(): Network; /** * @param {DeFiDContainer} container to add into container group with addnode */ add(container: RegTestContainer): Promise<void>; /** * Wait for all container to receive the same txid in mempool * * @param {string} txid to wait for in mempool * @param {number} [timeout=20000] in millis */ waitForMempoolSync(txid: string, timeout?: number): Promise<void>; /** * Wait for all container to sync up * @param {number} [timeout=20000] in millis */ waitForSync(timeout?: number): Promise<void>; /** * Stop container group and all containers associated with it */ stop(): Promise<void>; } //# sourceMappingURL=ContainerGroup.d.ts.map