Trait themelio_nodeprot::NodeServer [−][src]
pub trait NodeServer<C: ContentAddrStore>: Send + Sync {
fn send_tx(&self, state: NetState, tx: Transaction) -> Result<()>;
fn get_abbr_block(
&self,
height: BlockHeight
) -> Result<(AbbrBlock, ConsensusProof)>;
fn get_summary(&self) -> Result<StateSummary>;
fn get_state(&self, height: BlockHeight) -> Result<SealedState<C>>;
fn get_smt_branch(
&self,
height: BlockHeight,
elem: Substate,
key: HashVal
) -> Result<(Vec<u8>, CompressedProof)>;
fn get_stakers_raw(
&self,
height: BlockHeight
) -> Result<BTreeMap<HashVal, Vec<u8>>>;
}
Expand description
This trait represents a server of Themelio’s node protocol. Actual nodes should implement this.
Required methods
Broadcasts a transaction to the network
fn get_abbr_block(
&self,
height: BlockHeight
) -> Result<(AbbrBlock, ConsensusProof)>
fn get_abbr_block(
&self,
height: BlockHeight
) -> Result<(AbbrBlock, ConsensusProof)>
Gets an “abbreviated block”
fn get_summary(&self) -> Result<StateSummary>
fn get_summary(&self) -> Result<StateSummary>
Gets abbreviated blocks within a large rang Gets a state summary
fn get_state(&self, height: BlockHeight) -> Result<SealedState<C>>
fn get_state(&self, height: BlockHeight) -> Result<SealedState<C>>
Gets a full state
fn get_smt_branch(
&self,
height: BlockHeight,
elem: Substate,
key: HashVal
) -> Result<(Vec<u8>, CompressedProof)>
fn get_smt_branch(
&self,
height: BlockHeight,
elem: Substate,
key: HashVal
) -> Result<(Vec<u8>, CompressedProof)>
Gets an SMT branch
fn get_stakers_raw(
&self,
height: BlockHeight
) -> Result<BTreeMap<HashVal, Vec<u8>>>
fn get_stakers_raw(
&self,
height: BlockHeight
) -> Result<BTreeMap<HashVal, Vec<u8>>>
Gets stakers