Struct solana_accountsdb_plugin_postgres::accountsdb_plugin_postgres::AccountsDbPluginPostgres [−][src]
pub struct AccountsDbPluginPostgres { /* fields omitted */ }
Implementations
Trait Implementations
Do initialization for the PostgreSQL plugin.
Arguments
Format of the config file:
The accounts_selector
section allows the user to controls accounts selections.
“accounts_selector” : {
“accounts” : [“pubkey-1”, “pubkey-2”, …, “pubkey-n”],
}
or:
“accounts_selector” = {
“owners” : [“pubkey-1”, “pubkey-2”, …, “pubkey-m”]
}
Accounts either satisyfing the accounts condition or owners condition will be selected.
When only owners is specified,
all accounts belonging to the owners will be streamed.
The accounts field support wildcard to select all accounts:
“accounts_selector” : {
“accounts” : [“*”],
}
“host” specifies the PostgreSQL server.
“user” specifies the PostgreSQL user.
“threads” optional, specifies the number of worker threads for the plugin. A thread
maintains a PostgreSQL connection to the server. The default is 10.
“batch_size” optional, specifies the batch size of bulk insert when the AccountsDb is created
from restoring a snapshot. The default is “10”.
Examples
{ “libpath”: “/home/solana/target/release/libsolana_accountsdb_plugin_postgres.so”, “host”: “host_foo”, “user”: “solana”, “threads”: 10, “accounts_selector” : { “owners” : [“9oT9R5ZyRovSVnt37QvVoBttGpNqR3J7unkb567NP8k3”] }
The callback called right before a plugin is unloaded by the system Used for doing cleanup before unload. Read more
fn update_account(
&mut self,
account: ReplicaAccountInfoVersions<'_>,
slot: u64,
is_startup: bool
) -> Result<()>
fn update_account(
&mut self,
account: ReplicaAccountInfoVersions<'_>,
slot: u64,
is_startup: bool
) -> Result<()>
Called when an account is updated at a slot.
fn update_slot_status(
&mut self,
slot: u64,
parent: Option<u64>,
status: SlotStatus
) -> Result<()>
fn update_slot_status(
&mut self,
slot: u64,
parent: Option<u64>,
status: SlotStatus
) -> Result<()>
Called when a slot status is updated
Called when all accounts are notified of during startup.
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl !RefUnwindSafe for AccountsDbPluginPostgres
impl Send for AccountsDbPluginPostgres
impl Sync for AccountsDbPluginPostgres
impl Unpin for AccountsDbPluginPostgres
impl !UnwindSafe for AccountsDbPluginPostgres
Blanket Implementations
pub default fn example() -> T
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more