Skip to content

Latest commit

 

History

History
1229 lines (543 loc) · 16.7 KB

tryorama.md

File metadata and controls

1229 lines (543 loc) · 16.7 KB

Home > @holochain/tryorama

tryorama package

Tryorama

Tools for managing Holochain Conductors and TryCP Conductors.

Remarks

TryCP stands for Tryorama Control Protocol and is a protocol to enable remote management of Holochain conductors on network hosts.

Classes

Class

Description

Conductor

A class to manage a conductor running on localhost.

Scenario

An abstraction of a test scenario to write tests against Holochain hApps, running on a local conductor.

TryCpClient

A factory class to create client connections to a running TryCP server.

With a client, conductors on the server can ba configured, started and stopped. All valid Admin and App API commands can be sent to the server too.

TryCpConductor

A class to manage a conductor running on a TryCP server.

TryCpScenario

A test scenario abstraction with convenience functions to manage TryCP clients and players (agent + conductor).

Clients in turn help manage conductors on TryCP servers. Clients can be added to a scenario to keep track of all server connections. When finishing a test scenario, all conductors of all clients can be easily cleaned up and the client connections closed.

TryCpServer

A factory class to start and stop local instances of the TryCP server.

Enumerations

Enumeration

Description

NetworkType

The network type the conductor should use to communicate with peers.

Functions

Function

Description

addAllAgentsToAllConductors(conductors)

Add all agents of all conductors to each other. Shortcuts peer discovery through a bootstrap server or gossiping.

areConductorCellsDhtsSynced(conductorCells)

A utility function to compare conductors' integrated DhtOps.

areDhtsSynced(players, dnaHash)

A utility function to compare conductors' integrated DhtOps.

cleanAllConductors()

Run the hc command to delete all conductor data.

conductorCellsDhtSync(conductorCells, interval, timeout)

A utility function to wait until all conductors' integrated DhtOps are identical for a DNA.

createConductor(signalingServerUrl, options)

The function to create a conductor. It starts a sandbox conductor via the Holochain CLI.

createTryCpConductor(tryCpClient, options)

The function to create a TryCP Conductor. By default configures and starts it.

dhtSync(players, dnaHash, interval, timeout)

A utility function to wait until all conductors' integrated DhtOps are identical for a DNA.

enableAndGetAgentApp(adminWs, appWs, appInfo)

Enable an app and build an agent app object.

getCallableCell(appWs, cell)

Create curried version of callZome function for a specific cell.

getZomeCaller(cell, zomeName)

Get a shorthand function to call a cell's zome.

pause(milliseconds)

A utility function to wait the given amount of time.

runLocalServices()

Spawn a signalling server to enable connections between conductors.

runScenario(testScenario, cleanUp, options)

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.

stopLocalServices(localServicesProcess)

Shutdown signalling server process.

Interfaces

Interface

Description

AdminApiResponseAgentInfo

AdminApiResponseAgentInfoAdded

AdminApiResponseAgentPubKeyGenerated

AdminApiResponseAppAuthenticationTokenIssued

AdminApiResponseAppDisabled

AdminApiResponseAppEnabled

AdminApiResponseAppInstalled

AdminApiResponseAppInterfaceAttached

AdminApiResponseAppInterfacesListed

AdminApiResponseAppsListed

AdminApiResponseAppStarted

AdminApiResponseAppUninstalled

AdminApiResponseCellIdsListed

AdminApiResponseCloneCellDeleted

AdminApiResponseCoordinatorsUpdated

AdminApiResponseDnaRegistered

AdminApiResponseDnasDefinitionReturned

AdminApiResponseDnasListed

AdminApiResponseFullStateDumped

AdminApiResponseNetworkStatsDumped

AdminApiResponseStateDumped

AdminApiResponseStorageInfo

AdminApiResponseZomeCallCapabilityGranted

AgentApp

Provides direct access to cells of an app and the agent key.

ApiErrorResponse

Error response from the Admin or App API.

AppApiResponseAppInfo

AppApiResponseCloneCellCreated

AppApiResponseCloneCellDisabled

AppApiResponseCloneCellEnabled

AppApiResponseNetworkInfo

AppApiResponseZomeCall

AppOptions

Optional arguments when installing a hApp.

ClientPlayers

A TryCP client and its associated players.

ClientsPlayersOptions

ConductorOptions

Dna

DNA source and additional options.

IConductor

Base interface of a Tryorama conductor. Both Conductor and TryCpConductor implement this interface.

IConductorCell

A Conductor and a CellId

IPlayer

Combines an agent hApp with the conductor they belong to.

Player

A player tied to a Conductor.

RequestAdminInterfaceMessage

All possible calls to the Admin API.

RequestAdminInterfaceMessageType

The types of all possible calls to the Admin API.

RequestAppInfo

Request app info from a conductor.

RequestCallAdminInterface

Request a call to the Admin API.

RequestCallAppInterface

Request a call to the App API.

RequestCallAppInterfaceEncoded

Msgpack encoded request to call an app interface.

RequestCallZome

Request to call a zome on a conductor's app interface.

RequestConfigurePlayer

Request to create configuration files and directories for a conductor.

RequestConnectAppInterface

Request to connect an app interface to a conductor.

RequestCreateCloneCell

Create a clone cell.

RequestDeleteCloneCell

Delete a disabled clone cell.

RequestDisableCloneCell

Disable a clone cell.

RequestDisconnectAppInterface

Request to disconnect a connected app interface from a conductor.

RequestDownloadDna

Request to download a DNA from a URL.

RequestEnableCloneCell

Enable a disabled clone cell.

RequestNetworkInfo

Request network info.

RequestReset

Request deletion of **all** conductors.

RequestSaveDna

Request to save a DNA to the server's file system.

RequestShutdown

Request shutdown of a conductor.

RequestStartup

Request startup of a conductor.

ScenarioOptions

Options when creating a scenario.

TryCpConductorOptions

TryCpPlayer

A player tied to a TryCpConductor.

Variables

Variable

Description

DEFAULT_PARTIAL_PLAYER_CONFIG

The default partial config for a TryCP conductor.

TRYCP_SERVER_HOST

Default TryCP server host address.

TRYCP_SERVER_PORT

Default TryCP server port.

TRYCP_SUCCESS_RESPONSE

Empty success response.

Type Aliases

Type Alias

Description

AdminApiResponse

All possible responses from the Admin API.

AgentsAppsOptions

An app and an optional agent pub key for each agent. Optionally a network seed to be used for DNA installation.

AppApiResponse

App API Responses.

CallableCell

Extends an installed cell by a function to call a zome.

CallZomeFn

The function for calling a zome from a specific cell.

CellZomeCallRequest

The zome request options adapted to a specific cell.

ConductorId

CreateConductorOptions

Options for using the conductor factory.

IAdminWebsocket

AdminWebsocket interface for local and TryCP conductors.

IAppWebsocket

AppWebsocket interface for local and TryCP conductors.

RequestCallAppInterfaceMessage

All possible calls to the App API.

TryCpApiResponse

Possible responses from the Admin and App APIs.

TryCpConductorLogLevel

Log level for a TryCP conductor.

TryCpRequest

Contains all possible request types.

TryCpResponseErrorValue

Error response values.

TryCpSuccessResponse

Possible values a for success response from the TryCP server.