blvm-sdk 0.1.7

Bitcoin Commons software developer kit, governance infrastructure and composition framework for Bitcoin
Documentation
//! Module Traits
//!
//! Re-export from blvm-node for module developers.
//!
//! These traits define the core interfaces that modules must implement
//! and the APIs they can use to interact with the node.

pub use blvm_node::module::traits::{
    EventType, Module, ModuleContext, ModuleError, ModuleMetadata, ModuleState, NodeAPI,
};

use crate::module::MigrationUp;

/// Metadata for module bootstrap. Generated by `#[module(name, config, migrations)]`.
///
/// Enables `run_module_main!(MyModule)` with all params inferred from the attribute.
pub trait ModuleMeta {
    const MODULE_NAME: &'static str;
    type Config: Default;
    fn migrations() -> &'static [(u32, MigrationUp)];
    fn __module_new(config: Self::Config) -> Self
    where
        Self: Sized;
}