@holochain/tryorama
Version:
Toolset to manage Holochain conductors and facilitate running test scenarios
78 lines (77 loc) • 2.83 kB
TypeScript
import { AdminWebsocket, AppInfo, AppWebsocket, ClonedCell, ProvisionedCell, RoleName } from "@holochain/client";
import { ChildProcessWithoutNullStreams } from "node:child_process";
import { Conductor } from "./conductor.js";
import { AgentApp, CallableCell, CellZomeCallRequest } from "./types.js";
/**
* @internal
*/
export declare const _ALLOWED_ORIGIN = "tryorama-interface";
/**
* Spawn bootstrap and signalling server to enable peer discovery and connections between peers.
*
* @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: Conductor[]) => 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: AdminWebsocket, appWs: AppWebsocket, 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: AppWebsocket, cell: ClonedCell | ProvisionedCell) => {
callZome: <T>(request: CellZomeCallRequest, timeout?: number) => Promise<T>;
cell_id: import("@holochain/client").CellId;
clone_id: RoleName;
original_dna_hash: import("@holochain/client").DnaHash;
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>;