UNPKG

@ethersphere/bee-factory

Version:

Local Ethereum Swarm development stack

60 lines 3.53 kB
import { ContractAddresses } from '../blockchain/deploy'; import { NodeConfig } from '../config'; export declare function beeImageExists(ref: string): Promise<boolean>; export declare function buildBeeImage(ref: string): Promise<void>; export declare function hubImageName(containerName: string, tag: string): string; export declare function tryPullPrebuiltImages(tag: string): Promise<boolean>; export declare function restoreAnvilState(): Promise<ContractAddresses>; export declare function pullImageIfNeeded(image: string): Promise<void>; export declare function createNetwork(): Promise<void>; export declare function removeNetwork(): Promise<void>; export declare function stopAndRemoveContainer(name: string): Promise<void>; export declare function startAnvil(blockTime?: number | undefined, imageOverride?: string): Promise<void>; export declare function startBeeNodeWithTag(config: NodeConfig, contractAddresses: ContractAddresses, keystoreDir: string | undefined, tag: string, bootnodeAddr?: string, blockTime?: number | undefined, imageOverride?: string): Promise<void>; export declare function cleanupAll(): Promise<void>; /** * Poll url until we get any HTTP response (any status), or 200 specifically. * For Anvil (JSON-RPC over HTTP) we send a minimal eth_chainId POST because * a plain GET returns 400 – but a 400 still proves the server is up. */ export declare function waitForHttp(url: string, timeoutMs: number): Promise<void>; /** * Like waitForHttp but also watches the named container — if it exits before * the URL becomes ready, immediately throws with the container's tail logs so * CI failures are actionable rather than a bare timeout. */ export declare function waitForContainerHttp(containerName: string, url: string, timeoutMs: number): Promise<void>; /** * Poll /status on a bee node until isWarmingUp is false, failing fast if the * container exits. Call this after waitForContainerHttp confirms the API is up. */ export declare function waitForBeeReady(containerName: string, apiPort: number, timeoutMs: number): Promise<void>; /** * Poll /rchash until it returns 200. After restoring chain state and restarting * Bee from a committed image, the reserve sampler needs the chain head to * advance past a redistribution round and Bee to reprocess events before * sampling chunks with proofs succeeds. Polling the actual endpoint is more * reliable than a fixed sleep. */ export declare function waitForRchashReady(apiPort: number, timeoutMs: number): Promise<void>; /** * Poll GET /addresses on the queen node until it returns a non-empty list of * underlay addresses, then return the first one that contains the internal * Docker network IP (i.e. not a loopback or external address). */ export declare function getQueenBootnodeAddr(apiPort: number): Promise<string>; /** * Forces full peer mesh by POSTing /connect for every (A → B) pair. Bee * normally fills its peer table via hive gossip from the bootnode, but the * gossip cycle can take >2 min on noisy CI runners and races with * generateTraffic's peer-existence check. Issuing /connect directly removes * the race — a successful 200 means the libp2p handshake completed, after * which the peer is in /peers immediately. * * 4xx from /connect (e.g. already connected) is treated as success; everything * else is logged but not fatal so a single transient hiccup can't fail boot. */ export declare function formPeerMesh(nodes: { apiPort: number; }[]): Promise<void>; //# sourceMappingURL=manager.d.ts.map