Documentation ¶
Index ¶
- Variables
- func RegisterStreamServer(s grpc.ServiceRegistrar, srv StreamServer)
- type ForkStep
- type Request
- func (*Request) Descriptor() ([]byte, []int)deprecated
- func (x *Request) GetExcludeFilterExpr() stringdeprecated
- func (x *Request) GetForkSteps() []ForkStep
- func (x *Request) GetIncludeFilterExpr() stringdeprecated
- func (x *Request) GetIrreversibilityCondition() string
- func (x *Request) GetStartBlockNum() int64
- func (x *Request) GetStartCursor() string
- func (x *Request) GetStopBlockNum() uint64
- func (x *Request) GetTransforms() []*anypb.Any
- func (*Request) ProtoMessage()
- func (x *Request) ProtoReflect() protoreflect.Message
- func (x *Request) Reset()
- func (x *Request) String() string
- type Response
- func (*Response) Descriptor() ([]byte, []int)deprecated
- func (x *Response) GetBlock() *anypb.Any
- func (x *Response) GetCursor() string
- func (x *Response) GetStep() ForkStep
- func (*Response) ProtoMessage()
- func (x *Response) ProtoReflect() protoreflect.Message
- func (x *Response) Reset()
- func (x *Response) String() string
- type StreamClient
- type StreamServer
- type Stream_BlocksClient
- type Stream_BlocksServer
- type UnimplementedStreamServer
- type UnsafeStreamServer
Constants ¶
This section is empty.
Variables ¶
var ( ForkStep_name = map[int32]string{ 0: "STEP_UNKNOWN", 1: "STEP_NEW", 2: "STEP_UNDO", 4: "STEP_IRREVERSIBLE", } ForkStep_value = map[string]int32{ "STEP_UNKNOWN": 0, "STEP_NEW": 1, "STEP_UNDO": 2, "STEP_IRREVERSIBLE": 4, } )
Enum value maps for ForkStep.
var File_sf_firehose_v1_firehose_proto protoreflect.FileDescriptor
var Stream_ServiceDesc = grpc.ServiceDesc{ ServiceName: "sf.firehose.v1.Stream", HandlerType: (*StreamServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "Blocks", Handler: _Stream_Blocks_Handler, ServerStreams: true, }, }, Metadata: "sf/firehose/v1/firehose.proto", }
Stream_ServiceDesc is the grpc.ServiceDesc for Stream service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterStreamServer ¶
func RegisterStreamServer(s grpc.ServiceRegistrar, srv StreamServer)
Types ¶
type ForkStep ¶
type ForkStep int32
const ( ForkStep_STEP_UNKNOWN ForkStep = 0 // Block is new head block of the chain, that is linear with the previous block ForkStep_STEP_NEW ForkStep = 1 // Block is now forked and should be undone, it's not the head block of the chain anymore ForkStep_STEP_UNDO ForkStep = 2 // Block is now irreversible and can be committed to (finality is chain specific, see chain documentation for more details) ForkStep_STEP_IRREVERSIBLE ForkStep = 4 )
func (ForkStep) Descriptor ¶
func (ForkStep) Descriptor() protoreflect.EnumDescriptor
func (ForkStep) EnumDescriptor
deprecated
func (ForkStep) Number ¶
func (x ForkStep) Number() protoreflect.EnumNumber
func (ForkStep) Type ¶
func (ForkStep) Type() protoreflect.EnumType
type Request ¶
type Request struct { // Controls where the stream of blocks will start. // // The stream will start **inclusively** at the requested block num. // // When not provided, starts at first streamable block of the chain. Not all // chain starts at the same block number, so you might get an higher block than // requested when using default value of 0. // // Can be negative, will be resolved relative to the chain head block, assuming // a chain at head block #100, then using `-50` as the value will start at block // #50. If it resolves before first streamable block of chain, we assume start // of chain. // // If `start_cursor` is passed, this value is ignored and the stream instead starts // immediately after the Block pointed by the opaque `start_cursor` value. StartBlockNum int64 `protobuf:"varint,1,opt,name=start_block_num,json=startBlockNum,proto3" json:"start_block_num,omitempty"` // Controls where the stream of blocks will start which will be immediately after // the Block pointed by this opaque cursor. // // Obtain this value from a previously received `Response.cursor`. // // This value takes precedence over `start_block_num`. StartCursor string `protobuf:"bytes,13,opt,name=start_cursor,json=startCursor,proto3" json:"start_cursor,omitempty"` // When non-zero, controls where the stream of blocks will stop. // // The stream will close **after** that block has passed so the boundary is // **inclusive**. StopBlockNum uint64 `protobuf:"varint,5,opt,name=stop_block_num,json=stopBlockNum,proto3" json:"stop_block_num,omitempty"` // Filter the steps you want to see. If not specified, defaults to all steps. // // Most common steps will be [STEP_IRREVERSIBLE], or [STEP_NEW, STEP_UNDO, STEP_IRREVERSIBLE]. ForkSteps []ForkStep `protobuf:"varint,8,rep,packed,name=fork_steps,json=forkSteps,proto3,enum=sf.firehose.v1.ForkStep" json:"fork_steps,omitempty"` // feature moved to transforms // // Deprecated: Do not use. IncludeFilterExpr string `protobuf:"bytes,10,opt,name=include_filter_expr,json=includeFilterExpr,proto3" json:"include_filter_expr,omitempty"` // Deprecated: Do not use. ExcludeFilterExpr string `protobuf:"bytes,11,opt,name=exclude_filter_expr,json=excludeFilterExpr,proto3" json:"exclude_filter_expr,omitempty"` //- EOS "handoffs:3" //- EOS "lib" //- EOS "confirms:3" //- ETH "confirms:200" //- ETH "confirms:7" //- SOL "commmitement:finalized" //- SOL "confirms:200" IrreversibilityCondition string `` /* 134-byte string literal not displayed */ Transforms []*anypb.Any `protobuf:"bytes,18,rep,name=transforms,proto3" json:"transforms,omitempty"` // contains filtered or unexported fields }
For historical segments, forks are not passed
func (*Request) Descriptor
deprecated
func (*Request) GetExcludeFilterExpr
deprecated
func (*Request) GetForkSteps ¶
func (*Request) GetIncludeFilterExpr
deprecated
func (*Request) GetIrreversibilityCondition ¶
func (*Request) GetStartBlockNum ¶
func (*Request) GetStartCursor ¶
func (*Request) GetStopBlockNum ¶
func (*Request) GetTransforms ¶
func (*Request) ProtoMessage ¶
func (*Request) ProtoMessage()
func (*Request) ProtoReflect ¶
func (x *Request) ProtoReflect() protoreflect.Message
type Response ¶
type Response struct { // Chain specific block payload, one of: // - sf.eosio.codec.v1.Block // - sf.ethereum.codec.v1.Block // - sf.near.codec.v1.Block // - sf.solana.codec.v1.Block Block *anypb.Any `protobuf:"bytes,1,opt,name=block,proto3" json:"block,omitempty"` Step ForkStep `protobuf:"varint,6,opt,name=step,proto3,enum=sf.firehose.v1.ForkStep" json:"step,omitempty"` Cursor string `protobuf:"bytes,10,opt,name=cursor,proto3" json:"cursor,omitempty"` // contains filtered or unexported fields }
func (*Response) Descriptor
deprecated
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
func (*Response) ProtoReflect ¶
func (x *Response) ProtoReflect() protoreflect.Message
type StreamClient ¶
type StreamClient interface {
Blocks(ctx context.Context, in *Request, opts ...grpc.CallOption) (Stream_BlocksClient, error)
}
StreamClient is the client API for Stream service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewStreamClient ¶
func NewStreamClient(cc grpc.ClientConnInterface) StreamClient
type StreamServer ¶
type StreamServer interface {
Blocks(*Request, Stream_BlocksServer) error
}
StreamServer is the server API for Stream service. All implementations should embed UnimplementedStreamServer for forward compatibility
type Stream_BlocksClient ¶
type Stream_BlocksClient interface { Recv() (*Response, error) grpc.ClientStream }
type Stream_BlocksServer ¶
type Stream_BlocksServer interface { Send(*Response) error grpc.ServerStream }
type UnimplementedStreamServer ¶
type UnimplementedStreamServer struct { }
UnimplementedStreamServer should be embedded to have forward compatible implementations.
func (UnimplementedStreamServer) Blocks ¶
func (UnimplementedStreamServer) Blocks(*Request, Stream_BlocksServer) error
type UnsafeStreamServer ¶
type UnsafeStreamServer interface {
// contains filtered or unexported methods
}
UnsafeStreamServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to StreamServer will result in compilation errors.