pub struct ConsensusApi {Show 17 fields
pub cfg: ServerConfig,
pub cfg_dir: PathBuf,
pub db: Database,
pub modules: ServerModuleRegistry,
pub client_cfg: ClientConfig,
pub force_api_secret: Option<String>,
pub submission_sender: Sender<ConsensusItem>,
pub shutdown_receiver: Receiver<Option<u64>>,
pub shutdown_sender: Sender<Option<u64>>,
pub ord_latency_receiver: Receiver<Option<Duration>>,
pub p2p_status_receivers: P2PStatusReceivers,
pub p2p_connection_type_receivers: P2PConnectionTypeReceivers,
pub ci_status_receivers: BTreeMap<PeerId, Receiver<Option<u64>>>,
pub bitcoin_rpc_connection: ServerBitcoinRpcMonitor,
pub supported_api_versions: SupportedApiVersionsSummary,
pub code_version_str: String,
pub task_group: TaskGroup,
}Fields§
§cfg: ServerConfigOur server configuration
cfg_dir: PathBufDirectory where config files are stored
db: DatabaseDatabase for serving the API
modules: ServerModuleRegistryModules registered with the federation
client_cfg: ClientConfigCached client config
force_api_secret: Option<String>§submission_sender: Sender<ConsensusItem>For sending API events to consensus such as transactions
shutdown_receiver: Receiver<Option<u64>>§shutdown_sender: Sender<Option<u64>>§ord_latency_receiver: Receiver<Option<Duration>>§p2p_status_receivers: P2PStatusReceivers§p2p_connection_type_receivers: P2PConnectionTypeReceivers§ci_status_receivers: BTreeMap<PeerId, Receiver<Option<u64>>>§bitcoin_rpc_connection: ServerBitcoinRpcMonitor§supported_api_versions: SupportedApiVersionsSummary§code_version_str: String§task_group: TaskGroupImplementations§
Source§impl ConsensusApi
impl ConsensusApi
pub fn api_versions_summary(&self) -> &SupportedApiVersionsSummary
pub fn get_active_api_secret(&self) -> Option<String>
pub async fn submit_transaction( &self, transaction: Transaction, ) -> Result<TransactionId, TransactionError>
pub async fn await_transaction( &self, txid: TransactionId, ) -> (Vec<ModuleInstanceId>, DatabaseTransaction<'_, Committable>)
pub async fn await_output_outcome( &self, outpoint: OutPoint, ) -> Result<SerdeModuleEncoding<DynOutputOutcome>>
pub async fn session_count(&self) -> u64
pub async fn await_signed_session_outcome( &self, index: u64, ) -> SignedSessionOutcome
pub async fn session_status(&self, session_index: u64) -> SessionStatusV2
pub async fn get_federation_status(&self) -> ApiResult<LegacyFederationStatus>
Trait Implementations§
Source§impl Clone for ConsensusApi
impl Clone for ConsensusApi
Source§fn clone(&self) -> ConsensusApi
fn clone(&self) -> ConsensusApi
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl HasApiContext<ConsensusApi> for ConsensusApi
impl HasApiContext<ConsensusApi> for ConsensusApi
fn context<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ApiRequestErased,
id: Option<ModuleInstanceId>,
) -> Pin<Box<dyn Future<Output = (&ConsensusApi, ApiEndpointContext<'_>)> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§impl HasApiContext<DynServerModule> for ConsensusApi
impl HasApiContext<DynServerModule> for ConsensusApi
fn context<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ApiRequestErased,
id: Option<ModuleInstanceId>,
) -> Pin<Box<dyn Future<Output = (&DynServerModule, ApiEndpointContext<'_>)> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§impl IDashboardApi for ConsensusApi
impl IDashboardApi for ConsensusApi
Source§fn auth<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ApiAuth> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn auth<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ApiAuth> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the guardian’s authentication details
Source§fn guardian_id<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = PeerId> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn guardian_id<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = PeerId> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the guardian ID
Source§fn guardian_names<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = BTreeMap<PeerId, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn guardian_names<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = BTreeMap<PeerId, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get a map of peer IDs to guardian names
Source§fn federation_name<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn federation_name<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the federation name
Source§fn session_count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = u64> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn session_count<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = u64> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the current active session count
Source§fn get_session_status<'life0, 'async_trait>(
&'life0 self,
session_idx: u64,
) -> Pin<Box<dyn Future<Output = SessionStatusV2> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_session_status<'life0, 'async_trait>(
&'life0 self,
session_idx: u64,
) -> Pin<Box<dyn Future<Output = SessionStatusV2> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get items in a given session
Source§fn consensus_ord_latency<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Option<Duration>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn consensus_ord_latency<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Option<Duration>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
The time it took to order our last proposal in the current session
Source§fn p2p_connection_status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = BTreeMap<PeerId, Option<Duration>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn p2p_connection_status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = BTreeMap<PeerId, Option<Duration>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns a map of peer ID to estimated round trip time
Source§fn p2p_connection_type_status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = BTreeMap<PeerId, ConnectionType>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn p2p_connection_type_status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = BTreeMap<PeerId, ConnectionType>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns a map of peer ID to connection type (Direct or Relay)
Source§fn federation_invite_code<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn federation_invite_code<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the federation invite code to share with users
Source§fn federation_audit<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = AuditSummary> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn federation_audit<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = AuditSummary> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the federation audit summary
Source§fn bitcoin_rpc_url<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = SafeUrl> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn bitcoin_rpc_url<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = SafeUrl> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the url of the bitcoin rpc
Source§fn bitcoin_rpc_status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Option<ServerBitcoinRpcStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn bitcoin_rpc_status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Option<ServerBitcoinRpcStatus>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the status of the bitcoin backend
Source§fn download_guardian_config_backup<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
password: &'life1 str,
guardian_auth: &'life2 GuardianAuthToken,
) -> Pin<Box<dyn Future<Output = GuardianConfigBackup> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn download_guardian_config_backup<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
password: &'life1 str,
guardian_auth: &'life2 GuardianAuthToken,
) -> Pin<Box<dyn Future<Output = GuardianConfigBackup> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Download a backup of the guardian’s configuration
Source§fn get_module_by_kind(&self, kind: ModuleKind) -> Option<&DynServerModule>
fn get_module_by_kind(&self, kind: ModuleKind) -> Option<&DynServerModule>
Get reference to a server module instance by module kind
Auto Trait Implementations§
impl Freeze for ConsensusApi
impl !RefUnwindSafe for ConsensusApi
impl Send for ConsensusApi
impl Sync for ConsensusApi
impl Unpin for ConsensusApi
impl !UnwindSafe for ConsensusApi
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
Causes
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
Causes
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
Causes
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
Causes
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
Causes
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
Causes
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
Causes
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
Causes
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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 moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Pipes by value. This is generally the method you want to use. Read more
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
Borrows
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
Mutably borrows
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
Borrows
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
Mutably borrows
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
Borrows
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Immutable access to the
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
Mutable access to the
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
Immutable access to the
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
Mutable access to the
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Immutable access to the
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Mutable access to the
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
Calls
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
Calls
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
Calls
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
Calls
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
Calls
.tap_deref() only in debug builds, and is erased in release
builds.