Skip to main content

ControlServer

Trait ControlServer 

Source
pub trait ControlServer: Sized {
Show 24 methods // Required methods async fn ping(self, context: Context) -> u64; async fn get_status( self, context: Context, ) -> ServerResult<NodeStatusResponse>; async fn trigger_archives_gc(self, context: Context, req: TriggerGcRequest); async fn trigger_blocks_gc(self, context: Context, req: TriggerGcRequest); async fn trigger_states_gc(self, context: Context, req: TriggerGcRequest); async fn trigger_compaction( self, context: Context, req: TriggerCompactionRequest, ); async fn set_memory_profiler_enabled( self, context: Context, enabled: bool, ) -> bool; async fn dump_memory_profiler( self, context: Context, ) -> ServerResult<Vec<u8>>; async fn get_neighbours_info( self, context: Context, ) -> ServerResult<NeighboursInfoResponse>; async fn broadcast_external_message( self, context: Context, req: BroadcastExtMsgRequest, ) -> ServerResult<()>; async fn get_account_state( self, context: Context, req: AccountStateRequest, ) -> ServerResult<AccountStateResponse>; async fn get_blockchain_config( self, context: Context, ) -> ServerResult<BlockchainConfigResponse>; async fn get_block( self, context: Context, req: BlockRequest, ) -> ServerResult<BlockResponse>; async fn get_block_proof( self, context: Context, req: BlockRequest, ) -> ServerResult<BlockResponse>; async fn get_queue_diff( self, context: Context, req: BlockRequest, ) -> ServerResult<BlockResponse>; async fn get_archive_info( self, context: Context, req: ArchiveInfoRequest, ) -> ServerResult<ArchiveInfoResponse>; async fn get_archive_chunk( self, context: Context, req: ArchiveSliceRequest, ) -> ServerResult<ArchiveSliceResponse>; async fn get_archive_ids( self, context: Context, ) -> ServerResult<Vec<ArchiveInfo>>; async fn get_block_ids( self, context: Context, req: BlockListRequest, ) -> ServerResult<BlockListResponse>; async fn get_overlay_ids( self, context: Context, ) -> ServerResult<OverlayIdsResponse>; async fn get_overlay_peers( self, context: Context, req: OverlayPeersRequest, ) -> ServerResult<OverlayPeersResponse>; async fn dht_find_node( self, context: Context, req: DhtFindNodeRequest, ) -> ServerResult<DhtFindNodeResponse>; async fn sign_elections_payload( self, context: Context, req: ElectionsPayloadRequest, ) -> ServerResult<ElectionsPayloadResponse>; // Provided method fn serve(self) -> ServeControlServer<Self> { ... }
}

Required Methods§

Source

async fn ping(self, context: Context) -> u64

Ping a node. Returns node timestamp in milliseconds.

Source

async fn get_status(self, context: Context) -> ServerResult<NodeStatusResponse>

Get node status.

Source

async fn trigger_archives_gc(self, context: Context, req: TriggerGcRequest)

Trigger manual GC for archives.

Source

async fn trigger_blocks_gc(self, context: Context, req: TriggerGcRequest)

Trigger manual GC for blocks.

Source

async fn trigger_states_gc(self, context: Context, req: TriggerGcRequest)

Trigger manual GC for states.

Source

async fn trigger_compaction( self, context: Context, req: TriggerCompactionRequest, )

Trigger manual compaction.

Source

async fn set_memory_profiler_enabled( self, context: Context, enabled: bool, ) -> bool

Sets memory profiler state. Returns whether the state was changed.

Source

async fn dump_memory_profiler(self, context: Context) -> ServerResult<Vec<u8>>

Returns memory profiler dump.

Source

async fn get_neighbours_info( self, context: Context, ) -> ServerResult<NeighboursInfoResponse>

Get node neighbours info

Source

async fn broadcast_external_message( self, context: Context, req: BroadcastExtMsgRequest, ) -> ServerResult<()>

Broadcast a message to validators.

Source

async fn get_account_state( self, context: Context, req: AccountStateRequest, ) -> ServerResult<AccountStateResponse>

Get account state.

Source

async fn get_blockchain_config( self, context: Context, ) -> ServerResult<BlockchainConfigResponse>

Get blockchain config.

Source

async fn get_block( self, context: Context, req: BlockRequest, ) -> ServerResult<BlockResponse>

Get block bytes

Source

async fn get_block_proof( self, context: Context, req: BlockRequest, ) -> ServerResult<BlockResponse>

Get proof bytes.

Source

async fn get_queue_diff( self, context: Context, req: BlockRequest, ) -> ServerResult<BlockResponse>

Get queue bytes.

Source

async fn get_archive_info( self, context: Context, req: ArchiveInfoRequest, ) -> ServerResult<ArchiveInfoResponse>

Get archive id

Source

async fn get_archive_chunk( self, context: Context, req: ArchiveSliceRequest, ) -> ServerResult<ArchiveSliceResponse>

Download archive slice.

Source

async fn get_archive_ids( self, context: Context, ) -> ServerResult<Vec<ArchiveInfo>>

Returns list of all archive ids.

Source

async fn get_block_ids( self, context: Context, req: BlockListRequest, ) -> ServerResult<BlockListResponse>

Returns list of all block ids.

Source

async fn get_overlay_ids( self, context: Context, ) -> ServerResult<OverlayIdsResponse>

Returns list of all overlays.

Source

async fn get_overlay_peers( self, context: Context, req: OverlayPeersRequest, ) -> ServerResult<OverlayPeersResponse>

Get overlay peers.

Source

async fn dht_find_node( self, context: Context, req: DhtFindNodeRequest, ) -> ServerResult<DhtFindNodeResponse>

Search for k closest nodes known to peer_id that store key.

Source

async fn sign_elections_payload( self, context: Context, req: ElectionsPayloadRequest, ) -> ServerResult<ElectionsPayloadResponse>

Signs an elections payload.

Provided Methods§

Source

fn serve(self) -> ServeControlServer<Self>

Returns a serving function to use with InFlightRequest::execute.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§