Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BadEncodingError ¶
type BadEncodingError struct{}
BadEncodingError contains all relevant information to generate a BadEncodingFraudProof.
type Block ¶
type Block struct {
// contains filtered or unexported fields
}
Block represents the entirety of a Block in the Celestia network. It contains the erasure coded block data as well as its ExtendedHeader.
func (*Block) Data ¶
func (b *Block) Data() *ExtendedBlockData
Data returns the erasure coded data of the Block.
func (*Block) Header ¶
func (b *Block) Header() *header.ExtendedHeader
Header returns the ExtendedHeader of the Block.
type ExtendedBlockData ¶
type ExtendedBlockData = rsmt2d.ExtendedDataSquare
ExtendedBlockData is an alias to rsmt2d's ExtendedDataSquare type.
type Fetcher ¶
type Fetcher interface {
GetBlock(ctx context.Context, height *int64) (*RawBlock, error)
Commit(ctx context.Context, height *int64) (*core.Commit, error)
ValidatorSet(ctx context.Context, height *int64) (*core.ValidatorSet, error)
SubscribeNewBlockEvent(ctx context.Context) (<-chan *RawBlock, error)
UnsubscribeNewBlockEvent(ctx context.Context) error
}
Fetcher encompasses the behavior necessary to fetch new "raw" blocks.
type RawBlock ¶
RawBlock is an alias to a "raw" Core block. It is "raw" because it is still awaiting erasure coding.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service represents the Block service that can be started / stopped on a `Full` node. Service contains 4 main functionalities:
- Fetching "raw" blocks from either Celestia Core or other Celestia Full nodes.
- Erasure coding the "raw" blocks and producing a DataAvailabilityHeader + verifying the Data root.
- Storing erasure coded blocks.
- Serving erasure coded blocks to other `Full` node peers.
TODO @renaynay: add docs about broadcaster
func NewBlockService ¶
func NewBlockService(fetcher Fetcher, store ipld.DAGService, broadcaster header.Broadcaster) *Service
NewBlockService creates a new instance of block Service.
func (*Service) GetBlockData ¶
func (s *Service) GetBlockData(ctx context.Context, dah *da.DataAvailabilityHeader) (*ExtendedBlockData, error)
func (*Service) StoreBlockData ¶
func (s *Service) StoreBlockData(ctx context.Context, data *ExtendedBlockData) error