pub struct FarmerRpc<CI, CSS>where
CI: ChainInfo<OwnedBeaconChainBlock>,
CSS: ChainSyncStatus,{ /* private fields */ }Expand description
Implements the FarmerRpcApiServer trait for farmer to connect to
Implementations§
Source§impl<CI, CSS> FarmerRpc<CI, CSS>where
CI: ChainInfo<OwnedBeaconChainBlock>,
CSS: ChainSyncStatus,
FarmerRpc is used for notifying subscribers about the arrival of new slots and for
submission of solutions (or lack thereof).
impl<CI, CSS> FarmerRpc<CI, CSS>where
CI: ChainInfo<OwnedBeaconChainBlock>,
CSS: ChainSyncStatus,
FarmerRpc is used for notifying subscribers about the arrival of new slots and for
submission of solutions (or lack thereof).
Internally every time slot notifier emits information about a new slot, a notification is sent
to every subscriber, after which the RPC server waits for the same number of
submitSolutionResponse requests with SolutionResponse in them or until
timeout is exceeded. The first valid solution for a particular slot wins, others are ignored.
Sourcepub fn new(config: FarmerRpcConfig<CI, CSS>) -> (Self, FarmerRpcWorker)
pub fn new(config: FarmerRpcConfig<CI, CSS>) -> (Self, FarmerRpcWorker)
Creates a new instance of the FarmerRpc handler.
Trait Implementations§
Source§impl<CI, CSS> FarmerRpcApiServer for FarmerRpc<CI, CSS>where
CI: ChainInfo<OwnedBeaconChainBlock>,
CSS: ChainSyncStatus,
impl<CI, CSS> FarmerRpcApiServer for FarmerRpc<CI, CSS>where
CI: ChainInfo<OwnedBeaconChainBlock>,
CSS: ChainSyncStatus,
Source§fn get_farmer_app_info(&self) -> Result<FarmerAppInfo, Error>
fn get_farmer_app_info(&self) -> Result<FarmerAppInfo, Error>
Get metadata necessary for farmer operation
fn submit_solution_response( &self, solution_response: SolutionResponse, ) -> Result<(), Error>
Source§fn subscribe_slot_info<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn subscribe_slot_info<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Slot info subscription
Source§fn subscribe_block_seal<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn subscribe_block_seal<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sign block subscription
fn submit_block_seal(&self, block_seal: BlockSealResponse) -> Result<(), Error>
Source§fn subscribe_archived_segment_header<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn subscribe_archived_segment_header<'life0, 'async_trait>(
&'life0 self,
pending: PendingSubscriptionSink,
) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Archived segment header subscription
fn acknowledge_archived_segment_header<'life0, 'async_trait>(
&'life0 self,
segment_index: SegmentIndex,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn piece( &self, requested_piece_index: PieceIndex, ) -> Result<Option<Piece>, Error>
fn segment_headers<'life0, 'async_trait>(
&'life0 self,
segment_indices: Vec<SegmentIndex>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Option<SegmentHeader>>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn last_segment_headers<'life0, 'async_trait>(
&'life0 self,
limit: u32,
) -> Pin<Box<dyn Future<Output = Result<Vec<Option<SegmentHeader>>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl<CI, CSS> Freeze for FarmerRpc<CI, CSS>
impl<CI, CSS> !RefUnwindSafe for FarmerRpc<CI, CSS>
impl<CI, CSS> Send for FarmerRpc<CI, CSS>
impl<CI, CSS> Sync for FarmerRpc<CI, CSS>
impl<CI, CSS> Unpin for FarmerRpc<CI, CSS>
impl<CI, CSS> !UnwindSafe for FarmerRpc<CI, CSS>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more