Skip to content

DumpStateHandler

DumpStateHandler: () => Promise<DumpStateResult>

Dumps the current state of the VM into a JSON-seralizable object

State can be dumped as follows

Example

const {state} = await tevm.dumpState()
fs.writeFileSync('state.json', JSON.stringify(state))

And then loaded as follows

Example

const state = JSON.parse(fs.readFileSync('state.json'))
await tevm.loadState({state})

Source

handlers/DumpStateHandler.ts:20


Generated using typedoc-plugin-markdown and TypeDoc