Struct solana_accountsdb_plugin_postgres::accountsdb_plugin_postgres::AccountsDbPluginPostgres[][src]

pub struct AccountsDbPluginPostgres { /* fields omitted */ }

Implementations

Trait Implementations

Do initialization for the PostgreSQL plugin.

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”, optional, specifies the PostgreSQL server.
  • “user”, optional, specifies the PostgreSQL user.
  • “port”, optional, specifies the PostgreSQL server’s port.
  • “connection_str”, optional, the custom PostgreSQL connection string. Please refer to https://docs.rs/postgres/0.19.2/postgres/config/struct.Config.html for the connection configuration. When connection_str is set, the values in “host”, “user” and “port” are ignored. If connection_str is not given, host and user must be given.
  • “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’.
  • “panic_on_db_errors”, optional, contols if to panic when there are errors replicating data to the PostgreSQL database. The default is ‘false’.
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

Called when an account is updated at a slot.

Called when a slot status is updated

Called when all accounts are notified of during startup.

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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