A Solana Validator can "leak" accounts and transactions data outside the validator. This flow of data is achieved through the The Geyser Plugin Interface.
An external library can plug into that interface by implementing the necessary functions and thus listen for accounts and transactions streams.
That dynamic library is provided to the validator at runtime. The validator can then open that library and call the implemented callbacks or hooks with accounts and transactions data.
The library can then feed on these data and take further actions, such as logging, inserting the data into a DB or a consumer/producer system, etc.
If a specific rust version not used for building, segmentation faults occur during validator start. Current mainnet ver is 1.13.6 so it's recommended to use rust 1.60.0 issue #30140.
docker run --rm -v $(PWD):/app -w /app rust:1.60.0 cargo b --release
The dynamic library path is provided to the validator using the --geyser-plugin-config
parameter.
For example when using the test validator:
solana-test-validator --geyser-plugin-config config/geyser-plugin-config.json
# or use ./scripts/run.sh
Make sure the path to your geyser plugin dynamic library has a proper path relative to a config file and a proper extenstion - .so or (.dylib on mac)
For example:
{
"libpath": "../target/release/libsolana_geyser_plugin_scaffold.so",
}