Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterBlockStreamServer(s grpc.ServiceRegistrar, srv BlockStreamServer)
- type BasicBlockRef
- type Block
- func (b *Block) AsRef() BasicBlockRef
- func (*Block) Descriptor() ([]byte, []int)deprecated
- func (b *Block) GetFirehoseBlockID() string
- func (b *Block) GetFirehoseBlockNumber() uint64
- func (b *Block) GetFirehoseBlockParentID() string
- func (b *Block) GetFirehoseBlockParentNumber() uint64
- func (b *Block) GetFirehoseBlockTime() time.Time
- func (x *Block) GetHeadNum() uint64deprecated
- func (x *Block) GetId() string
- func (x *Block) GetLibNum() uint64
- func (x *Block) GetNumber() uint64
- func (x *Block) GetParentId() string
- func (x *Block) GetParentNum() uint64
- func (x *Block) GetPayload() *anypb.Any
- func (x *Block) GetPayloadBuffer() []bytedeprecated
- func (x *Block) GetPayloadKind() Protocoldeprecated
- func (x *Block) GetPayloadVersion() int32deprecated
- func (x *Block) GetTimestamp() *timestamppb.Timestamp
- func (b *Block) PreviousRef() *BasicBlockRef
- func (*Block) ProtoMessage()
- func (x *Block) ProtoReflect() protoreflect.Message
- func (x *Block) Reset()
- func (x *Block) String() string
- func (b *Block) Time() time.Time
- func (b *Block) ToBlocKMeta() *BlockMeta
- type BlockMeta
- func (*BlockMeta) Descriptor() ([]byte, []int)deprecated
- func (x *BlockMeta) GetId() string
- func (x *BlockMeta) GetLibNum() uint64
- func (x *BlockMeta) GetNumber() uint64
- func (x *BlockMeta) GetParentId() string
- func (x *BlockMeta) GetParentNum() uint64
- func (x *BlockMeta) GetTimestamp() *timestamppb.Timestamp
- func (*BlockMeta) ProtoMessage()
- func (x *BlockMeta) ProtoReflect() protoreflect.Message
- func (x *BlockMeta) Reset()
- func (x *BlockMeta) 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 ¶
const (
BlockStream_Blocks_FullMethodName = "/sf.bstream.v1.BlockStream/Blocks"
)
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: "COSMOS", } Protocol_value = map[string]int32{ "UNKNOWN": 0, "EOS": 1, "ETH": 2, "SOLANA": 3, "NEAR": 4, "COSMOS": 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 BasicBlockRef ¶
type BasicBlockRef struct {
// contains filtered or unexported fields
}
func (BasicBlockRef) ID ¶
func (e BasicBlockRef) ID() string
func (BasicBlockRef) Num ¶
func (e BasicBlockRef) Num() uint64
func (BasicBlockRef) String ¶
func (e BasicBlockRef) String() string
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"` ParentId string `protobuf:"bytes,3,opt,name=parent_id,json=parentId,proto3" json:"parent_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"` // Deprecated: Marked as deprecated in sf/bstream/v1/bstream.proto. PayloadKind Protocol `protobuf:"varint,6,opt,name=payload_kind,json=payloadKind,proto3,enum=sf.bstream.v1.Protocol" json:"payload_kind,omitempty"` // Deprecated: Marked as deprecated in sf/bstream/v1/bstream.proto. PayloadVersion int32 `protobuf:"varint,7,opt,name=payload_version,json=payloadVersion,proto3" json:"payload_version,omitempty"` // Deprecated: Marked as deprecated in sf/bstream/v1/bstream.proto. PayloadBuffer []byte `protobuf:"bytes,8,opt,name=payload_buffer,json=payloadBuffer,proto3" json:"payload_buffer,omitempty"` // Deprecated: Marked as deprecated in sf/bstream/v1/bstream.proto. HeadNum uint64 `protobuf:"varint,9,opt,name=head_num,json=headNum,proto3" json:"head_num,omitempty"` ParentNum uint64 `protobuf:"varint,10,opt,name=parent_num,json=parentNum,proto3" json:"parent_num,omitempty"` Payload *anypb.Any `protobuf:"bytes,11,opt,name=payload,proto3" json:"payload,omitempty"` // contains filtered or unexported fields }
Block is the chain agnostic representation of a block. It contains the block metadata like num, hash, parent num, etc as well as containing the payload.
**Required** Any changes to non-payload field on this object must be reflected in `BlockMeta` as well!
func (*Block) AsRef ¶
func (b *Block) AsRef() BasicBlockRef
func (*Block) Descriptor
deprecated
func (*Block) GetFirehoseBlockID ¶
func (*Block) GetFirehoseBlockNumber ¶
func (*Block) GetFirehoseBlockParentID ¶
func (*Block) GetFirehoseBlockParentNumber ¶
func (*Block) GetFirehoseBlockTime ¶
func (*Block) GetHeadNum
deprecated
func (*Block) GetParentId ¶
func (*Block) GetParentNum ¶
func (*Block) GetPayload ¶
func (*Block) GetPayloadBuffer
deprecated
func (*Block) GetPayloadKind
deprecated
func (*Block) GetPayloadVersion
deprecated
func (*Block) GetTimestamp ¶
func (x *Block) GetTimestamp() *timestamppb.Timestamp
func (*Block) PreviousRef ¶
func (b *Block) PreviousRef() *BasicBlockRef
func (*Block) ProtoMessage ¶
func (*Block) ProtoMessage()
func (*Block) ProtoReflect ¶
func (x *Block) ProtoReflect() protoreflect.Message
func (*Block) ToBlocKMeta ¶
type BlockMeta ¶
type BlockMeta 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"` ParentId string `protobuf:"bytes,3,opt,name=parent_id,json=parentId,proto3" json:"parent_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"` ParentNum uint64 `protobuf:"varint,10,opt,name=parent_num,json=parentNum,proto3" json:"parent_num,omitempty"` // contains filtered or unexported fields }
BlockMeta is strictly equivalent to Block, except that it doesn't contain the payload nor any field related to payload.
First, it's used to store block meta information on disk or on a KV store. Second, it serves the purpose of being a lighter version of Block, that can to `proto.Unmarshal` a real `Block` while ignoring the payload.
**Required** Alignment of the fields in this struct is **required** to be the same as `Block` to allow for `proto.Unmarshal` to work.
func (*BlockMeta) Descriptor
deprecated
func (*BlockMeta) GetParentId ¶
func (*BlockMeta) GetParentNum ¶
func (*BlockMeta) GetTimestamp ¶
func (x *BlockMeta) GetTimestamp() *timestamppb.Timestamp
func (*BlockMeta) ProtoMessage ¶
func (*BlockMeta) ProtoMessage()
func (*BlockMeta) ProtoReflect ¶
func (x *BlockMeta) 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. // -1 means "LIB" // any other "-X" value means "start at block X" 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.