diff --git a/CHANGELOG.md b/CHANGELOG.md index 5dce5416..8a19dd32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,11 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ### Changed ### Fixed +## [0.5.4] + +### Added +- Export function to add all agents to all conductors. + ## [0.5.3] ### Added diff --git a/docs/tryorama.addallagentstoallconductors.md b/docs/tryorama.addallagentstoallconductors.md new file mode 100644 index 00000000..d0310075 --- /dev/null +++ b/docs/tryorama.addallagentstoallconductors.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [@holochain/tryorama](./tryorama.md) > [addAllAgentsToAllConductors](./tryorama.addallagentstoallconductors.md) + +## addAllAgentsToAllConductors variable + +Add all agents of all conductors to each other. Shortcuts peer discovery through a bootstrap server or gossiping. + +Signature: + +```typescript +addAllAgentsToAllConductors: (conductors: IConductor[]) => Promise +``` diff --git a/docs/tryorama.conductor.installagentshapps.md b/docs/tryorama.conductor.installagentshapps.md index b7787f17..aa297d36 100644 --- a/docs/tryorama.conductor.installagentshapps.md +++ b/docs/tryorama.conductor.installagentshapps.md @@ -25,5 +25,5 @@ installAgentsHapps(options: { Promise<[AgentHapp](./tryorama.agenthapp.md)\[\]> -An array with each agent's hApp. +An array with each agent's hApps. diff --git a/docs/tryorama.getzomecaller.md b/docs/tryorama.getzomecaller.md new file mode 100644 index 00000000..3ccdc903 --- /dev/null +++ b/docs/tryorama.getzomecaller.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [@holochain/tryorama](./tryorama.md) > [getZomeCaller](./tryorama.getzomecaller.md) + +## getZomeCaller variable + +Get a shorthand function to call a Cell's Zome. + +Signature: + +```typescript +getZomeCaller: (cell: CallableCell, zomeName: string) => (fnName: string, payload: unknown) => Promise +``` diff --git a/docs/tryorama.md b/docs/tryorama.md index c6a18dde..2e80d6e1 100644 --- a/docs/tryorama.md +++ b/docs/tryorama.md @@ -84,11 +84,13 @@ TryCP stands for Tryorama Control Protocol (TryCP) and is a protocol to enable r | Variable | Description | | --- | --- | +| [addAllAgentsToAllConductors](./tryorama.addallagentstoallconductors.md) | Add all agents of all conductors to each other. Shortcuts peer discovery through a bootstrap server or gossiping. | | [cleanAllConductors](./tryorama.cleanallconductors.md) | Run the hc command to delete all conductor data. | | [cleanAllTryCpConductors](./tryorama.cleanalltrycpconductors.md) | Run the reset command on the TryCP server to delete all conductor data. | | [createConductor](./tryorama.createconductor.md) | The function to create a conductor. It starts a sandbox conductor via the Holochain CLI. | | [createTryCpConductor](./tryorama.createtrycpconductor.md) | The function to create a TryCP Conductor (aka "Player"). | | [DEFAULT\_PARTIAL\_PLAYER\_CONFIG](./tryorama.default_partial_player_config.md) | The default partial config for a TryCP conductor. | +| [getZomeCaller](./tryorama.getzomecaller.md) | Get a shorthand function to call a Cell's Zome. | | [pause](./tryorama.pause.md) | A utility function to wait the given amount of time. | | [runScenario](./tryorama.runscenario.md) | A wrapper function to create and run a scenario. A scenario is created and all involved conductors are shut down and cleaned up after running. | | [TRYCP\_SUCCESS\_RESPONSE](./tryorama.trycp_success_response.md) | Empty success response. | diff --git a/package.json b/package.json index f79229c0..c73a9ce2 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@holochain/tryorama", "description": "Toolset to manage Holochain conductors and facilitate running test scenarios", - "version": "0.5.3", + "version": "0.5.4", "author": "Holochain Foundation", "keywords": [ "holochain", diff --git a/ts/src/common.ts b/ts/src/common.ts index 690296f0..c5355b20 100644 --- a/ts/src/common.ts +++ b/ts/src/common.ts @@ -11,6 +11,14 @@ import { IConductor, } from "./types.js"; +/** + * 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 const addAllAgentsToAllConductors = async (conductors: IConductor[]) => { await Promise.all( conductors.map(async (playerToShareAbout, playerToShareAboutIdx) => { @@ -86,6 +94,15 @@ const getCallableCell = ( }, }); +/** + * 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 const getZomeCaller = (cell: CallableCell, zomeName: string) => (fnName: string, payload: unknown): Promise => diff --git a/ts/src/index.ts b/ts/src/index.ts index 006991a7..0744154e 100644 --- a/ts/src/index.ts +++ b/ts/src/index.ts @@ -12,5 +12,6 @@ */ export * from "./local/index.js"; export * from "./trycp/index.js"; +export { addAllAgentsToAllConductors, getZomeCaller } from "./common.js"; export * from "./types.js"; export * from "./util.js";