Documentation ¶
Index ¶
- Constants
- type BlockHeightWatcher
- func (b *BlockHeightWatcher) BlockHeight() uint64
- func (b *BlockHeightWatcher) IsFinalized(blockNum uint64) bool
- func (b *BlockHeightWatcher) Start() error
- func (b *BlockHeightWatcher) Stop() error
- func (b *BlockHeightWatcher) Subscribe(cb BlockSub) int
- func (b *BlockHeightWatcher) Unsubscribe(hdl int)
- type BlockSub
- type CacheableMap
- type Cacher
- type ETHStore
- func (e *ETHStore) CacheBalance(address string, data []byte) error
- func (e *ETHStore) CacheBlockByNumber(data []byte, includeBodies bool) error
- func (e *ETHStore) CacheTransactionReceipt(data []byte) error
- func (e *ETHStore) GetBalance(address string) ([]byte, error)
- func (e *ETHStore) GetBlockByNumber(number uint64, includeBodies bool) ([]byte, error)
- func (e *ETHStore) GetTransactionReceipt(hash string) ([]byte, error)
- type RedisCacher
- func (r *RedisCacher) Del(key string) error
- func (r *RedisCacher) Get(key string) ([]byte, error)
- func (r *RedisCacher) Has(key string) (bool, error)
- func (r *RedisCacher) MapGet(key string, field string) ([]byte, error)
- func (r *RedisCacher) MapSetEx(key string, vals CacheableMap, expiration time.Duration) error
- func (r *RedisCacher) Set(key string, value []byte) error
- func (r *RedisCacher) SetEx(key string, value []byte, expiration time.Duration) error
- func (r *RedisCacher) Start() error
- func (r *RedisCacher) Stop() error
- type Warmer
Constants ¶
View Source
const EagerlyLoadedBlocks = 200
View Source
const FinalityDepth = 7
View Source
const LastSeenKey = "lastseenblock"
View Source
const WarmUpConcurrency = 5
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockHeightWatcher ¶
type BlockHeightWatcher struct {
// contains filtered or unexported fields
}
func NewBlockHeightWatcher ¶
func NewBlockHeightWatcher(sw backend.Switcher) *BlockHeightWatcher
func (*BlockHeightWatcher) BlockHeight ¶
func (b *BlockHeightWatcher) BlockHeight() uint64
func (*BlockHeightWatcher) IsFinalized ¶
func (b *BlockHeightWatcher) IsFinalized(blockNum uint64) bool
func (*BlockHeightWatcher) Start ¶
func (b *BlockHeightWatcher) Start() error
func (*BlockHeightWatcher) Stop ¶
func (b *BlockHeightWatcher) Stop() error
func (*BlockHeightWatcher) Subscribe ¶
func (b *BlockHeightWatcher) Subscribe(cb BlockSub) int
func (*BlockHeightWatcher) Unsubscribe ¶
func (b *BlockHeightWatcher) Unsubscribe(hdl int)
type CacheableMap ¶
type Cacher ¶
type Cacher interface { pkg.Service Get(key string) ([]byte, error) Set(key string, value []byte) error SetEx(key string, value []byte, expiration time.Duration) error Has(key string) (bool, error) MapGet(key string, field string) ([]byte, error) MapSetEx(key string, vals CacheableMap, expiration time.Duration) error Del(key string) error }
type ETHStore ¶
type ETHStore struct {
// contains filtered or unexported fields
}
func NewETHStore ¶
func NewETHStore(cacher Cacher, hWatcher *BlockHeightWatcher) *ETHStore
func (*ETHStore) CacheBlockByNumber ¶
func (*ETHStore) CacheTransactionReceipt ¶
func (*ETHStore) GetBlockByNumber ¶
type RedisCacher ¶
type RedisCacher struct {
// contains filtered or unexported fields
}
func NewRedisCacher ¶
func NewRedisCacher(cfg *config.RedisConfig) *RedisCacher
func (*RedisCacher) Del ¶
func (r *RedisCacher) Del(key string) error
func (*RedisCacher) MapSetEx ¶
func (r *RedisCacher) MapSetEx(key string, vals CacheableMap, expiration time.Duration) error
func (*RedisCacher) Start ¶
func (r *RedisCacher) Start() error
func (*RedisCacher) Stop ¶
func (r *RedisCacher) Stop() error
Click to show internal directories.
Click to hide internal directories.