Documentation
¶
Index ¶
- Variables
- func RegisterBlockStreamServer(s grpc.ServiceRegistrar, srv BlockStreamServer)
- type Block
- func (*Block) Descriptor() ([]byte, []int)deprecated
- func (x *Block) GetId() string
- func (x *Block) GetLibNum() uint64
- func (x *Block) GetNumber() uint64
- func (x *Block) GetPayloadBuffer() []byte
- func (x *Block) GetPayloadKind() Protocol
- func (x *Block) GetPayloadVersion() int32
- func (x *Block) GetPreviousId() string
- func (x *Block) GetTimestamp() *timestamppb.Timestamp
- func (*Block) ProtoMessage()
- func (x *Block) ProtoReflect() protoreflect.Message
- func (x *Block) Reset()
- func (x *Block) String() string
- type BlockRef
- type BlockRequest
- func (*BlockRequest) Descriptor() ([]byte, []int)deprecated
- func (x *BlockRequest) GetBurst() int64
- func (x *BlockRequest) GetContentType() string
- func (x *BlockRequest) GetOrder() BlockRequest_Order
- func (x *BlockRequest) GetRequester() string
- func (*BlockRequest) ProtoMessage()
- func (x *BlockRequest) ProtoReflect() protoreflect.Message
- func (x *BlockRequest) Reset()
- func (x *BlockRequest) String() string
- type BlockRequest_Order
- func (BlockRequest_Order) Descriptor() protoreflect.EnumDescriptor
- func (x BlockRequest_Order) Enum() *BlockRequest_Order
- func (BlockRequest_Order) EnumDescriptor() ([]byte, []int)deprecated
- func (x BlockRequest_Order) Number() protoreflect.EnumNumber
- func (x BlockRequest_Order) String() string
- func (BlockRequest_Order) Type() protoreflect.EnumType
- type BlockStreamClient
- type BlockStreamServer
- type BlockStream_BlocksClient
- type BlockStream_BlocksServer
- type Cursor
- func (*Cursor) Descriptor() ([]byte, []int)deprecated
- func (x *Cursor) GetBlock() *BlockRef
- func (x *Cursor) GetHeadBlock() *BlockRef
- func (x *Cursor) GetLib() *BlockRef
- func (x *Cursor) GetStep() ForkStep
- func (*Cursor) ProtoMessage()
- func (x *Cursor) ProtoReflect() protoreflect.Message
- func (x *Cursor) Reset()
- func (x *Cursor) String() string
- type ForkStep
- type GenericBlockIndex
- func (*GenericBlockIndex) Descriptor() ([]byte, []int)deprecated
- func (x *GenericBlockIndex) GetKv() []*KeyToBitmap
- func (*GenericBlockIndex) ProtoMessage()
- func (x *GenericBlockIndex) ProtoReflect() protoreflect.Message
- func (x *GenericBlockIndex) Reset()
- func (x *GenericBlockIndex) String() string
- type KeyToBitmap
- type Protocol
- type UnimplementedBlockStreamServer
- type UnsafeBlockStreamServer
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 ( Protocol_name = map[int32]string{ 0: "UNKNOWN", 1: "EOS", 2: "ETH", 3: "SOLANA", 4: "NEAR", 5: "TENDERMINT", } Protocol_value = map[string]int32{ "UNKNOWN": 0, "EOS": 1, "ETH": 2, "SOLANA": 3, "NEAR": 4, "TENDERMINT": 5, } )
Enum value maps for Protocol.
var ( BlockRequest_Order_name = map[int32]string{ 0: "UNSPECIFIED", 1: "ORDERED", 2: "UNORDERED", } BlockRequest_Order_value = map[string]int32{ "UNSPECIFIED": 0, "ORDERED": 1, "UNORDERED": 2, } )
Enum value maps for BlockRequest_Order.
var BlockStream_ServiceDesc = grpc.ServiceDesc{ ServiceName: "sf.bstream.v1.BlockStream", HandlerType: (*BlockStreamServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "Blocks", Handler: _BlockStream_Blocks_Handler, ServerStreams: true, }, }, Metadata: "sf/bstream/v1/bstream.proto", }
BlockStream_ServiceDesc is the grpc.ServiceDesc for BlockStream service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_sf_bstream_v1_bstream_proto protoreflect.FileDescriptor
Functions ¶
func RegisterBlockStreamServer ¶
func RegisterBlockStreamServer(s grpc.ServiceRegistrar, srv BlockStreamServer)
Types ¶
type Block ¶
type Block struct { Number uint64 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` PreviousId string `protobuf:"bytes,3,opt,name=previous_id,json=previousId,proto3" json:"previous_id,omitempty"` Timestamp *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` LibNum uint64 `protobuf:"varint,5,opt,name=lib_num,json=libNum,proto3" json:"lib_num,omitempty"` PayloadKind Protocol `protobuf:"varint,6,opt,name=payload_kind,json=payloadKind,proto3,enum=sf.bstream.v1.Protocol" json:"payload_kind,omitempty"` PayloadVersion int32 `protobuf:"varint,7,opt,name=payload_version,json=payloadVersion,proto3" json:"payload_version,omitempty"` PayloadBuffer []byte `protobuf:"bytes,8,opt,name=payload_buffer,json=payloadBuffer,proto3" json:"payload_buffer,omitempty"` // contains filtered or unexported fields }
func (*Block) Descriptor
deprecated
func (*Block) GetPayloadBuffer ¶
func (*Block) GetPayloadKind ¶
func (*Block) GetPayloadVersion ¶
func (*Block) GetPreviousId ¶
func (*Block) GetTimestamp ¶
func (x *Block) GetTimestamp() *timestamppb.Timestamp
func (*Block) ProtoMessage ¶
func (*Block) ProtoMessage()
func (*Block) ProtoReflect ¶
func (x *Block) ProtoReflect() protoreflect.Message
type BlockRef ¶
type BlockRef struct { Num uint64 `protobuf:"varint,1,opt,name=num,proto3" json:"num,omitempty"` Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*BlockRef) Descriptor
deprecated
func (*BlockRef) ProtoMessage ¶
func (*BlockRef) ProtoMessage()
func (*BlockRef) ProtoReflect ¶
func (x *BlockRef) ProtoReflect() protoreflect.Message
type BlockRequest ¶
type BlockRequest struct { // Number of blocks we want to get in burst upon connection, on a best effort basis. Burst int64 `protobuf:"varint,1,opt,name=burst,proto3" json:"burst,omitempty"` // Type of blocks we're after here, is it 'ethereum' data, 'eos', etc.. The server can fail early // if he doesn't match the data he serves (services mismatch, etc..) ContentType string `protobuf:"bytes,2,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"` Order BlockRequest_Order `protobuf:"varint,3,opt,name=order,proto3,enum=sf.bstream.v1.BlockRequest_Order" json:"order,omitempty"` Requester string `protobuf:"bytes,4,opt,name=requester,proto3" json:"requester,omitempty"` // contains filtered or unexported fields }
func (*BlockRequest) Descriptor
deprecated
func (*BlockRequest) Descriptor() ([]byte, []int)
Deprecated: Use BlockRequest.ProtoReflect.Descriptor instead.
func (*BlockRequest) GetBurst ¶
func (x *BlockRequest) GetBurst() int64
func (*BlockRequest) GetContentType ¶
func (x *BlockRequest) GetContentType() string
func (*BlockRequest) GetOrder ¶
func (x *BlockRequest) GetOrder() BlockRequest_Order
func (*BlockRequest) GetRequester ¶
func (x *BlockRequest) GetRequester() string
func (*BlockRequest) ProtoMessage ¶
func (*BlockRequest) ProtoMessage()
func (*BlockRequest) ProtoReflect ¶
func (x *BlockRequest) ProtoReflect() protoreflect.Message
func (*BlockRequest) Reset ¶
func (x *BlockRequest) Reset()
func (*BlockRequest) String ¶
func (x *BlockRequest) String() string
type BlockRequest_Order ¶
type BlockRequest_Order int32
Whether we can assume the data will come ordered, unless there is a chain reorganization. mindreaders output ordered data, whereas relayers can output unordered data. The server can fail early if the assumption of the caller cannot be fulfilled.
const ( BlockRequest_UNSPECIFIED BlockRequest_Order = 0 BlockRequest_ORDERED BlockRequest_Order = 1 BlockRequest_UNORDERED BlockRequest_Order = 2 )
func (BlockRequest_Order) Descriptor ¶
func (BlockRequest_Order) Descriptor() protoreflect.EnumDescriptor
func (BlockRequest_Order) Enum ¶
func (x BlockRequest_Order) Enum() *BlockRequest_Order
func (BlockRequest_Order) EnumDescriptor
deprecated
func (BlockRequest_Order) EnumDescriptor() ([]byte, []int)
Deprecated: Use BlockRequest_Order.Descriptor instead.
func (BlockRequest_Order) Number ¶
func (x BlockRequest_Order) Number() protoreflect.EnumNumber
func (BlockRequest_Order) String ¶
func (x BlockRequest_Order) String() string
func (BlockRequest_Order) Type ¶
func (BlockRequest_Order) Type() protoreflect.EnumType
type BlockStreamClient ¶
type BlockStreamClient interface {
Blocks(ctx context.Context, in *BlockRequest, opts ...grpc.CallOption) (BlockStream_BlocksClient, error)
}
BlockStreamClient is the client API for BlockStream 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 NewBlockStreamClient ¶
func NewBlockStreamClient(cc grpc.ClientConnInterface) BlockStreamClient
type BlockStreamServer ¶
type BlockStreamServer interface {
Blocks(*BlockRequest, BlockStream_BlocksServer) error
}
BlockStreamServer is the server API for BlockStream service. All implementations should embed UnimplementedBlockStreamServer for forward compatibility
type BlockStream_BlocksClient ¶
type BlockStream_BlocksClient interface { Recv() (*Block, error) grpc.ClientStream }
type BlockStream_BlocksServer ¶
type BlockStream_BlocksServer interface { Send(*Block) error grpc.ServerStream }
type Cursor ¶
type Cursor struct { Block *BlockRef `protobuf:"bytes,1,opt,name=block,proto3" json:"block,omitempty"` HeadBlock *BlockRef `protobuf:"bytes,2,opt,name=head_block,json=headBlock,proto3" json:"head_block,omitempty"` Lib *BlockRef `protobuf:"bytes,3,opt,name=lib,proto3" json:"lib,omitempty"` Step ForkStep `protobuf:"varint,4,opt,name=step,proto3,enum=sf.bstream.v1.ForkStep" json:"step,omitempty"` // contains filtered or unexported fields }
Cursor is used to generate a string cursor, currently being utilized in forkable
func (*Cursor) Descriptor
deprecated
func (*Cursor) GetHeadBlock ¶
func (*Cursor) ProtoMessage ¶
func (*Cursor) ProtoMessage()
func (*Cursor) ProtoReflect ¶
func (x *Cursor) ProtoReflect() protoreflect.Message
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 GenericBlockIndex ¶
type GenericBlockIndex struct { Kv []*KeyToBitmap `protobuf:"bytes,4,rep,name=kv,proto3" json:"kv,omitempty"` // contains filtered or unexported fields }
func (*GenericBlockIndex) Descriptor
deprecated
func (*GenericBlockIndex) Descriptor() ([]byte, []int)
Deprecated: Use GenericBlockIndex.ProtoReflect.Descriptor instead.
func (*GenericBlockIndex) GetKv ¶
func (x *GenericBlockIndex) GetKv() []*KeyToBitmap
func (*GenericBlockIndex) ProtoMessage ¶
func (*GenericBlockIndex) ProtoMessage()
func (*GenericBlockIndex) ProtoReflect ¶
func (x *GenericBlockIndex) ProtoReflect() protoreflect.Message
func (*GenericBlockIndex) Reset ¶
func (x *GenericBlockIndex) Reset()
func (*GenericBlockIndex) String ¶
func (x *GenericBlockIndex) String() string
type KeyToBitmap ¶
type KeyToBitmap struct { Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Bitmap []byte `protobuf:"bytes,2,opt,name=bitmap,proto3" json:"bitmap,omitempty"` // contains filtered or unexported fields }
func (*KeyToBitmap) Descriptor
deprecated
func (*KeyToBitmap) Descriptor() ([]byte, []int)
Deprecated: Use KeyToBitmap.ProtoReflect.Descriptor instead.
func (*KeyToBitmap) GetBitmap ¶
func (x *KeyToBitmap) GetBitmap() []byte
func (*KeyToBitmap) GetKey ¶
func (x *KeyToBitmap) GetKey() []byte
func (*KeyToBitmap) ProtoMessage ¶
func (*KeyToBitmap) ProtoMessage()
func (*KeyToBitmap) ProtoReflect ¶
func (x *KeyToBitmap) ProtoReflect() protoreflect.Message
func (*KeyToBitmap) Reset ¶
func (x *KeyToBitmap) Reset()
func (*KeyToBitmap) String ¶
func (x *KeyToBitmap) String() string
type Protocol ¶
type Protocol int32
func (Protocol) Descriptor ¶
func (Protocol) Descriptor() protoreflect.EnumDescriptor
func (Protocol) EnumDescriptor
deprecated
func (Protocol) Number ¶
func (x Protocol) Number() protoreflect.EnumNumber
func (Protocol) Type ¶
func (Protocol) Type() protoreflect.EnumType
type UnimplementedBlockStreamServer ¶
type UnimplementedBlockStreamServer struct { }
UnimplementedBlockStreamServer should be embedded to have forward compatible implementations.
func (UnimplementedBlockStreamServer) Blocks ¶
func (UnimplementedBlockStreamServer) Blocks(*BlockRequest, BlockStream_BlocksServer) error
type UnsafeBlockStreamServer ¶
type UnsafeBlockStreamServer interface {
// contains filtered or unexported methods
}
UnsafeBlockStreamServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to BlockStreamServer will result in compilation errors.