pub struct HoprDb { /* private fields */ }
Expand description
Main database handle for HOPR node operations.
Manages multiple SQLite databases for different data domains to avoid locking conflicts and improve performance:
- Index DB: Blockchain indexing and contract data
- Tickets DB: Payment tickets and acknowledgments
- Peers DB: Network peer information and metadata
- Logs DB: Blockchain logs and processing status
Supports database snapshot imports for fast synchronization via
[HoprDbGeneralModelOperations::import_logs_db
].
Implementations§
Source§impl HoprDb
impl HoprDb
pub async fn new( directory: &Path, chain_key: ChainKeypair, cfg: HoprDbConfig, ) -> Result<Self>
pub async fn new_in_memory(chain_key: ChainKeypair) -> Result<Self>
Sourcepub fn start_ticket_processing(
&self,
ticket_notifier: Option<UnboundedSender<AcknowledgedTicket>>,
) -> Result<()>
pub fn start_ticket_processing( &self, ticket_notifier: Option<UnboundedSender<AcknowledgedTicket>>, ) -> Result<()>
Starts ticket processing by the TicketManager
with an optional new ticket notifier.
Without calling this method, tickets will not be persisted into the DB.
If the notifier is given, it will receive notifications once new ticket has been persisted into the Tickets DB.
pub async fn create_pool( cfg: HoprDbConfig, directory: PathBuf, options: PoolOptions<Sqlite>, min_conn: Option<u32>, max_conn: Option<u32>, read_only: bool, path: &str, ) -> Result<SqlitePool>
Trait Implementations§
Source§impl HoprDbAccountOperations for HoprDb
impl HoprDbAccountOperations for HoprDb
Source§fn get_account<'a, 'async_trait, T>(
&'a self,
tx: OptTx<'a>,
key: T,
) -> Pin<Box<dyn Future<Output = Result<Option<AccountEntry>>> + Send + 'async_trait>>
fn get_account<'a, 'async_trait, T>( &'a self, tx: OptTx<'a>, key: T, ) -> Pin<Box<dyn Future<Output = Result<Option<AccountEntry>>> + Send + 'async_trait>>
Retrieves the account entry using a Packet key or Chain key.
Source§fn get_self_account<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<AccountEntry>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn get_self_account<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<AccountEntry>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Retrieves account entry about this node’s account.
This a unique account in the database that must always be present.
Source§fn get_accounts<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
public_only: bool,
) -> Pin<Box<dyn Future<Output = Result<Vec<AccountEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn get_accounts<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
public_only: bool,
) -> Pin<Box<dyn Future<Output = Result<Vec<AccountEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Retrieves entries of accounts with routable address announcements (if
public_only
is true
)
or about all accounts without routeable address announcements (if public_only
is false
).Source§fn insert_account<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
account: AccountEntry,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn insert_account<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
account: AccountEntry,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Inserts a new account entry to the database.
Fails if such an entry already exists.
Source§fn insert_announcement<'a, 'async_trait, T>(
&'a self,
tx: OptTx<'a>,
key: T,
multiaddr: Multiaddr,
at_block: u32,
) -> Pin<Box<dyn Future<Output = Result<AccountEntry>> + Send + 'async_trait>>
fn insert_announcement<'a, 'async_trait, T>( &'a self, tx: OptTx<'a>, key: T, multiaddr: Multiaddr, at_block: u32, ) -> Pin<Box<dyn Future<Output = Result<AccountEntry>> + Send + 'async_trait>>
Inserts a routable address announcement linked to a specific entry. Read more
Source§fn delete_all_announcements<'a, 'async_trait, T>(
&'a self,
tx: OptTx<'a>,
key: T,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
fn delete_all_announcements<'a, 'async_trait, T>( &'a self, tx: OptTx<'a>, key: T, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
Deletes all address announcements for the given account.
Source§fn delete_account<'a, 'async_trait, T>(
&'a self,
tx: OptTx<'a>,
key: T,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
fn delete_account<'a, 'async_trait, T>( &'a self, tx: OptTx<'a>, key: T, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
Deletes account with the given
key
(chain or off-chain).Source§impl HoprDbChannelOperations for HoprDb
impl HoprDbChannelOperations for HoprDb
Source§fn get_channel_by_id<'a, 'life0, 'async_trait>(
&'a self,
tx: OptTx<'a>,
id: &'life0 Hash,
) -> Pin<Box<dyn Future<Output = Result<Option<ChannelEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
fn get_channel_by_id<'a, 'life0, 'async_trait>(
&'a self,
tx: OptTx<'a>,
id: &'life0 Hash,
) -> Pin<Box<dyn Future<Output = Result<Option<ChannelEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
Retrieves channel by its channel ID hash. Read more
Source§fn begin_channel_update<'a, 'life0, 'async_trait>(
&'a self,
tx: OptTx<'a>,
id: &'life0 Hash,
) -> Pin<Box<dyn Future<Output = Result<Option<ChannelEditor>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
fn begin_channel_update<'a, 'life0, 'async_trait>(
&'a self,
tx: OptTx<'a>,
id: &'life0 Hash,
) -> Pin<Box<dyn Future<Output = Result<Option<ChannelEditor>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
Start changes to channel entry.
If the channel with the given ID exists, the ChannelEditor is returned.
Use
HoprDbChannelOperations::finish_channel_update
to commit edits to the DB when done.Source§fn finish_channel_update<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
editor: ChannelEditor,
) -> Pin<Box<dyn Future<Output = Result<Option<ChannelEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn finish_channel_update<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
editor: ChannelEditor,
) -> Pin<Box<dyn Future<Output = Result<Option<ChannelEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Commits changes of the channel to the database.
Returns the updated channel, or on deletion, the deleted channel entry.
Source§fn get_channel_by_parties<'a, 'life0, 'life1, 'async_trait>(
&'a self,
tx: OptTx<'a>,
src: &'life0 Address,
dst: &'life1 Address,
use_cache: bool,
) -> Pin<Box<dyn Future<Output = Result<Option<ChannelEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_channel_by_parties<'a, 'life0, 'life1, 'async_trait>(
&'a self,
tx: OptTx<'a>,
src: &'life0 Address,
dst: &'life1 Address,
use_cache: bool,
) -> Pin<Box<dyn Future<Output = Result<Option<ChannelEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieves the channel by source and destination.
This operation should be able to use cache since it can be also called from
performance-sensitive locations.
Source§fn get_channels_via<'a, 'life0, 'async_trait>(
&'a self,
tx: OptTx<'a>,
direction: ChannelDirection,
target: &'life0 Address,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChannelEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
fn get_channels_via<'a, 'life0, 'async_trait>(
&'a self,
tx: OptTx<'a>,
direction: ChannelDirection,
target: &'life0 Address,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChannelEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
Fetches all channels that are
Incoming
to the given target
, or Outgoing
from the given target
Source§fn get_incoming_channels<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChannelEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn get_incoming_channels<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChannelEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Fetches all channels that are
Incoming
to this node.
Shorthand for get_channels_via(tx, ChannelDirection::Incoming, my_node)
Source§fn get_outgoing_channels<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChannelEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn get_outgoing_channels<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChannelEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Fetches all channels that are
Outgoing
from this node.
Shorthand for get_channels_via(tx, ChannelDirection::Outgoing, my_node)
Source§fn get_all_channels<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChannelEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn get_all_channels<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChannelEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Retrieves all channels information from the DB.
Source§fn stream_active_channels<'a, 'async_trait>(
&'a self,
) -> Pin<Box<dyn Future<Output = Result<BoxStream<'a, Result<ChannelEntry>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn stream_active_channels<'a, 'async_trait>(
&'a self,
) -> Pin<Box<dyn Future<Output = Result<BoxStream<'a, Result<ChannelEntry>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Returns a stream of all channels that are
Open
or PendingToClose
with an active grace period.sSource§impl HoprDbCorruptedChannelOperations for HoprDb
impl HoprDbCorruptedChannelOperations for HoprDb
Source§fn get_corrupted_channel_by_id<'a, 'life0, 'async_trait>(
&'a self,
tx: OptTx<'a>,
id: &'life0 Hash,
) -> Pin<Box<dyn Future<Output = Result<Option<CorruptedChannelEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
fn get_corrupted_channel_by_id<'a, 'life0, 'async_trait>(
&'a self,
tx: OptTx<'a>,
id: &'life0 Hash,
) -> Pin<Box<dyn Future<Output = Result<Option<CorruptedChannelEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
Retrieves corrupted channel by its channel ID hash. Read more
Source§impl HoprDbGeneralModelOperations for HoprDb
impl HoprDbGeneralModelOperations for HoprDb
Source§fn conn(&self, target_db: TargetDb) -> &DatabaseConnection
fn conn(&self, target_db: TargetDb) -> &DatabaseConnection
Retrieves raw database connection to the given DB.
Source§fn begin_transaction_in_db<'life0, 'async_trait>(
&'life0 self,
target_db: TargetDb,
) -> Pin<Box<dyn Future<Output = Result<OpenTransaction>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn begin_transaction_in_db<'life0, 'async_trait>(
&'life0 self,
target_db: TargetDb,
) -> Pin<Box<dyn Future<Output = Result<OpenTransaction>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Starts a new transaction in the given DB.
Source§fn import_logs_db<'async_trait>(
self,
src_dir: PathBuf,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
fn import_logs_db<'async_trait>(
self,
src_dir: PathBuf,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
Import logs database from a snapshot directory. Read more
Source§fn begin_transaction<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<OpenTransaction>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn begin_transaction<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<OpenTransaction>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Same as
HoprDbGeneralModelOperations::begin_transaction_in_db
with default TargetDb.Source§fn nest_transaction_in_db<'life0, 'life1, 'async_trait>(
&'life0 self,
tx: OptTx<'life1>,
target_db: TargetDb,
) -> Pin<Box<dyn Future<Output = Result<OpenTransaction>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn nest_transaction_in_db<'life0, 'life1, 'async_trait>(
&'life0 self,
tx: OptTx<'life1>,
target_db: TargetDb,
) -> Pin<Box<dyn Future<Output = Result<OpenTransaction>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Creates a nested transaction inside the given transaction. Read more
Source§fn nest_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
tx: OptTx<'life1>,
) -> Pin<Box<dyn Future<Output = Result<OpenTransaction>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn nest_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
tx: OptTx<'life1>,
) -> Pin<Box<dyn Future<Output = Result<OpenTransaction>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Same as
HoprDbGeneralModelOperations::nest_transaction_in_db
with default TargetDb.Source§impl HoprDbInfoOperations for HoprDb
impl HoprDbInfoOperations for HoprDb
Source§fn index_is_empty<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn index_is_empty<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Checks if the index is empty. Read more
Source§fn clear_index_db<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn clear_index_db<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Removes all data from all tables in the index database. Read more
Source§fn get_safe_hopr_balance<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<HoprBalance>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn get_safe_hopr_balance<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<HoprBalance>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Gets node’s Safe balance of HOPR tokens.
Source§fn set_safe_hopr_balance<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
new_balance: HoprBalance,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn set_safe_hopr_balance<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
new_balance: HoprBalance,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Sets node’s Safe balance of HOPR tokens.
Source§fn get_safe_hopr_allowance<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<HoprBalance>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn get_safe_hopr_allowance<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<HoprBalance>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Gets node’s Safe allowance of HOPR tokens.
Source§fn set_safe_hopr_allowance<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
new_allowance: HoprBalance,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn set_safe_hopr_allowance<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
new_allowance: HoprBalance,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Sets node’s Safe allowance of HOPR tokens.
Source§fn get_safe_info<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<Option<SafeInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn get_safe_info<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<Option<SafeInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Gets node’s Safe addresses info.
Source§fn set_safe_info<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
safe_info: SafeInfo,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn set_safe_info<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
safe_info: SafeInfo,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Sets node’s Safe addresses info.
Source§fn get_indexer_data<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<IndexerData>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn get_indexer_data<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<IndexerData>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Gets stored Indexer data (either from the cache or from the DB). Read more
Source§fn set_domain_separator<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
dst_type: DomainSeparator,
value: Hash,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn set_domain_separator<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
dst_type: DomainSeparator,
value: Hash,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Sets a domain separator. Read more
Source§fn set_minimum_incoming_ticket_win_prob<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
win_prob: WinningProbability,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn set_minimum_incoming_ticket_win_prob<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
win_prob: WinningProbability,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Sets the minimum required winning probability for incoming tickets.
The value must be between zero and 1.
Source§fn update_ticket_price<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
price: HoprBalance,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn update_ticket_price<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
price: HoprBalance,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Updates the ticket price.
To retrieve the stored ticket price, use
HoprDbInfoOperations::get_indexer_data
,
note that this setter should invalidate the cache.Source§fn get_indexer_state_info<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<IndexerStateInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn get_indexer_state_info<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
) -> Pin<Box<dyn Future<Output = Result<IndexerStateInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Gets the indexer state info.
Source§fn set_indexer_state_info<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
block_num: u32,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn set_indexer_state_info<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
block_num: u32,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Updates the indexer state info.
Source§fn set_network_registry_enabled<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
enabled: bool,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn set_network_registry_enabled<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
enabled: bool,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Updates the network registry state.
To retrieve the stored network registry state, use
HoprDbInfoOperations::get_indexer_data
,
note that this setter should invalidate the cache.Source§fn get_global_setting<'a, 'life0, 'async_trait>(
&'a self,
tx: OptTx<'a>,
key: &'life0 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Box<[u8]>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
fn get_global_setting<'a, 'life0, 'async_trait>(
&'a self,
tx: OptTx<'a>,
key: &'life0 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Box<[u8]>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
Gets global setting value with the given key.
Source§fn set_global_setting<'a, 'life0, 'life1, 'async_trait>(
&'a self,
tx: OptTx<'a>,
key: &'life0 str,
value: Option<&'life1 [u8]>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn set_global_setting<'a, 'life0, 'life1, 'async_trait>(
&'a self,
tx: OptTx<'a>,
key: &'life0 str,
value: Option<&'life1 [u8]>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sets the global setting value with the given key. Read more
Source§impl HoprDbLogOperations for HoprDb
impl HoprDbLogOperations for HoprDb
Source§fn store_log<'a, 'async_trait>(
&'a self,
log: SerializableLog,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn store_log<'a, 'async_trait>(
&'a self,
log: SerializableLog,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Stores a single log entry in the database. Read more
Source§fn store_logs<'life0, 'async_trait>(
&'life0 self,
logs: Vec<SerializableLog>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Result<()>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn store_logs<'life0, 'async_trait>(
&'life0 self,
logs: Vec<SerializableLog>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Result<()>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stores multiple log entries in the database. Read more
Source§fn get_log<'life0, 'async_trait>(
&'life0 self,
block_number: u64,
tx_index: u64,
log_index: u64,
) -> Pin<Box<dyn Future<Output = Result<SerializableLog>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_log<'life0, 'async_trait>(
&'life0 self,
block_number: u64,
tx_index: u64,
log_index: u64,
) -> Pin<Box<dyn Future<Output = Result<SerializableLog>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves a specific log entry from the database. Read more
Source§fn get_logs<'a, 'async_trait>(
&'a self,
block_number: Option<u64>,
block_offset: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<Vec<SerializableLog>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn get_logs<'a, 'async_trait>(
&'a self,
block_number: Option<u64>,
block_offset: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<Vec<SerializableLog>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Retrieves multiple log entries from the database. Read more
Source§fn get_logs_count<'life0, 'async_trait>(
&'life0 self,
block_number: Option<u64>,
block_offset: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_logs_count<'life0, 'async_trait>(
&'life0 self,
block_number: Option<u64>,
block_offset: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves the count of log entries from the database. Read more
Source§fn get_logs_block_numbers<'a, 'async_trait>(
&'a self,
block_number: Option<u64>,
block_offset: Option<u64>,
processed: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u64>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn get_logs_block_numbers<'a, 'async_trait>(
&'a self,
block_number: Option<u64>,
block_offset: Option<u64>,
processed: Option<bool>,
) -> Pin<Box<dyn Future<Output = Result<Vec<u64>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Retrieves block numbers of log entries from the database. Read more
Source§fn set_logs_processed<'life0, 'async_trait>(
&'life0 self,
block_number: Option<u64>,
block_offset: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_logs_processed<'life0, 'async_trait>(
&'life0 self,
block_number: Option<u64>,
block_offset: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Marks multiple log entries as processed. Read more
Source§fn set_log_processed<'a, 'async_trait>(
&'a self,
log: SerializableLog,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn set_log_processed<'a, 'async_trait>(
&'a self,
log: SerializableLog,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Marks a specific log entry as processed. Read more
Source§fn set_logs_unprocessed<'life0, 'async_trait>(
&'life0 self,
block_number: Option<u64>,
block_offset: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_logs_unprocessed<'life0, 'async_trait>(
&'life0 self,
block_number: Option<u64>,
block_offset: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Marks multiple log entries as unprocessed. Read more
Source§fn get_last_checksummed_log<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<SerializableLog>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_last_checksummed_log<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<SerializableLog>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves the last checksummed log entry from the database. Read more
Source§fn update_logs_checksums<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Hash>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_logs_checksums<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Hash>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Updates checksums for log entries in the database. Read more
Source§fn ensure_logs_origin<'life0, 'async_trait>(
&'life0 self,
contract_address_topics: Vec<(Address, Hash)>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn ensure_logs_origin<'life0, 'async_trait>(
&'life0 self,
contract_address_topics: Vec<(Address, Hash)>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Ensures that logs in this database have been created by scanning the given contract address
and their corresponding topics. If the log DB is empty, the given addresses and topics
are used to prime the table. Read more
Source§impl HoprDbPeersOperations for HoprDb
impl HoprDbPeersOperations for HoprDb
Source§fn add_network_peer<'life0, 'life1, 'async_trait>(
&'life0 self,
peer: &'life1 PeerId,
origin: PeerOrigin,
mas: Vec<Multiaddr>,
backoff: f64,
quality_window: u32,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn add_network_peer<'life0, 'life1, 'async_trait>(
&'life0 self,
peer: &'life1 PeerId,
origin: PeerOrigin,
mas: Vec<Multiaddr>,
backoff: f64,
quality_window: u32,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Adds a peer to the backend. Read more
Source§fn remove_network_peer<'life0, 'life1, 'async_trait>(
&'life0 self,
peer: &'life1 PeerId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove_network_peer<'life0, 'life1, 'async_trait>(
&'life0 self,
peer: &'life1 PeerId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Removes the peer from the backend. Read more
Source§fn update_network_peer<'life0, 'async_trait>(
&'life0 self,
new_status: PeerStatus,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_network_peer<'life0, 'async_trait>(
&'life0 self,
new_status: PeerStatus,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Updates stored information about the peer.
Should fail if the peer does not exist in the store.
Source§fn get_network_peer<'life0, 'life1, 'async_trait>(
&'life0 self,
peer: &'life1 PeerId,
) -> Pin<Box<dyn Future<Output = Result<Option<PeerStatus>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_network_peer<'life0, 'life1, 'async_trait>(
&'life0 self,
peer: &'life1 PeerId,
) -> Pin<Box<dyn Future<Output = Result<Option<PeerStatus>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Gets stored information about the peer. Read more
Source§fn get_network_peers<'a, 'async_trait>(
&'a self,
selector: PeerSelector,
sort_last_seen_asc: bool,
) -> Pin<Box<dyn Future<Output = Result<BoxStream<'a, PeerStatus>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn get_network_peers<'a, 'async_trait>(
&'a self,
selector: PeerSelector,
sort_last_seen_asc: bool,
) -> Pin<Box<dyn Future<Output = Result<BoxStream<'a, PeerStatus>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Returns a stream of all stored peers, optionally matching the given [
PeerSelector
] filter. Read moreSource§fn network_peer_stats<'life0, 'async_trait>(
&'life0 self,
quality_threshold: f64,
) -> Pin<Box<dyn Future<Output = Result<Stats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn network_peer_stats<'life0, 'async_trait>(
&'life0 self,
quality_threshold: f64,
) -> Pin<Box<dyn Future<Output = Result<Stats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the statistics on the stored peers.
Source§impl HoprDbProtocolOperations for HoprDb
impl HoprDbProtocolOperations for HoprDb
Source§fn handle_acknowledgement<'life0, 'async_trait>(
&'life0 self,
ack: VerifiedAcknowledgement,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_acknowledgement<'life0, 'async_trait>(
&'life0 self,
ack: VerifiedAcknowledgement,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Processes the acknowledgements for the pending tickets Read more
Source§fn get_network_winning_probability<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<WinningProbability>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_network_winning_probability<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<WinningProbability>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Loads (presumably cached) value of the network’s minimum winning probability from the DB.
Source§fn get_network_ticket_price<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<HoprBalance>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_network_ticket_price<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<HoprBalance>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Loads (presumably cached) value of the network’s minimum ticket price from the DB.
Source§fn find_surb<'life0, 'async_trait>(
&'life0 self,
matcher: SurbMatcher,
) -> Pin<Box<dyn Future<Output = Result<FoundSurb>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_surb<'life0, 'async_trait>(
&'life0 self,
matcher: SurbMatcher,
) -> Pin<Box<dyn Future<Output = Result<FoundSurb>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Attempts to find SURB and its ID given the [
SurbMatcher
].Source§fn get_surb_config(&self) -> SurbCacheConfig
fn get_surb_config(&self) -> SurbCacheConfig
Returns the SURB cache configuration.
Source§fn to_send_no_ack<'life0, 'async_trait>(
&'life0 self,
data: Box<[u8]>,
destination: OffchainPublicKey,
) -> Pin<Box<dyn Future<Output = Result<OutgoingPacket>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn to_send_no_ack<'life0, 'async_trait>(
&'life0 self,
data: Box<[u8]>,
destination: OffchainPublicKey,
) -> Pin<Box<dyn Future<Output = Result<OutgoingPacket>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Process the data into an outgoing packet that is not going to be acknowledged.
Source§fn to_send<'life0, 'async_trait>(
&'life0 self,
data: Box<[u8]>,
routing: ResolvedTransportRouting,
outgoing_ticket_win_prob: WinningProbability,
outgoing_ticket_price: HoprBalance,
signals: PacketSignals,
) -> Pin<Box<dyn Future<Output = Result<OutgoingPacket>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn to_send<'life0, 'async_trait>(
&'life0 self,
data: Box<[u8]>,
routing: ResolvedTransportRouting,
outgoing_ticket_win_prob: WinningProbability,
outgoing_ticket_price: HoprBalance,
signals: PacketSignals,
) -> Pin<Box<dyn Future<Output = Result<OutgoingPacket>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Process the data into an outgoing packet
Source§fn from_recv<'life0, 'life1, 'async_trait>(
&'life0 self,
data: Box<[u8]>,
pkt_keypair: &'life1 OffchainKeypair,
sender: OffchainPublicKey,
outgoing_ticket_win_prob: WinningProbability,
outgoing_ticket_price: HoprBalance,
) -> Pin<Box<dyn Future<Output = Result<IncomingPacket>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn from_recv<'life0, 'life1, 'async_trait>(
&'life0 self,
data: Box<[u8]>,
pkt_keypair: &'life1 OffchainKeypair,
sender: OffchainPublicKey,
outgoing_ticket_win_prob: WinningProbability,
outgoing_ticket_price: HoprBalance,
) -> Pin<Box<dyn Future<Output = Result<IncomingPacket>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Process the incoming packet into data
Source§impl HoprDbRegistryOperations for HoprDb
impl HoprDbRegistryOperations for HoprDb
Source§fn set_access_in_network_registry<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
address: Address,
allowed: bool,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn set_access_in_network_registry<'a, 'async_trait>(
&'a self,
tx: OptTx<'a>,
address: Address,
allowed: bool,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Sets the given node as allowed or denied in network registry.
Source§fn is_allowed_in_network_registry<'a, 'life0, 'async_trait, T>(
&'a self,
tx: OptTx<'a>,
address_like: &'life0 T,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
fn is_allowed_in_network_registry<'a, 'life0, 'async_trait, T>( &'a self, tx: OptTx<'a>, address_like: &'life0 T, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
Returns
true
if the given node is allowed in network registry.Source§impl HoprDbResolverOperations for HoprDb
impl HoprDbResolverOperations for HoprDb
Source§fn resolve_packet_key<'life0, 'life1, 'async_trait>(
&'life0 self,
onchain_key: &'life1 Address,
) -> Pin<Box<dyn Future<Output = Result<Option<OffchainPublicKey>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn resolve_packet_key<'life0, 'life1, 'async_trait>(
&'life0 self,
onchain_key: &'life1 Address,
) -> Pin<Box<dyn Future<Output = Result<Option<OffchainPublicKey>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Tries to resolve off-chain public key given the on-chain address
Source§fn resolve_chain_key<'life0, 'life1, 'async_trait>(
&'life0 self,
offchain_key: &'life1 OffchainPublicKey,
) -> Pin<Box<dyn Future<Output = Result<Option<Address>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn resolve_chain_key<'life0, 'life1, 'async_trait>(
&'life0 self,
offchain_key: &'life1 OffchainPublicKey,
) -> Pin<Box<dyn Future<Output = Result<Option<Address>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Tries to resolve on-chain public key given the off-chain public key
Source§impl HoprDbTicketOperations for HoprDb
impl HoprDbTicketOperations for HoprDb
Source§fn get_all_tickets<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<AcknowledgedTicket>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_all_tickets<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<AcknowledgedTicket>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieve acknowledged winning tickets, according to the given
selector
. Read moreSource§fn get_tickets<'life0, 'async_trait>(
&'life0 self,
selector: TicketSelector,
) -> Pin<Box<dyn Future<Output = Result<Vec<AcknowledgedTicket>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_tickets<'life0, 'async_trait>(
&'life0 self,
selector: TicketSelector,
) -> Pin<Box<dyn Future<Output = Result<Vec<AcknowledgedTicket>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieve acknowledged winning tickets, according to the given
selector
. Read moreSource§fn mark_tickets_as<'life0, 'async_trait>(
&'life0 self,
selector: TicketSelector,
mark_as: TicketMarker,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn mark_tickets_as<'life0, 'async_trait>(
&'life0 self,
selector: TicketSelector,
mark_as: TicketMarker,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Marks tickets as the given [
TicketMarker
], removing them from the DB and updating the
ticket statistics for each ticket’s channel. Read moreSource§fn mark_unsaved_ticket_rejected<'life0, 'life1, 'async_trait>(
&'life0 self,
ticket: &'life1 Ticket,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn mark_unsaved_ticket_rejected<'life0, 'life1, 'async_trait>(
&'life0 self,
ticket: &'life1 Ticket,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Updates the ticket statistics according to the fact that the given ticket has
been rejected by the packet processing pipeline. Read more
Source§fn update_ticket_states_and_fetch<'a, 'async_trait>(
&'a self,
selector: TicketSelector,
new_state: AcknowledgedTicketStatus,
) -> Pin<Box<dyn Future<Output = Result<BoxStream<'a, AcknowledgedTicket>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn update_ticket_states_and_fetch<'a, 'async_trait>(
&'a self,
selector: TicketSelector,
new_state: AcknowledgedTicketStatus,
) -> Pin<Box<dyn Future<Output = Result<BoxStream<'a, AcknowledgedTicket>>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
Source§fn update_ticket_states<'life0, 'async_trait>(
&'life0 self,
selector: TicketSelector,
new_state: AcknowledgedTicketStatus,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_ticket_states<'life0, 'async_trait>(
&'life0 self,
selector: TicketSelector,
new_state: AcknowledgedTicketStatus,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Updates state of the tickets matching the given
selector
.Source§fn get_ticket_statistics<'life0, 'async_trait>(
&'life0 self,
channel_id: Option<Hash>,
) -> Pin<Box<dyn Future<Output = Result<ChannelTicketStatistics>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_ticket_statistics<'life0, 'async_trait>(
&'life0 self,
channel_id: Option<Hash>,
) -> Pin<Box<dyn Future<Output = Result<ChannelTicketStatistics>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves the ticket statistics for the given channel. Read more
Source§fn reset_ticket_statistics<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn reset_ticket_statistics<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Resets the ticket statistics about neglected, rejected, and redeemed tickets.
Source§fn get_tickets_value<'life0, 'async_trait>(
&'life0 self,
selector: TicketSelector,
) -> Pin<Box<dyn Future<Output = Result<(usize, HoprBalance)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_tickets_value<'life0, 'async_trait>(
&'life0 self,
selector: TicketSelector,
) -> Pin<Box<dyn Future<Output = Result<(usize, HoprBalance)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Counts the tickets matching the given
selector
and their total value. Read moreSource§fn compare_and_set_outgoing_ticket_index<'life0, 'async_trait>(
&'life0 self,
channel_id: Hash,
index: u64,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn compare_and_set_outgoing_ticket_index<'life0, 'async_trait>(
&'life0 self,
channel_id: Hash,
index: u64,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sets the stored outgoing ticket index to
index
, only if the currently stored value
is less than index
. This ensures the stored value can only be growing. Read moreSource§fn reset_outgoing_ticket_index<'life0, 'async_trait>(
&'life0 self,
channel_id: Hash,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn reset_outgoing_ticket_index<'life0, 'async_trait>(
&'life0 self,
channel_id: Hash,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Resets the outgoing ticket index to 0 for the given channel id. Read more
Source§fn increment_outgoing_ticket_index<'life0, 'async_trait>(
&'life0 self,
channel_id: Hash,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn increment_outgoing_ticket_index<'life0, 'async_trait>(
&'life0 self,
channel_id: Hash,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Increments the outgoing ticket index in the given channel ID and returns the value before incrementing. Read more
Source§fn get_outgoing_ticket_index<'life0, 'async_trait>(
&'life0 self,
channel_id: Hash,
) -> Pin<Box<dyn Future<Output = Result<Arc<AtomicU64>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_outgoing_ticket_index<'life0, 'async_trait>(
&'life0 self,
channel_id: Hash,
) -> Pin<Box<dyn Future<Output = Result<Arc<AtomicU64>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Gets the current outgoing ticket index for the given channel id. Read more
Source§fn persist_outgoing_ticket_indices<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn persist_outgoing_ticket_indices<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Compares outgoing ticket indices in the cache with the stored values
and updates the stored value where changed. Read more
Source§fn prepare_aggregation_in_channel<'life0, 'life1, 'async_trait>(
&'life0 self,
channel: &'life1 Hash,
prerequisites: AggregationPrerequisites,
) -> Pin<Box<dyn Future<Output = Result<Option<(OffchainPublicKey, Vec<TransferableWinningTicket>, Hash)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn prepare_aggregation_in_channel<'life0, 'life1, 'async_trait>(
&'life0 self,
channel: &'life1 Hash,
prerequisites: AggregationPrerequisites,
) -> Pin<Box<dyn Future<Output = Result<Option<(OffchainPublicKey, Vec<TransferableWinningTicket>, Hash)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Prepare a viable collection of tickets to be aggregated. Read more
Source§fn rollback_aggregation_in_channel<'life0, 'async_trait>(
&'life0 self,
channel: Hash,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn rollback_aggregation_in_channel<'life0, 'async_trait>(
&'life0 self,
channel: Hash,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Perform a ticket aggregation rollback in the channel. Read more
Source§fn process_received_aggregated_ticket<'life0, 'life1, 'async_trait>(
&'life0 self,
aggregated_ticket: Ticket,
chain_keypair: &'life1 ChainKeypair,
) -> Pin<Box<dyn Future<Output = Result<AcknowledgedTicket>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn process_received_aggregated_ticket<'life0, 'life1, 'async_trait>(
&'life0 self,
aggregated_ticket: Ticket,
chain_keypair: &'life1 ChainKeypair,
) -> Pin<Box<dyn Future<Output = Result<AcknowledgedTicket>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Replace the aggregated tickets locally with an aggregated ticket from the counterparty.
Source§fn aggregate_tickets<'life0, 'life1, 'async_trait>(
&'life0 self,
destination: OffchainPublicKey,
acked_tickets: Vec<TransferableWinningTicket>,
me: &'life1 ChainKeypair,
) -> Pin<Box<dyn Future<Output = Result<VerifiedTicket>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn aggregate_tickets<'life0, 'life1, 'async_trait>(
&'life0 self,
destination: OffchainPublicKey,
acked_tickets: Vec<TransferableWinningTicket>,
me: &'life1 ChainKeypair,
) -> Pin<Box<dyn Future<Output = Result<VerifiedTicket>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Performs ticket aggregation as an issuing party of the given tickets.
Source§impl PathAddressResolver for HoprDb
impl PathAddressResolver for HoprDb
Source§fn resolve_transport_address<'life0, 'life1, 'async_trait>(
&'life0 self,
address: &'life1 Address,
) -> Pin<Box<dyn Future<Output = Result<Option<OffchainPublicKey>, PathError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn resolve_transport_address<'life0, 'life1, 'async_trait>(
&'life0 self,
address: &'life1 Address,
) -> Pin<Box<dyn Future<Output = Result<Option<OffchainPublicKey>, PathError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Resolve [
OffchainPublicKey
] from the given [Address
]Source§fn resolve_chain_address<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 OffchainPublicKey,
) -> Pin<Box<dyn Future<Output = Result<Option<Address>, PathError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn resolve_chain_address<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 OffchainPublicKey,
) -> Pin<Box<dyn Future<Output = Result<Option<Address>, PathError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Resolve [
Address
] from the given [OffchainPublicKey
]impl HoprDbAllOperations for HoprDb
Auto Trait Implementations§
impl Freeze for HoprDb
impl !RefUnwindSafe for HoprDb
impl Send for HoprDb
impl Sync for HoprDb
impl Unpin for HoprDb
impl !UnwindSafe for HoprDb
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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