Documentation
¶
Overview ¶
Package block provides the core business API of handling everything block related.
Index ¶
- type Core
- func (c Core) AddBlock(ctx context.Context, block db.NewBlock) (string, string, error)
- func (c Core) AddBlocks(ctx context.Context, blocks []db.Block) (bool, error)
- func (c Core) GetBlockByHash(ctx context.Context, blockHash string) (db.Block, error)
- func (c Core) GetBlockByNum(ctx context.Context, blockNum uint64) (db.Block, error)
- func (c Core) GetBlockTxnSpeed(ctx context.Context) (float64, error)
- func (c Core) GetBlocksPagination(ctx context.Context, latestBlockNum int64, order string, pageNo int64, ...) ([]db.Block, int64, int64, error)
- func (c Core) GetEarliestSyncedRoundNumber(ctx context.Context) (uint64, error)
- func (c Core) GetLastSyncedRoundNumber(ctx context.Context) (uint64, bool, error)
- func (c Core) GetLatestBlock(ctx context.Context) (db.Block, error)
- func (c Core) GetNumOfBlocks(ctx context.Context) (int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Core ¶
type Core struct {
// contains filtered or unexported fields
}
Core manages the set of API's for block access.
func NewCore ¶
func NewCore(log *zap.SugaredLogger, couchClient *kivik.Client, dbName string) Core
NewCore constructs a core for block api access.
func (Core) GetBlockByHash ¶
func (Core) GetBlockByNum ¶
func (Core) GetBlocksPagination ¶
func (Core) GetEarliestSyncedRoundNumber ¶
func (Core) GetLastSyncedRoundNumber ¶
Click to show internal directories.
Click to hide internal directories.