Skip to content
Logo

RemoteCartesiMachine

Interface

This is the complete TypeScript interface of a remote machine object, which extends CartesiMachine. Descriptions for each method are in the following sections.

export interface RemoteCartesiMachine extends CartesiMachine {
    getServerAddress(): string;
    getServerPid(): number | null;
    shutdown(): void;
    rebind(address: string): string;
    emancipate(): void;
    setTimeout(ms: number): void;
    getTimeout(): number;
    setCleanupCall(call: CleanupCall): void;
    getCleanupCall(): CleanupCall;
    getServerVersion(): string;
    delayNextRequest(ms: number): void;
    getBoundAddress(): string | null;
    fork(): RemoteCartesiMachine;
    load(dir: string, runtimeConfig?: MachineRuntimeConfig): RemoteCartesiMachine;
    create(config: MachineConfig, runtimeConfig?: MachineRuntimeConfig): RemoteCartesiMachine;
    cloneEmpty(): RemoteCartesiMachine;
    store(dir: string): RemoteCartesiMachine;
}

getServerAddress

Retrieves the address of the remote machine server.

getServerAddress(): string;

getServerPid

Returns the server process ID if the server was spawned, or null if not available.

getServerPid(): number | null;

shutdown

Shuts down the remote machine server. Does not delete the machine object.

shutdown(): void;

rebind

Changes the address that the remote machine server is listening to and returns the actual bound address.

rebind(address: string): string;

emancipate

Makes the server the leader of its own process group.

emancipate(): void;

setTimeout

Sets a timeout (in milliseconds) for communication with the remote machine server.

setTimeout(ms: number): void;

getTimeout

Gets the current timeout (in milliseconds) for communication with the remote machine server.

getTimeout(): number;

setCleanupCall

Configures the implicit cleanup call to be performed when the object is deleted.

setCleanupCall(call: CleanupCall): void;

getCleanupCall

Retrieves the implicit cleanup call that will be performed when the object is deleted.

getCleanupCall(): CleanupCall;

getServerVersion

Gets the semantic version of the remote machine server.

getServerVersion(): string;

delayNextRequest

Asks the server to delay the next request by the given number of milliseconds.

delayNextRequest(ms: number): void;

getBoundAddress

Gets the address the server actually bound to (only available for spawned servers).

getBoundAddress(): string | null;

fork

Forks the remote machine server, creating a new server process and machine object.

fork(): RemoteCartesiMachine;

load

Loads a remote machine instance from a previously stored directory, with optional runtime configuration. Returns a RemoteCartesiMachine instance, allowing method chaining. Semantics are the same as for CartesiMachine.load.

load(dir: string, runtimeConfig?: MachineRuntimeConfig): RemoteCartesiMachine

create

Creates a new remote machine instance from the given configuration and optional runtime configuration. Returns a RemoteCartesiMachine instance, allowing method chaining. Semantics are the same as for CartesiMachine.create.

create(config: MachineConfig, runtimeConfig?: MachineRuntimeConfig): RemoteCartesiMachine

cloneEmpty

Clones an empty remote machine object from an existing one. Returns a RemoteCartesiMachine instance, allowing method chaining. Semantics are the same as for CartesiMachine.cloneEmpty.

cloneEmpty(): RemoteCartesiMachine

store

Stores the current remote machine instance to a directory, serializing its entire state. Returns a RemoteCartesiMachine instance, allowing method chaining. Semantics are the same as for CartesiMachine.store.

store(dir: string): RemoteCartesiMachine