Information about the current state of the Action Handler
Process actions against deterministically accumulating Updater
functions. Returns a promise of versioned actions
for consumption by runEffects
, to make sure the correct effects are run on blocks that include a HandlerVersion
change. To change a HandlerVersion
, have an Updater
function return the versionName
of the corresponding
HandlerVersion
you want to change to.
Calls applyUpdaters
and runEffects
on the given actions
Receive block, validate, and handle actions with updaters and effects
Performs all required initialization for the handler.
This method is used when matching the types of incoming actions against the types the Updater
s and Effect
s are
subscribed to. When this returns true, their corresponding functions will run.
By default, this method tests for direct equivalence between the incoming candidate type and the type that is subscribed. Override this method to extend this functionality (e.g. wildcards).
The incoming action's type
The type the Updater of Effect is subscribed to
Migrates the database by the given sequenceName. There must be a MigrationSequence
with this name, or this will
throw an error.
The name of the MigrationSequence to be run.
Process versioned actions against asynchronous side effects.
Sets up the database by idempotently creating the schema, installing CyanAudit, creates internally used tables, and runs any initial migration sequences provided.
Connects to a Postgres database using MassiveJS. Make sure to call
setupDatabase
to create the needed internally-used tables_migration
,_index_state
, and_block_number_txid
. This will also automatically migrate the database with the provided MigrationSequence if namedinit
.See
HandlerVersion
parameter from demux-jsAn instance of of a
massive
object provided by MassiveJS, connected to the database you want this instance to interface withThe name of the schema you would like to use. If it doesn't exist, it will be created when
setupDatabase
is called.An array of
MigrationSequence
s available to call viastate.migrate(<name of sequence>)
, commonly fromUpdater
'sapply
functions that also change theHandlerVersion
.