Struct avalanche_types::rpcchainvm::vm::server::Server
source · [−]Fields
vm: Arc<RwLock<Box<dyn Vm + Send + Sync>>>
Underlying Vm implementation.
stop_ch: Sender<()>
Stop channel broadcast producer.
Implementations
Trait Implementations
sourceimpl Vm for Server
impl Vm for Server
sourcefn create_handlers<'life0, 'async_trait>(
&'life0 self,
_req: Request<Empty>
) -> Pin<Box<dyn Future<Output = Result<Response<CreateHandlersResponse>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn create_handlers<'life0, 'async_trait>(
&'life0 self,
_req: Request<Empty>
) -> Pin<Box<dyn Future<Output = Result<Response<CreateHandlersResponse>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Creates the HTTP handlers for custom chain network calls. This creates and exposes handlers that the outside world can use to communicate with the chain. Each handler has the path:
Returns a mapping from [extension]s to HTTP handlers. Each extension can specify how locking is managed for convenience.
For example, if this VM implements an account-based payments system,
it have an extension called accounts
, where clients could get
information about their accounts.
sourcefn create_static_handlers<'life0, 'async_trait>(
&'life0 self,
_req: Request<Empty>
) -> Pin<Box<dyn Future<Output = Result<Response<CreateStaticHandlersResponse>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn create_static_handlers<'life0, 'async_trait>(
&'life0 self,
_req: Request<Empty>
) -> Pin<Box<dyn Future<Output = Result<Response<CreateStaticHandlersResponse>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Creates the HTTP handlers for custom VM network calls.
This creates and exposes handlers that the outside world can use to communicate with a static reference to the VM. Each handler has the path: [Address of node]/ext/VM/[VM ID]/[extension]
Returns a mapping from [extension]s to HTTP handlers.
Each extension can specify how locking is managed for convenience.
For example, it might make sense to have an extension for creating genesis bytes this VM can interpret.
sourcefn get_block<'life0, 'async_trait>(
&'life0 self,
req: Request<GetBlockRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<GetBlockResponse>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_block<'life0, 'async_trait>(
&'life0 self,
req: Request<GetBlockRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<GetBlockResponse>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Attempt to load a block.
If the block does not exist, an empty GetBlockResponse is returned with an error code.
It is expected that blocks that have been successfully verified should be returned correctly. It is also expected that blocks that have been accepted by the consensus engine should be able to be fetched. It is not required for blocks that have been rejected by the consensus engine to be able to be fetched. ref: https://pkg.go.dev/github.com/ava-labs/avalanchego/snow/engine/snowman/block#Getter
fn initialize<'life0, 'async_trait>(
&'life0 self,
req: Request<InitializeRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<InitializeResponse>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn shutdown<'life0, 'async_trait>(
&'life0 self,
_req: Request<Empty>
) -> Pin<Box<dyn Future<Output = Result<Response<Empty>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn build_block<'life0, 'async_trait>(
&'life0 self,
_req: Request<Empty>
) -> Pin<Box<dyn Future<Output = Result<Response<BuildBlockResponse>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn parse_block<'life0, 'async_trait>(
&'life0 self,
req: Request<ParseBlockRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<ParseBlockResponse>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn set_state<'life0, 'async_trait>(
&'life0 self,
req: Request<SetStateRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<SetStateResponse>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn set_preference<'life0, 'async_trait>(
&'life0 self,
req: Request<SetPreferenceRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<Empty>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn health<'life0, 'async_trait>(
&'life0 self,
_req: Request<Empty>
) -> Pin<Box<dyn Future<Output = Result<Response<HealthResponse>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn version<'life0, 'async_trait>(
&'life0 self,
_req: Request<Empty>
) -> Pin<Box<dyn Future<Output = Result<Response<VersionResponse>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn connected<'life0, 'async_trait>(
&'life0 self,
req: Request<ConnectedRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<Empty>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn disconnected<'life0, 'async_trait>(
&'life0 self,
req: Request<DisconnectedRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<Empty>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn app_request<'life0, 'async_trait>(
&'life0 self,
_req: Request<AppRequestMsg>
) -> Pin<Box<dyn Future<Output = Result<Response<Empty>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn app_request_failed<'life0, 'async_trait>(
&'life0 self,
_req: Request<AppRequestFailedMsg>
) -> Pin<Box<dyn Future<Output = Result<Response<Empty>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn app_response<'life0, 'async_trait>(
&'life0 self,
_req: Request<AppResponseMsg>
) -> Pin<Box<dyn Future<Output = Result<Response<Empty>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn app_gossip<'life0, 'async_trait>(
&'life0 self,
_req: Request<AppGossipMsg>
) -> Pin<Box<dyn Future<Output = Result<Response<Empty>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn block_verify<'life0, 'async_trait>(
&'life0 self,
req: Request<BlockVerifyRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<BlockVerifyResponse>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn block_accept<'life0, 'async_trait>(
&'life0 self,
req: Request<BlockAcceptRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<Empty>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn block_reject<'life0, 'async_trait>(
&'life0 self,
req: Request<BlockRejectRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<Empty>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_ancestors<'life0, 'async_trait>(
&'life0 self,
_req: Request<GetAncestorsRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<GetAncestorsResponse>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn batched_parse_block<'life0, 'async_trait>(
&'life0 self,
_req: Request<BatchedParseBlockRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<BatchedParseBlockResponse>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn gather<'life0, 'async_trait>(
&'life0 self,
_req: Request<Empty>
) -> Pin<Box<dyn Future<Output = Result<Response<GatherResponse>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn state_sync_enabled<'life0, 'async_trait>(
&'life0 self,
_req: Request<Empty>
) -> Pin<Box<dyn Future<Output = Result<Response<StateSyncEnabledResponse>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_ongoing_sync_state_summary<'life0, 'async_trait>(
&'life0 self,
_req: Request<Empty>
) -> Pin<Box<dyn Future<Output = Result<Response<GetOngoingSyncStateSummaryResponse>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn parse_state_summary<'life0, 'async_trait>(
&'life0 self,
_req: Request<ParseStateSummaryRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<ParseStateSummaryResponse>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_state_summary<'life0, 'async_trait>(
&'life0 self,
_req: Request<GetStateSummaryRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<GetStateSummaryResponse>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_last_state_summary<'life0, 'async_trait>(
&'life0 self,
_req: Request<Empty>
) -> Pin<Box<dyn Future<Output = Result<Response<GetLastStateSummaryResponse>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn state_summary_accept<'life0, 'async_trait>(
&'life0 self,
_req: Request<StateSummaryAcceptRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<StateSummaryAcceptResponse>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn verify_height_index<'life0, 'async_trait>(
&'life0 self,
_req: Request<Empty>
) -> Pin<Box<dyn Future<Output = Result<Response<VerifyHeightIndexResponse>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_block_id_at_height<'life0, 'async_trait>(
&'life0 self,
_req: Request<GetBlockIdAtHeightRequest>
) -> Pin<Box<dyn Future<Output = Result<Response<GetBlockIdAtHeightResponse>, Status>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Auto Trait Implementations
impl !RefUnwindSafe for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl !UnwindSafe for Server
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request