Documentation
¶
Index ¶
- Constants
- type Option
- func WithClient(executionClient executiondata.ExecutionDataAPIClient, ...) Option
- func WithForkCacheDir(dir string) Option
- func WithForkHeight(height uint64) Option
- func WithForkHost(host string) Option
- func WithRPCHost(host string, chainID flowgo.ChainID) Option
- func WithStartBlockHeight(height uint64) Option
- type Store
- func (s *Store) BlockByHeight(ctx context.Context, height uint64) (*flowgo.Block, error)
- func (s *Store) BlockByID(ctx context.Context, blockID flowgo.Identifier) (*flowgo.Block, error)
- func (s *Store) LatestBlock(ctx context.Context) (flowgo.Block, error)
- func (s *Store) LedgerByHeight(ctx context.Context, blockHeight uint64) (snapshot.StorageSnapshot, error)
- func (s *Store) Stop()
Constants ¶
View Source
const ( DefaultCacheDir = ".flow-fork-cache" DefaultTotalMaxSize = 2 * 1024 * 1024 * 1024 // 2 GB total DefaultTTL = 30 * 24 * time.Hour // 30 days DefaultMaxCacheCount = 10 // 10 caches max )
Configuration
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Store)
func WithClient ¶
func WithClient( executionClient executiondata.ExecutionDataAPIClient, accessClient access.AccessAPIClient, ) Option
WithClient can set an rpc host client
This is mostly use for testing.
func WithForkCacheDir ¶ added in v1.17.0
WithForkCacheDir sets the directory for fork register cache.
func WithForkHeight ¶ added in v1.10.0
WithStartBlockHeight sets the start height for the store. WithForkHeight sets the pinned fork height.
func WithForkHost ¶ added in v1.10.0
WithForkHost configures the remote access/observer node gRPC endpoint. Expects raw host:port with no scheme.
func WithRPCHost ¶ added in v0.62.0
WithRPCHost sets access/observer node host. Deprecated: use WithForkHost.
func WithStartBlockHeight ¶ added in v0.62.0
WithStartBlockHeight is deprecated: use WithForkHeight.
type Store ¶
func (*Store) BlockByHeight ¶
func (*Store) LedgerByHeight ¶
Click to show internal directories.
Click to hide internal directories.