Documentation ¶
Index ¶
Constants ¶
View Source
const ( SNAPSHOT_BLOCK_HEIGHT = "SNAPSHOT_BLOCK_HEIGHT" SNAPSHOT_WORKERS = "SNAPSHOT_WORKERS" SNAPSHOT_RECOVERY_FILE = "SNAPSHOT_RECOVERY_FILE" SNAPSHOT_MODE = "SNAPSHOT_MODE" SNAPSHOT_START_HEIGHT = "SNAPSHOT_START_HEIGHT" SNAPSHOT_END_HEIGHT = "SNAPSHOT_END_HEIGHT" SNAPSHOT_ACCOUNTS = "SNAPSHOT_ACCOUNTS" LOGRUS_LEVEL = "LOGRUS_LEVEL" LOGRUS_FILE = "LOGRUS_FILE" PROM_METRICS = "PROM_METRICS" PROM_HTTP = "PROM_HTTP" PROM_HTTP_ADDR = "PROM_HTTP_ADDR" PROM_HTTP_PORT = "PROM_HTTP_PORT" PROM_DB_STATS = "PROM_DB_STATS" FILE_OUTPUT_DIR = "FILE_OUTPUT_DIR" ANCIENT_DB_PATH = "ANCIENT_DB_PATH" LVL_DB_PATH = "LVL_DB_PATH" ETH_CLIENT_NAME = "ETH_CLIENT_NAME" ETH_GENESIS_BLOCK = "ETH_GENESIS_BLOCK" ETH_NETWORK_ID = "ETH_NETWORK_ID" ETH_NODE_ID = "ETH_NODE_ID" ETH_CHAIN_ID = "ETH_CHAIN_ID" DATABASE_NAME = "DATABASE_NAME" DATABASE_HOSTNAME = "DATABASE_HOSTNAME" DATABASE_PORT = "DATABASE_PORT" DATABASE_USER = "DATABASE_USER" DATABASE_PASSWORD = "DATABASE_PASSWORD" DATABASE_MAX_IDLE_CONNECTIONS = "DATABASE_MAX_IDLE_CONNECTIONS" DATABASE_MAX_OPEN_CONNECTIONS = "DATABASE_MAX_OPEN_CONNECTIONS" DATABASE_MAX_CONN_LIFETIME = "DATABASE_MAX_CONN_LIFETIME" )
ENV variables
View Source
const ( SNAPSHOT_BLOCK_HEIGHT_TOML = "snapshot.blockHeight" SNAPSHOT_WORKERS_TOML = "snapshot.workers" SNAPSHOT_RECOVERY_FILE_TOML = "snapshot.recoveryFile" SNAPSHOT_MODE_TOML = "snapshot.mode" SNAPSHOT_START_HEIGHT_TOML = "snapshot.startHeight" SNAPSHOT_END_HEIGHT_TOML = "snapshot.endHeight" SNAPSHOT_ACCOUNTS_TOML = "snapshot.accounts" LOGRUS_LEVEL_TOML = "log.level" LOGRUS_FILE_TOML = "log.file" PROM_METRICS_TOML = "prom.metrics" PROM_HTTP_TOML = "prom.http" PROM_HTTP_ADDR_TOML = "prom.httpAddr" PROM_HTTP_PORT_TOML = "prom.httpPort" PROM_DB_STATS_TOML = "prom.dbStats" FILE_OUTPUT_DIR_TOML = "file.outputDir" ANCIENT_DB_PATH_TOML = "leveldb.ancient" LVL_DB_PATH_TOML = "leveldb.path" ETH_CLIENT_NAME_TOML = "ethereum.clientName" ETH_GENESIS_BLOCK_TOML = "ethereum.genesisBlock" ETH_NETWORK_ID_TOML = "ethereum.networkID" ETH_NODE_ID_TOML = "ethereum.nodeID" ETH_CHAIN_ID_TOML = "ethereum.chainID" DATABASE_NAME_TOML = "database.name" DATABASE_HOSTNAME_TOML = "database.hostname" DATABASE_PORT_TOML = "database.port" DATABASE_USER_TOML = "database.user" DATABASE_PASSWORD_TOML = "database.password" DATABASE_MAX_IDLE_CONNECTIONS_TOML = "database.maxIdle" DATABASE_MAX_OPEN_CONNECTIONS_TOML = "database.maxOpen" DATABASE_MAX_CONN_LIFETIME_TOML = "database.maxLifetime" )
TOML bindings
View Source
const ( SNAPSHOT_BLOCK_HEIGHT_CLI = "block-height" SNAPSHOT_WORKERS_CLI = "workers" SNAPSHOT_RECOVERY_FILE_CLI = "recovery-file" SNAPSHOT_MODE_CLI = "snapshot-mode" SNAPSHOT_START_HEIGHT_CLI = "start-height" SNAPSHOT_END_HEIGHT_CLI = "end-height" SNAPSHOT_ACCOUNTS_CLI = "snapshot-accounts" LOGRUS_LEVEL_CLI = "log-level" LOGRUS_FILE_CLI = "log-file" PROM_METRICS_CLI = "prom-metrics" PROM_HTTP_CLI = "prom-http" PROM_HTTP_ADDR_CLI = "prom-httpAddr" PROM_HTTP_PORT_CLI = "prom-httpPort" PROM_DB_STATS_CLI = "prom-dbStats" FILE_OUTPUT_DIR_CLI = "output-dir" ANCIENT_DB_PATH_CLI = "ancient-path" LVL_DB_PATH_CLI = "leveldb-path" ETH_CLIENT_NAME_CLI = "ethereum-client-name" ETH_GENESIS_BLOCK_CLI = "ethereum-genesis-block" ETH_NETWORK_ID_CLI = "ethereum-network-id" ETH_NODE_ID_CLI = "ethereum-node-id" ETH_CHAIN_ID_CLI = "ethereum-chain-id" DATABASE_NAME_CLI = "database-name" DATABASE_HOSTNAME_CLI = "database-hostname" DATABASE_PORT_CLI = "database-port" DATABASE_USER_CLI = "database-user" DATABASE_PASSWORD_CLI = "database-password" DATABASE_MAX_IDLE_CONNECTIONS_CLI = "database-max-idle" DATABASE_MAX_OPEN_CONNECTIONS_CLI = "database-max-open" DATABASE_MAX_CONN_LIFETIME_CLI = "database-max-lifetime" )
CLI flags
Variables ¶
This section is empty.
Functions ¶
func NewPublisher ¶
func NewPublisher(mode SnapshotMode, config *Config) (snapt.Publisher, error)
Types ¶
type Config ¶
type Config struct { Eth *EthConfig DB *DBConfig File *FileConfig Service *ServiceConfig }
Config contains params for both databases the service uses
func NewConfig ¶
func NewConfig(mode SnapshotMode) (*Config, error)
func NewInPlaceSnapshotConfig ¶
func NewInPlaceSnapshotConfig() *Config
type FileConfig ¶
type FileConfig struct {
OutputDir string
}
func (*FileConfig) Init ¶
func (c *FileConfig) Init() error
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service holds ethDB and stateDB to read data from lvldb and Publisher to publish trie in postgres DB.
func NewSnapshotService ¶
NewSnapshotService creates Service.
func (*Service) CreateLatestSnapshot ¶
func (s *Service) CreateLatestSnapshot(workers uint, watchedAddresses map[common.Address]struct{}) error
CreateLatestSnapshot snapshot at head (ignores height param)
func (*Service) CreateSnapshot ¶
func (s *Service) CreateSnapshot(params SnapshotParams) error
type ServiceConfig ¶
func (*ServiceConfig) Init ¶
func (c *ServiceConfig) Init() error
type SnapshotMode ¶
type SnapshotMode string
SnapshotMode specifies the snapshot data output method
const ( PgSnapshot SnapshotMode = "postgres" FileSnapshot SnapshotMode = "file" )
Click to show internal directories.
Click to hide internal directories.