Skip to main content

ControlServer

Trait ControlServer 

Source
pub trait ControlServer: Sized {
Show 31 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>; async fn mempool_dump_bans( self, context: Context, ) -> ServerResult<Vec<DumpBansItem>>; async fn mempool_dump_events( self, context: Context, req: DumpEventsRequest, ) -> ServerResult<String>; async fn mempool_ban( self, context: Context, req: BanRequest, ) -> ServerResult<String>; async fn mempool_unban( self, context: Context, peer_id: HashBytes, ) -> ServerResult<()>; async fn mempool_list_events( self, context: Context, req: ListEventsRequest, ) -> ServerResult<Vec<MempoolEventDisplay>>; async fn mempool_delete_events( self, context: Context, millis: Range<u64>, ) -> ServerResult<()>; async fn mempool_get_event_point( self, context: Context, key: PointKey, ) -> ServerResult<Bytes>; // 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.

Source

async fn mempool_dump_bans( self, context: Context, ) -> ServerResult<Vec<DumpBansItem>>

Dumps the current in-memory moderator ban state.

Source

async fn mempool_dump_events( self, context: Context, req: DumpEventsRequest, ) -> ServerResult<String>

Dumps the in-memory moderator event/toleration cache, not persisted journal rows.

Source

async fn mempool_ban( self, context: Context, req: BanRequest, ) -> ServerResult<String>

Queues a manual ban and waits for persisted completion while the client stays connected. After the node accepts the request, it cannot be cancelled (by timeout, disconnect, etc.).

Source

async fn mempool_unban( self, context: Context, peer_id: HashBytes, ) -> ServerResult<()>

Queues a manual unban and waits for persisted completion while the client stays connected. Live visibility can lag because the peer must resolve again after unban. After the node accepts the request, it cannot be cancelled (by timeout, disconnect, etc.).

Source

async fn mempool_list_events( self, context: Context, req: ListEventsRequest, ) -> ServerResult<Vec<MempoolEventDisplay>>

Lists persisted moderator journal records of all types. Point key with stored=true can be used to retrieve full point with a separate call.

Source

async fn mempool_delete_events( self, context: Context, millis: Range<u64>, ) -> ServerResult<()>

Deletes persisted moderator journal data only; does not mutate in-mem moderator state. After the node accepts the request, it cannot be cancelled (by timeout, disconnect, etc.).

Source

async fn mempool_get_event_point( self, context: Context, key: PointKey, ) -> ServerResult<Bytes>

Loads a point linked from a stored moderator journal record (if its key has stored flag)

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§