/custom
subdirectory.
Setup a new project directory
mod.rs
(and add your related files)
runes
indexer for reference).
TransactionIndexerType
enum variant:
ProcessTransaction
trait.
task
: read/write interface to storagetx
: the transaction being processedctx
: context with input resolver, block height, hash, network, arbitrary data to outputs, etc.runes/indexer.rs#L41-L61
new()
function that takes a configuration struct and returns an instance of the indexer.
This enables configuration-driven behavior such as start_height, track_inputs, or custom logic.
MyProjIndexerConfig
struct should define fields relevant to your indexer.
Reference
define_indexer_table!
macro.
table
IDEncode
and Decode
tx_count_by_address.rs#L20-L26
ProcessTransaction
tx_count_by_address.rs#L38-L76
my_proj
module in custom/mod.rs
:
TransactionIndexerFactory
enumcreate_indexer
function