Skip to main content
Module

x/smoldot2/internals/local-instance.d.ts>startLocalInstance

Lightweight client for Substrate-based chains, such as Polkadot and Kusama.
Go to Latest
function startLocalInstance
import { startLocalInstance } from "https://deno.land/x/smoldot2@light-js-deno-v2.0.4/internals/local-instance.d.ts";

Starts a new instance using the given configuration.

Even though this function doesn't do anything asynchronous, it needs to be asynchronous due to the fact that WebAssembly.instantiate is for some reason asynchronous.

After this function returns, the execution of CPU-heavy tasks of smoldot will happen asynchronously in the background.

This instance is low-level in the sense that invalid input can lead to crashes and that input isn't sanitized. In other words, you know what you're doing.

Parameters

config: Config
wasmModule: WebAssembly.Module
eventCallback: (event: Event) => void