It demonstrates the following concepts:
lib.rs
containsExampleModule
module definition andsov_modules_api::Module
trait implementation forExampleModule
.genesis.rs
contains the module initialization logic.call.rs
contains methods that change module state in response toCallMessage
.query.rs
contains functions for querying the module state.
Anyone can update the value stored in the example module by sending a CallMessage::SetValue(new_value)
message. Anyone can query the module state by invoking the public get_value
function.
For implementation details, please check comments in the genesis.rs, call.rs & query.rs
.