Class: ICReplica
Defined in: services/ic-replica.ts:140
Implementation of the Replica for the Internet Computer (Mainnet) or standard dfx local replica.
Implements
Constructors
Constructor
new ICReplica(
opts):ICReplica
Defined in: services/ic-replica.ts:172
Creates a new ICReplica instance.
Parameters
| Parameter | Type | Description |
|---|---|---|
opts | { host: string; isDev?: boolean; manual?: boolean; port: number; } | - |
opts.host | string | The host URL of the replica (e.g. "https://ic0.app"). |
opts.isDev? | boolean | Whether this is a development environment (local) or production (mainnet). |
opts.manual? | boolean | If true, assumes the replica is already running (always true for mainnet). |
opts.port | number | The port number. |
Returns
ICReplica
Properties
ctx?
optionalctx:ICEGlobalArgs
Defined in: services/ic-replica.ts:145
host
readonlyhost:string="http://0.0.0.0"
Defined in: services/ic-replica.ts:141
The host URL of the replica.
Implementation of
Replica.host
isDev
readonlyisDev:boolean
Defined in: services/ic-replica.ts:144
manual?
readonlyoptionalmanual:boolean
Defined in: services/ic-replica.ts:143
port
readonlyport:number=8080
Defined in: services/ic-replica.ts:142
The port number of the replica.
Implementation of
Replica.port
proc?
optionalproc:ChildProcess
Defined in: services/ic-replica.ts:146
Methods
createActor()
createActor<
_SERVICE>(params):Promise<ActorSubclass<_SERVICE>>
Defined in: services/ic-replica.ts:691
Creates a typed actor for interacting with a canister.
Type Parameters
| Type Parameter |
|---|
_SERVICE |
Parameters
| Parameter | Type |
|---|---|
params | CreateActorParams |
Returns
Promise<ActorSubclass<_SERVICE>>
Implementation of
Replica.createActor
createCanister()
createCanister(
params):Promise<string>
Defined in: services/ic-replica.ts:517
Creates a new canister, returns the canister ID.
Parameters
| Parameter | Type |
|---|---|
params | CreateCanisterParams |
Returns
Promise<string>
Implementation of
Replica.createCanister
getCanisterInfo()
getCanisterInfo(
params):Promise<CanisterStatusResult>
Defined in: services/ic-replica.ts:295
Gets detailed information about a canister.
Parameters
| Parameter | Type |
|---|---|
params | GetCanisterStatusParams |
Returns
Promise<CanisterStatusResult>
Implementation of
Replica.getCanisterInfo
getCanisterStatus()
getCanisterStatus(
params):Promise<CanisterStatus>
Defined in: services/ic-replica.ts:272
Gets the status of a canister (running, stopped, etc.).
Parameters
| Parameter | Type |
|---|---|
params | GetCanisterStatusParams |
Returns
Promise<CanisterStatus>
Implementation of
Replica.getCanisterStatus
getTopology()
getTopology():
Promise<SubnetTopology[]>
Defined in: services/ic-replica.ts:702
Gets the subnet topology.
Returns
Promise<SubnetTopology[]>
Implementation of
Replica.getTopology
installCode()
installCode(
params):Promise<void>
Defined in: services/ic-replica.ts:416
Installs Wasm code to a canister.
Parameters
| Parameter | Type |
|---|---|
params | InstallCodeParams |
Returns
Promise<void>
Implementation of
Replica.installCode
removeCanister()
removeCanister(
params):Promise<void>
Defined in: services/ic-replica.ts:674
Removes/deletes a canister.
Parameters
| Parameter | Type |
|---|---|
params | GetCanisterStatusParams |
Returns
Promise<void>
Implementation of
Replica.removeCanister
start()
start(
ctx):Promise<void>
Defined in: services/ic-replica.ts:707
Starts the replica.
Parameters
| Parameter | Type |
|---|---|
ctx | ICEGlobalArgs |
Returns
Promise<void>
Implementation of
Replica.start
stop()
stop(
args?):Promise<void>
Defined in: services/ic-replica.ts:728
Stops the replica.
Parameters
| Parameter | Type |
|---|---|
args? | StopOptions |
Returns
Promise<void>
Implementation of
Replica.stop
stopCanister()
stopCanister(
params):Promise<void>
Defined in: services/ic-replica.ts:657
Stops a running canister.
Parameters
| Parameter | Type |
|---|---|
params | GetCanisterStatusParams |
Returns
Promise<void>
Implementation of
Replica.stopCanister