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§
Sourceasync fn ping(self, context: Context) -> u64
async fn ping(self, context: Context) -> u64
Ping a node. Returns node timestamp in milliseconds.
Sourceasync fn get_status(self, context: Context) -> ServerResult<NodeStatusResponse>
async fn get_status(self, context: Context) -> ServerResult<NodeStatusResponse>
Get node status.
Sourceasync fn trigger_archives_gc(self, context: Context, req: TriggerGcRequest)
async fn trigger_archives_gc(self, context: Context, req: TriggerGcRequest)
Trigger manual GC for archives.
Sourceasync fn trigger_blocks_gc(self, context: Context, req: TriggerGcRequest)
async fn trigger_blocks_gc(self, context: Context, req: TriggerGcRequest)
Trigger manual GC for blocks.
Sourceasync fn trigger_states_gc(self, context: Context, req: TriggerGcRequest)
async fn trigger_states_gc(self, context: Context, req: TriggerGcRequest)
Trigger manual GC for states.
Sourceasync fn trigger_compaction(
self,
context: Context,
req: TriggerCompactionRequest,
)
async fn trigger_compaction( self, context: Context, req: TriggerCompactionRequest, )
Trigger manual compaction.
Sourceasync fn set_memory_profiler_enabled(
self,
context: Context,
enabled: bool,
) -> bool
async fn set_memory_profiler_enabled( self, context: Context, enabled: bool, ) -> bool
Sets memory profiler state. Returns whether the state was changed.
Sourceasync fn dump_memory_profiler(self, context: Context) -> ServerResult<Vec<u8>>
async fn dump_memory_profiler(self, context: Context) -> ServerResult<Vec<u8>>
Returns memory profiler dump.
Sourceasync fn get_neighbours_info(
self,
context: Context,
) -> ServerResult<NeighboursInfoResponse>
async fn get_neighbours_info( self, context: Context, ) -> ServerResult<NeighboursInfoResponse>
Get node neighbours info
Sourceasync fn broadcast_external_message(
self,
context: Context,
req: BroadcastExtMsgRequest,
) -> ServerResult<()>
async fn broadcast_external_message( self, context: Context, req: BroadcastExtMsgRequest, ) -> ServerResult<()>
Broadcast a message to validators.
Sourceasync fn get_account_state(
self,
context: Context,
req: AccountStateRequest,
) -> ServerResult<AccountStateResponse>
async fn get_account_state( self, context: Context, req: AccountStateRequest, ) -> ServerResult<AccountStateResponse>
Get account state.
Sourceasync fn get_blockchain_config(
self,
context: Context,
) -> ServerResult<BlockchainConfigResponse>
async fn get_blockchain_config( self, context: Context, ) -> ServerResult<BlockchainConfigResponse>
Get blockchain config.
Sourceasync fn get_block(
self,
context: Context,
req: BlockRequest,
) -> ServerResult<BlockResponse>
async fn get_block( self, context: Context, req: BlockRequest, ) -> ServerResult<BlockResponse>
Get block bytes
Sourceasync fn get_block_proof(
self,
context: Context,
req: BlockRequest,
) -> ServerResult<BlockResponse>
async fn get_block_proof( self, context: Context, req: BlockRequest, ) -> ServerResult<BlockResponse>
Get proof bytes.
Sourceasync fn get_queue_diff(
self,
context: Context,
req: BlockRequest,
) -> ServerResult<BlockResponse>
async fn get_queue_diff( self, context: Context, req: BlockRequest, ) -> ServerResult<BlockResponse>
Get queue bytes.
Sourceasync fn get_archive_info(
self,
context: Context,
req: ArchiveInfoRequest,
) -> ServerResult<ArchiveInfoResponse>
async fn get_archive_info( self, context: Context, req: ArchiveInfoRequest, ) -> ServerResult<ArchiveInfoResponse>
Get archive id
Sourceasync fn get_archive_chunk(
self,
context: Context,
req: ArchiveSliceRequest,
) -> ServerResult<ArchiveSliceResponse>
async fn get_archive_chunk( self, context: Context, req: ArchiveSliceRequest, ) -> ServerResult<ArchiveSliceResponse>
Download archive slice.
Sourceasync fn get_archive_ids(
self,
context: Context,
) -> ServerResult<Vec<ArchiveInfo>>
async fn get_archive_ids( self, context: Context, ) -> ServerResult<Vec<ArchiveInfo>>
Returns list of all archive ids.
Sourceasync fn get_block_ids(
self,
context: Context,
req: BlockListRequest,
) -> ServerResult<BlockListResponse>
async fn get_block_ids( self, context: Context, req: BlockListRequest, ) -> ServerResult<BlockListResponse>
Returns list of all block ids.
Sourceasync fn get_overlay_ids(
self,
context: Context,
) -> ServerResult<OverlayIdsResponse>
async fn get_overlay_ids( self, context: Context, ) -> ServerResult<OverlayIdsResponse>
Returns list of all overlays.
Sourceasync fn get_overlay_peers(
self,
context: Context,
req: OverlayPeersRequest,
) -> ServerResult<OverlayPeersResponse>
async fn get_overlay_peers( self, context: Context, req: OverlayPeersRequest, ) -> ServerResult<OverlayPeersResponse>
Get overlay peers.
Sourceasync fn dht_find_node(
self,
context: Context,
req: DhtFindNodeRequest,
) -> ServerResult<DhtFindNodeResponse>
async fn dht_find_node( self, context: Context, req: DhtFindNodeRequest, ) -> ServerResult<DhtFindNodeResponse>
Search for k closest nodes known to peer_id that store key.
Sourceasync fn sign_elections_payload(
self,
context: Context,
req: ElectionsPayloadRequest,
) -> ServerResult<ElectionsPayloadResponse>
async fn sign_elections_payload( self, context: Context, req: ElectionsPayloadRequest, ) -> ServerResult<ElectionsPayloadResponse>
Signs an elections payload.
Sourceasync fn mempool_dump_bans(
self,
context: Context,
) -> ServerResult<Vec<DumpBansItem>>
async fn mempool_dump_bans( self, context: Context, ) -> ServerResult<Vec<DumpBansItem>>
Dumps the current in-memory moderator ban state.
Sourceasync fn mempool_dump_events(
self,
context: Context,
req: DumpEventsRequest,
) -> ServerResult<String>
async fn mempool_dump_events( self, context: Context, req: DumpEventsRequest, ) -> ServerResult<String>
Dumps the in-memory moderator event/toleration cache, not persisted journal rows.
Sourceasync fn mempool_ban(
self,
context: Context,
req: BanRequest,
) -> ServerResult<String>
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.).
Sourceasync fn mempool_unban(
self,
context: Context,
peer_id: HashBytes,
) -> ServerResult<()>
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.).
Sourceasync fn mempool_list_events(
self,
context: Context,
req: ListEventsRequest,
) -> ServerResult<Vec<MempoolEventDisplay>>
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.
Sourceasync fn mempool_delete_events(
self,
context: Context,
millis: Range<u64>,
) -> ServerResult<()>
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.).
Sourceasync fn mempool_get_event_point(
self,
context: Context,
key: PointKey,
) -> ServerResult<Bytes>
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§
Sourcefn serve(self) -> ServeControlServer<Self>
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.