@statechannels/server-wallet > SingleThreadedEngine

SingleThreadedEngine class

A single-threaded Nitro engine


export declare class SingleThreadedEngine implements EngineInterface

Implements: EngineInterface


(constructor)(config, logger)Protected method. Initialize engine via Engine.create(..)




addSigningKey(privateKey)Adds an ethereum private key to the engine's database
challenge(channelId)Trigger an on-chain challenge.
closeChannel({ channelId, })Attempts to collaboratively close a channel.
closeChannels(channelIds)Attempts to collaboratively close a list of channels.
crank(channelIds)Attempts to make progress on any open objectives for the specified channels. This is used to make progress on objectives after something has changed in the store.
create(engineConfig, logger)static
createChannel(args)Creates a channel.
createChannels(args, numberOfChannels)Creates multiple channels with the same parameters. See SingleThreadedEngine.createChannel().
createLedgerChannel(args, fundingStrategy)Creates a ledger channel.
destroy()Destroy this engine instance
getApprovedObjectives()Gets any objectives with an approved status
getChannels()Gets the latest state for each channel in the engine's store.
getLedgerChannels(participants)Gets the latest state for each ledger channel in the engine's store.
getObjective(objectiveId)Gets the objective for a given id.
getSigningAddress()Get the signing address for this engine, or create it if it does not exist.
getState({ channelId })Gets the latest state for a channel.
joinChannel({ channelId })Joins a channel.
joinChannels(channelIds)Joins a list of channels.
pushMessage(rawPayload)Push a message from a counterparty into the engine.
pushUpdate(rawPayload)Push a message containing a single update to a running application channel.
registerAppBytecode(appDefinition, bytecode)Stores the supplied ForceMoveApp definition bytecode against the supplied blockchain address.
syncChannel({ channelId })Trigger a response containing a message for all counterparties, with all stored states for a given channel.
syncChannels(channelIds)Trigger a response containing a message for counterparties, with all stored states for each a set of channels.
syncObjectives(objectiveIds)Trigger a response containing a message for counterparties, with all objectives and channels for a set of objectives.
updateChannel({ channelId, allocations, appData, })Updates a channel with a new state.