-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
29 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,68 @@ | ||
# geyser-grpc-plugin | ||
**NOTE**: Be sure to use the branch matching the major & minor versions of your RPC node. | ||
|
||
A lightweight gRPC service for streaming account and slot updates to subscribers. | ||
|
||
Folder layout is explained below: | ||
## Setup | ||
1. Compile artifact or [download release](https://github.com/jito-foundation/geyser-grpc-plugin/releases) for your specific validator version | ||
- **NOTE**: Be sure to use the branch matching the major & minor versions of your RPC node. This includes using Solana Foundation or Jito validator | ||
2. Copy the [config json file](./server/example-config.json) | ||
3. Add arg to solana validator | ||
- Example: `--geyser-plugin-config geyser.json` | ||
4. Restart validator | ||
5. Check logs for `Starting GeyserPluginService from config files` or `geyser_grpc_plugin_server::server` | ||
|
||
## Directories | ||
|
||
### [server](./server) | ||
|
||
## server | ||
This where the server side logic lives i.e. implements the geyser-plugin-interface, wires up the gRPC service, and manages connections. | ||
Note, what accounts are streamed is based on the configuration of the plugin via a [config json file](./server/example-config.json). | ||
|
||
This where the server side logic lives i.e implements the geyser-plugin-interface, wires up the gRPC service, and manages connections. | ||
Note, what accounts are streamed is decided upon on the initial load of the plugin via a [config json file](./server/example-config.json). | ||
#### API | ||
|
||
### get_heartbeat_interval | ||
The following functions are exposed for clients to use. See **[geyser.proto](./proto/proto/geyser.proto)** for more details. | ||
|
||
##### get_heartbeat_interval | ||
|
||
Returns the server's configured heartbeat interval. Clients should consider the server unhealthy if some N consecutive heartbeats are missed. | ||
|
||
### subscribe_account_updates | ||
##### subscribe_account_updates | ||
|
||
Subscribe to this endpoint if you're interested in receiving the entire account payload including the account's data bytes. | ||
|
||
### subscribe_partial_account_updates | ||
##### subscribe_partial_account_updates | ||
|
||
This endpoint streams account updates similar to `subscribe_account_updates` except consuming much less bandwidth. You may want to | ||
use this when you only care to be notified when an account is updated and don't necessarily care to what the actual state transition was. | ||
|
||
### subscribe_slot_updates | ||
##### subscribe_slot_updates | ||
|
||
Notifies subscribers of slot state transitions i.e. processed, confirmed, rooted. | ||
|
||
### Necessary Assumptions | ||
#### Necessary Assumptions | ||
|
||
The following assumptions __must__ be made: | ||
|
||
* Clients may receive data for slots out of order. | ||
* Clients may receive account updates for a given slot out of order. | ||
|
||
## proto | ||
### [proto](./proto) | ||
|
||
Contains the protobuf API definitions. | ||
|
||
## client | ||
### [client](./client) | ||
|
||
A simple gRPC client wrapper that Takes an opinionated approach to how account updates shall be consumed. | ||
A simple gRPC client wrapper that takes an opinionated approach to how account updates shall be consumed. | ||
Clients using this consumer can expect the following: | ||
|
||
1. Account updates will be streamed in monotonically; i.e. updates for older slots are discarded in the event that they were streamed by the server late. | ||
2. Account updates received out of order will trigger an error. | ||
|
||
## Setup | ||
1. Compile artifact or [download release](https://github.com/jito-foundation/geyser-grpc-plugin/releases) for your specific validator version (pay attention is using Solana Foundation or Jito validator!) | ||
2. Copy the [config json file](./server/example-config.json) | ||
3. Add flag to solana validator `--geyser-plugin-config geyser.json` | ||
4. Restart validator, tailing logs for `Starting GeyserPluginService from config files` or `geyser_grpc_plugin_server::server` | ||
|
||
## Helper Scripts | ||
### Helper Scripts | ||
|
||
For your convenience: | ||
|
||
* Run `./s` script to rsync to a server. | ||
* Run `./f` to build the binary within a container and spit out to a `container-output` folder. Run `./f jito-solana` if you plan on running it with a `jito-solana` node. Be sure to use the same `rustc` version used to build your RPC node as was used to build this. | ||
* Run `./f` to build the binary within a container and spit out to a `container-output` folder. | ||
* Run `./f jito-solana` if you plan on running it with a `jito-solana` node. | ||
- Be sure to use the same `rustc` version used to build your RPC node as was used to build this. |