Skip to content
Logo

load

Loads a Cartesi machine instance from a previously stored directory, with optional runtime configuration. Returns a CartesiMachine instance. This is the main entry point for restoring a machine from a saved state.

Function Signature

load(dir: string, runtimeConfig?: MachineRuntimeConfig, sharing?: SharingMode): CartesiMachine

Example

import { ,  } from "@cartesi/machine";
 
// Load a machine from a previously stored directory
const  = ("my-machine-snapshot");
 
// Run the machine until it yields or halts (default is MAX_MCYCLE)
const  = .();
if ( === .) {
    .("Machine halted");
}