@holochain/tryorama
Version:
Toolset to manage Holochain conductors and facilitate running test scenarios
77 lines (76 loc) • 2.75 kB
TypeScript
import { AppInfo, ClonedCell, ProvisionedCell } from "@holochain/client";
import { ChildProcessWithoutNullStreams } from "node:child_process";
import { AgentApp, CallableCell, CellZomeCallRequest, IAdminWebsocket, IAppWebsocket, IConductor } from "./types.js";
/**
* @internal
*/
export declare const _ALLOWED_ORIGIN = "tryorama-interface";
/**
* Spawn a signalling server to enable connections between conductors.
*
* @public
*/
export declare const runLocalServices: () => Promise<{
servicesProcess: ChildProcessWithoutNullStreams;
bootstrapServerUrl: URL;
signalingServerUrl: URL;
}>;
/**
* Shutdown signalling server process.
*
* @public
*/
export declare const stopLocalServices: (localServicesProcess: ChildProcessWithoutNullStreams) => Promise<number | null> | null;
/**
* Add all agents of all conductors to each other. Shortcuts peer discovery
* through a bootstrap server or gossiping.
*
* @param conductors - Conductors to mutually exchange all agents with.
*
* @public
*/
export declare const addAllAgentsToAllConductors: (conductors: IConductor[]) => Promise<void>;
/**
* Enable an app and build an agent app object.
*
* @param adminWs - The admin websocket to use for admin requests.
* @param appWs - The app websocket to use for app requests.
* @param appInfo - The app info of the app to enable.
* @returns An app agent object.
*
* @public
*/
export declare const enableAndGetAgentApp: (adminWs: IAdminWebsocket, appWs: IAppWebsocket, appInfo: AppInfo) => Promise<AgentApp>;
/**
* Create curried version of `callZome` function for a specific cell.
*
* @param appWs - App websocket to use for calling zome.
* @param cell - Cell to bind zome call function to.
* @returns A callable cell.
*
* @public
*/
export declare const getCallableCell: (appWs: IAppWebsocket, cell: ClonedCell | ProvisionedCell) => {
callZome: <T>(request: CellZomeCallRequest, timeout?: number) => Promise<T>;
cell_id: import("@holochain/client").CellId;
clone_id: string;
original_dna_hash: Uint8Array;
dna_modifiers: import("@holochain/client").DnaModifiers;
name: string;
enabled: boolean;
} | {
callZome: <T>(request: CellZomeCallRequest, timeout?: number) => Promise<T>;
cell_id: import("@holochain/client").CellId;
dna_modifiers: import("@holochain/client").DnaModifiers;
name: string;
};
/**
* Get a shorthand function to call a cell's zome.
*
* @param cell - The cell to call the zome on.
* @param zomeName - The name of the Zome to call.
* @returns A function to call the specified Zome.
*
* @public
*/
export declare const getZomeCaller: (cell: CallableCell, zomeName: string) => <T>(fnName: string, payload?: unknown, timeout?: number) => Promise<T>;