empty
Creates an empty Cartesi machine object. The returned object does not hold a machine instance and must be initialized by calling create() or load() before it can be used for computation.
Function Signature
empty(): CartesiMachineExample
import { } from "@cartesi/machine";
// Create an empty machine object
const = ();
// At this point, the machine is not initialized and cannot be used for computation
.(.()); // true
// You must initialize it with create() or load() before use
.({
: { : 0x8000000 },
// ... other config fields ...
});
.(.()); // falseNotes
- Calling any method that requires an initialized machine (such as
run()orgetRootHash()) on an empty machine will result in an error. - Always check
isEmpty()if you are unsure whether a machine object has been initialized.