Skip to content

API Reference


Type Alias: Replica

Replica = object

Defined in: services/replica.ts:377

The interface for a replica connection (local or remote).

Properties

createActor()

createActor: <_SERVICE>(params) => Promise<ActorSubclass<_SERVICE>>

Defined in: services/replica.ts:395

Creates a typed actor for interacting with a canister.

Type Parameters

Type Parameter
_SERVICE

Parameters

ParameterType
paramsCreateActorParams

Returns

Promise<ActorSubclass<_SERVICE>>


createCanister()

createCanister: (params) => Promise<string>

Defined in: services/replica.ts:393

Creates a new canister, returns the canister ID.

Parameters

ParameterType
paramsCreateCanisterParams

Returns

Promise<string>


getCanisterInfo()

getCanisterInfo: (params) => Promise<CanisterInfo>

Defined in: services/replica.ts:387

Gets detailed information about a canister.

Parameters

ParameterType
paramsGetCanisterStatusParams

Returns

Promise<CanisterInfo>


getCanisterStatus()

getCanisterStatus: (params) => Promise<CanisterStatus>

Defined in: services/replica.ts:385

Gets the status of a canister (running, stopped, etc.).

Parameters

ParameterType
paramsGetCanisterStatusParams

Returns

Promise<CanisterStatus>


getTopology()

getTopology: () => Promise<SubnetTopology[]>

Defined in: services/replica.ts:397

Gets the subnet topology.

Returns

Promise<SubnetTopology[]>


host

host: string

Defined in: services/replica.ts:379

The host URL of the replica.


installCode()

installCode: (params) => Promise<void>

Defined in: services/replica.ts:383

Installs Wasm code to a canister.

Parameters

ParameterType
paramsInstallCodeParams

Returns

Promise<void>


port

port: number

Defined in: services/replica.ts:381

The port number of the replica.


removeCanister()

removeCanister: (params) => Promise<void>

Defined in: services/replica.ts:391

Removes/deletes a canister.

Parameters

ParameterType
paramsGetCanisterStatusParams

Returns

Promise<void>


start()

start: (ctx) => Promise<void>

Defined in: services/replica.ts:399

Starts the replica.

Parameters

ParameterType
ctxReplicaContext

Returns

Promise<void>


stop()

stop: (args?, ctx?) => Promise<void>

Defined in: services/replica.ts:401

Stops the replica.

Parameters

ParameterType
args?StopOptions
ctx?ReplicaContext

Returns

Promise<void>


stopCanister()

stopCanister: (params) => Promise<void>

Defined in: services/replica.ts:389

Stops a running canister.

Parameters

ParameterType
paramsGetCanisterStatusParams

Returns

Promise<void>