Documentation
¶
Index ¶
Constants ¶
View Source
const ( RESYNC_START = "RESYNC_START" RESYNC_STOP = "RESYNC_STOP" RESYNC_BATCH_SIZE = "RESYNC_BATCH_SIZE" RESYNC_WORKERS = "RESYNC_WORKERS" RESYNC_CLEAR_OLD_CACHE = "RESYNC_CLEAR_OLD_CACHE" RESYNC_TYPE = "RESYNC_TYPE" RESYNC_RESET_VALIDATION = "RESYNC_RESET_VALIDATION" RESYNC_MAX_IDLE_CONNECTIONS = "RESYNC_MAX_IDLE_CONNECTIONS" RESYNC_MAX_OPEN_CONNECTIONS = "RESYNC_MAX_OPEN_CONNECTIONS" RESYNC_MAX_CONN_LIFETIME = "RESYNC_MAX_CONN_LIFETIME" )
Env variables
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
ResyncType shared.DataType // The type of data to resync
ClearOldCache bool // Resync will first clear all the data within the range
ResetValidation bool // If true, resync will reset the validation level to 0 for the given range
// DB info
DB *postgres.DB
DBConfig postgres.Config
HTTPClient *rpc.Client // Ethereum rpc client
NodeInfo node.Info // Info for the associated node
Ranges [][2]uint64 // The block height ranges to resync
BatchSize uint64 // BatchSize for the resync http calls (client has to support batch sizing)
Timeout time.Duration // HTTP connection timeout in seconds
Workers uint64
}
Config holds the parameters needed to perform a resync
type Resync ¶
type Resync interface {
Sync() error
}
func NewResyncService ¶
NewResyncService creates and returns a resync service from the provided settings
type Service ¶
type Service struct {
// Interface for fetching historical statediff objects over http
Fetcher eth.Fetcher
// Interface for transforming payloads into IPLD object models in Postgres
Transformer eth.Transformer
// Interface for cleaning out data before resyncing (if clearOldCache is on)
Cleaner eth.Cleaner
// Size of batch fetches
BatchSize uint64
// Number of goroutines
Workers int64
// Chain config
ChainConfig *params.ChainConfig
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.