Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultLogger = defaultLogger{}
DefaultLogger logs via the log package
var NopLogger = nopLogger{}
NopLogger logs nothing
Functions ¶
This section is empty.
Types ¶
type ChainSyncFunc ¶
ChainSyncFunc callback containing json encoded chainsync.Response
type ChainSyncOption ¶
type ChainSyncOption func(opts *ChainSyncOptions)
ChainSyncOption provides functional options for ChainSync
func WithPoints ¶
func WithPoints(points ...chainsync.Point) ChainSyncOption
WithPoints allows starting from an optional point
func WithStore ¶
func WithStore(store Store) ChainSyncOption
WithStore specifies store to persist points to; defaults to no persistence
type ChainSyncOptions ¶
type ChainSyncOptions struct {
// contains filtered or unexported fields
}
ChainSyncOptions configuration parameters
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides a client for the chain sync protocol only
func (*Client) ChainSync ¶
func (c *Client) ChainSync(ctx context.Context, callback ChainSyncFunc, opts ...ChainSyncOption) (io.Closer, error)
ChainSync replays the blockchain by invoking the callback for each block By default, ChainSync stores no checkpoints and always restarts from origin. These can be overridden via WithPoints and WithStore
type Option ¶
type Option func(*Options)
Option to cardano client
func WithEndpoint ¶
WithEndpoint allows ogmios endpoint to set; defaults to ws://127.0.0.1:1337
func WithInterval ¶
WithInterval specifies how frequently to save checkpoints when reading
func WithLogger ¶
WithLogger allows custom logger to be specified
func WithPipeline ¶
WithPipeline allows number of pipelined ogmios requests to be provided
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options available to ogmios client
type Store ¶
type Store interface { // Save the point; save will be called multiple times and should only // keep track of the most recent points Save(ctx context.Context, point chainsync.Point) error // Load saved points Load(ctx context.Context) (chainsync.Points, error) }
Store allows points to be saved and retrieved to allow graceful recovery after shutdown