Documentation
¶
Index ¶
- Variables
- func DataNodeHasData(ctx context.Context, conf sqlstore.ConnectionConfig) (bool, error)
- func DataNodeIsEmpty(ctx context.Context, connConfig sqlstore.ConnectionConfig) (bool, error)
- func DatanodeFromDeHistory(parentCtx context.Context, cfg Config, log *logging.Logger, ...) (err error)
- func FetchHistoryBlocks(ctx context.Context, logInfo func(s string, args ...interface{}), ...) (int64, error)
- func GetDatanodeBlockSpan(ctx context.Context, connConfig sqlstore.ConnectionConfig) (from int64, to int64, err error)
- func GetDatanodeClientFromIPAndPort(ip string, port int) (v2.TradingDataServiceClient, *grpc.ClientConn, error)
- func GetMostRecentHistorySegmentFromPeer(ctx context.Context, ip string, datanodeGrpcAPIPort int) (*v2.HistorySegment, error)
- func GetMostRecentHistorySegmentFromPeers(ctx context.Context, peerAddresses []string, grpcAPIPort int) (*v2.HistorySegment, map[string]*v2.HistorySegment, error)
- func GetOldestHistoryBlockAndLastBlock(ctx context.Context, connConfig sqlstore.ConnectionConfig) (oldestHistoryBlock *entities.Block, lastBlock *entities.Block, err error)
- func GetSnapshotPaths(useEmbedded bool, conf snapshot.Config, vegaPaths paths.Paths) (snapshotsCopyFrom string, snapshotsCopyTo string)
- func HasVegaSchema(ctx context.Context, conf sqlstore.ConnectionConfig) (bool, error)
- func SelectRootSegment(peerToSegment map[string]*v2.HistorySegment) *v2.HistorySegment
- func VerifyChainID(chainID string, chainService *service.Chain) error
- type Config
- type FetchResult
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrFailedToGetSegment = errors.New("no history segment found")
Functions ¶
func DataNodeHasData ¶
func DataNodeIsEmpty ¶
func DatanodeFromDeHistory ¶
func FetchHistoryBlocks ¶
func FetchHistoryBlocks(ctx context.Context, logInfo func(s string, args ...interface{}), historySegmentID string, fetchHistory func(ctx context.Context, historySegmentID string) (FetchResult, error), numBlocksToFetch int64, ) (int64, error)
FetchHistoryBlocks will keep fetching history until numBlocksToFetch is reached or all history is retrieved.
func GetDatanodeBlockSpan ¶
func GetDatanodeClientFromIPAndPort ¶
func GetDatanodeClientFromIPAndPort(ip string, port int) (v2.TradingDataServiceClient, *grpc.ClientConn, error)
func GetMostRecentHistorySegmentFromPeers ¶
func GetMostRecentHistorySegmentFromPeers(ctx context.Context, peerAddresses []string, grpcAPIPort int, ) (*v2.HistorySegment, map[string]*v2.HistorySegment, error)
func GetSnapshotPaths ¶
func HasVegaSchema ¶
func SelectRootSegment ¶
func SelectRootSegment(peerToSegment map[string]*v2.HistorySegment) *v2.HistorySegment
TODO this needs some thought as to the best strategy to select the root segment to avoid spoofing.
Types ¶
type Config ¶
type Config struct { MinimumBlockCount int64 `long:"block-count" description:"the minimum number of blocks to fetch"` TimeOut encoding.Duration `long:"timeout" description:"maximum time allowed to auto-initialise the node"` }
func NewDefaultConfig ¶
func NewDefaultConfig() Config
type FetchResult ¶
func FromSegmentIndexEntry ¶
func FromSegmentIndexEntry(s store.SegmentIndexEntry) FetchResult
Click to show internal directories.
Click to hide internal directories.