Skip to content

Commit

Permalink
added fumarole proto
Browse files Browse the repository at this point in the history
  • Loading branch information
lvboudre committed Nov 20, 2024
1 parent 3123525 commit fe7d83e
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 2 deletions.
4 changes: 2 additions & 2 deletions yellowstone-grpc-proto/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ use tonic_build::manual::{Builder, Method, Service};

fn main() -> anyhow::Result<()> {
std::env::set_var("PROTOC", protobuf_src::protoc());

// build protos
tonic_build::compile_protos("proto/geyser.proto")?;
tonic_build::compile_protos("proto/fumarole.proto")?;

// build with accepting our custom struct
let geyser_service = Service::builder()
Expand Down Expand Up @@ -78,6 +77,7 @@ fn main() -> anyhow::Result<()> {
.build(),
)
.build();

Builder::new()
.build_client(false)
.compile(&[geyser_service]);
Expand Down
75 changes: 75 additions & 0 deletions yellowstone-grpc-proto/proto/fumarole.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
syntax = "proto3";

option go_package = "github.com/rpcpool/solana-geyser-grpc/golang/proto";

import public "geyser.proto";

package fumarole;

service Fumarole {
rpc CreateStaticConsumerGroup(CreateStaticConsumerGroupRequest) returns (CreateStaticConsumerGroupResponse) {}
rpc Subscribe(stream SubscribeRequest) returns (stream geyser.SubscribeUpdate) {}
rpc GetSlotLagInfo(GetSlotLagInfoRequest) returns (GetSlotLagInfoResponse) {}
}

message GetSlotLagInfoRequest {
string consumer_group_label = 1;
}

message GetSlotLagInfoResponse {
uint64 max_slot_seen = 1;
uint64 global_max_slot = 2;
}

message SubscribeRequest {
string consumer_group_label = 1;
optional uint32 consumer_id = 2;
optional AccountUpdateFilter accounts = 3;
optional TransactionFilter transactions = 4;
}

message CreateStaticConsumerGroupResponse {
string group_id = 1;
}

enum InitialOffsetPolicy {
EARLIEST = 0;
LATEST = 1;
SLOT = 2;
}

enum EventSubscriptionPolicy {
ACCOUNT_UPDATE_ONLY = 0;
TRANSACTION_ONLY = 1;
BOTH = 2;
}

message CreateStaticConsumerGroupRequest {
string consumer_group_label = 1;
optional uint32 member_count = 2;
InitialOffsetPolicy initial_offset_policy = 3;
geyser.CommitmentLevel commitment_level = 4;
EventSubscriptionPolicy event_subscription_policy = 5;
optional int64 at_slot = 6;
}


/// The AccountUpdateFilter message defines filters for account update events. It includes the following fields:
///
/// pubkeys (1)
/// A repeated field of bytes representing public keys. Events matching any of these public keys will be included in the filtered results.
///
/// owners (2)
/// A repeated field of bytes representing account owners. Events matching any of these account owners will be included in the filtered results.
message AccountUpdateFilter {
repeated string account = 1;
repeated string owner = 2;
}

/// The TransactionFilter message specifies filters for transaction events. It contains the following field:

/// account_keys (1)
/// A repeated field of bytes representing account keys. Events associated with any of these account keys will be included in the filtered results.
message TransactionFilter {
repeated string account_keys = 1;
}
4 changes: 4 additions & 0 deletions yellowstone-grpc-proto/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ pub mod solana {
}
}

pub mod fumarole {
tonic::include_proto!("fumarole");
}

pub mod prelude {
pub use super::{geyser::*, solana::storage::confirmed_block::*};
}
Expand Down

0 comments on commit fe7d83e

Please sign in to comment.