pub struct ModuleManifest {Show 14 fields
pub name: String,
pub version: String,
pub entry_point: String,
pub description: Option<String>,
pub author: Option<String>,
pub capabilities: Vec<String>,
pub dependencies: HashMap<String, String>,
pub optional_dependencies: HashMap<String, String>,
pub config_schema: HashMap<String, String>,
pub rpc_overrides: Vec<String>,
pub signatures: Option<SignatureSection>,
pub binary: Option<BinarySection>,
pub downloads: HashMap<String, PlatformDownload>,
pub payment: Option<PaymentSection>,
}Expand description
Module manifest (module.toml structure)
The manifest defines a module’s identity, dependencies, and capabilities. It follows a clean, hierarchical structure:
# Core metadata (required)
name = "my-module"
version = "1.0.0"
entry_point = "my-module"
# Optional metadata
description = "What this module does"
author = "Author Name <email@example.com>"
# Capabilities (permissions this module requires)
capabilities = ["read_blockchain", "subscribe_events"]
# Dependencies
[dependencies]
"blvm-lightning" = ">=1.0.0"
[optional_dependencies]
"blvm-mesh" = ">=0.5.0"
# Configuration schema (optional)
[config_schema]
poll_interval = "Polling interval in seconds"Fields§
§name: StringModule name (unique identifier, alphanumeric with dashes/underscores)
version: StringModule version (semantic versioning: major.minor.patch)
entry_point: StringModule entry point (binary name or path relative to module directory)
description: Option<String>Human-readable description of what this module does
Module author (name and/or email)
capabilities: Vec<String>Capabilities this module requires (permissions) These determine what APIs the module can access
dependencies: HashMap<String, String>Required dependencies (hard dependencies) Module will fail to load if these are missing or unavailable
optional_dependencies: HashMap<String, String>Optional dependencies (soft dependencies) Module can load and function without these
config_schema: HashMap<String, String>Configuration schema (descriptions of config keys) Maps config key names to their descriptions
rpc_overrides: Vec<String>JSON-RPC core methods this module intends to override.
Each entry must be in OVERRIDABLE_CORE_RPC_METHODS; validated at load time.
The module registers the actual handler at runtime via register_core_rpc_override.
signatures: Option<SignatureSection>Signature section (for signed/verified modules) Contains maintainer signatures and threshold
binary: Option<BinarySection>Binary information (local integrity — populated at install time) Contains hash and size for the already-installed binary
downloads: HashMap<String, PlatformDownload>Remote download coordinates per platform (written by release CI).
The node reads this section during bootstrap install to obtain the correct URL and SHA-256 for the running platform, eliminating the need for a central registry to track per-version binary locations.
Keys: "x86_64-linux" | "aarch64-linux" | "x86_64-apple" | "aarch64-apple"
payment: Option<PaymentSection>Payment configuration (for paid modules) Contains cryptographically signed payment addresses
Implementations§
Source§impl ModuleManifest
impl ModuleManifest
Sourcepub fn from_file<P>(path: P) -> Result<ModuleManifest, ModuleError>
pub fn from_file<P>(path: P) -> Result<ModuleManifest, ModuleError>
Load manifest from file
Sourcepub fn to_metadata(&self) -> ModuleMetadata
pub fn to_metadata(&self) -> ModuleMetadata
Convert to ModuleMetadata
Sourcepub fn get_threshold(&self) -> Option<(usize, usize)>
pub fn get_threshold(&self) -> Option<(usize, usize)>
Get signature threshold as (required, total) tuple
Parses threshold string like “2-of-3” into (2, 3). Returns None if threshold is not set or cannot be parsed.
Sourcepub fn parse_threshold(threshold_str: &str) -> Option<(usize, usize)>
pub fn parse_threshold(threshold_str: &str) -> Option<(usize, usize)>
Parse threshold string like “2-of-3” into (2, 3)
Sourcepub fn get_signatures(&self) -> Vec<(String, String)>
pub fn get_signatures(&self) -> Vec<(String, String)>
Get signatures as (maintainer, signature_hex) pairs
Sourcepub fn get_public_keys(&self) -> HashMap<String, String>
pub fn get_public_keys(&self) -> HashMap<String, String>
Get public keys as (maintainer, pubkey_hex) map
Sourcepub fn has_signatures(&self) -> bool
pub fn has_signatures(&self) -> bool
Check if manifest has signatures
Trait Implementations§
Source§impl Clone for ModuleManifest
impl Clone for ModuleManifest
Source§fn clone(&self) -> ModuleManifest
fn clone(&self) -> ModuleManifest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ModuleManifest
impl Debug for ModuleManifest
Source§impl<'de> Deserialize<'de> for ModuleManifest
impl<'de> Deserialize<'de> for ModuleManifest
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ModuleManifest, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ModuleManifest, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for ModuleManifest
impl Serialize for ModuleManifest
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Source§impl TryFrom<ModuleManifest> for ModuleMetadata
impl TryFrom<ModuleManifest> for ModuleMetadata
Source§type Error = ModuleError
type Error = ModuleError
Source§fn try_from(
manifest: ModuleManifest,
) -> Result<ModuleMetadata, <ModuleMetadata as TryFrom<ModuleManifest>>::Error>
fn try_from( manifest: ModuleManifest, ) -> Result<ModuleMetadata, <ModuleMetadata as TryFrom<ModuleManifest>>::Error>
Auto Trait Implementations§
impl Freeze for ModuleManifest
impl RefUnwindSafe for ModuleManifest
impl Send for ModuleManifest
impl Sync for ModuleManifest
impl Unpin for ModuleManifest
impl UnsafeUnpin for ModuleManifest
impl UnwindSafe for ModuleManifest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more