services

package
v1.59.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2025 License: GPL-3.0 Imports: 62 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigurationKeyVisibleFromEpoch types.ExplorerConfigurationKey = "VisibleFromEpoch"
	ConfigurationKeyVisibleToEpoch   types.ExplorerConfigurationKey = "VisibleToEpoch"
	ConfigurationKeyHardforkEpoch    types.ExplorerConfigurationKey = "HardforkEpoch"
	ConfigurationKeyHardforkName     types.ExplorerConfigurationKey = "HardforkName"
)
View Source
const (
	JobStatusScheduled = "scheduled"
	JobStatusRunning   = "running"
	JobStatusOK        = "ok"
	JobStatusError     = "error"
	JobStatusSkipped   = "skipped"
)

JobStatus represents the status stored in validator_tagger_job_runs.status

View Source
const (
	ConfigurationCategorySlotViz types.ExplorerConfigurationCategory = "SlotVizOnMainPage"
)

Variables

View Source
var ChartHandlers = map[string]chartHandler{
	"blocks":             {1, blocksChartData},
	"validators":         {2, activeValidatorsChartData},
	"staked_ether":       {3, stakedEtherChartData},
	"average_balance":    {4, averageBalanceChartData},
	"network_liveness":   {5, networkLivenessChartData},
	"participation_rate": {6, participationRateChartData},

	"stake_effectiveness":            {9, stakeEffectivenessChartData},
	"balance_distribution":           {10, balanceDistributionChartData},
	"effective_balance_distribution": {11, effectiveBalanceDistributionChartData},
	"performance_distribution_365d":  {12, performanceDistribution365dChartData},
	"deposits":                       {13, depositsChartData},
	"withdrawals":                    {17, withdrawalsChartData},
	"graffiti_wordcloud":             {14, graffitiCloudChartData},
	"pools_distribution":             {15, poolsDistributionChartData},
	"historic_pool_performance":      {16, historicPoolPerformanceData},

	"avg_gas_used_chart_data": {22, AvgGasUsedChartData},
	"execution_burned_fees":   {23, BurnedFeesChartData},
	"block_gas_used":          {25, TotalGasUsedChartData},

	"block_count_chart_data":    {26, BlockCountChartData},
	"block_time_avg_chart_data": {27, BlockTimeAvgChartData},

	"avg_gas_limit_chart_data":  {28, AvgGasLimitChartData},
	"avg_block_util_chart_data": {29, AvgBlockUtilChartData},
	"tx_count_chart_data":       {31, TxCountChartData},
}
View Source
var DefaultExplorerConfiguration types.ExplorerConfigurationMap = types.ExplorerConfigurationMap{
	ConfigurationCategorySlotViz: {
		ConfigurationKeyVisibleFromEpoch: {Value: "0", DataType: "int"},
		ConfigurationKeyHardforkEpoch:    {Value: "0", DataType: "int"},
		ConfigurationKeyVisibleToEpoch:   {Value: "4", DataType: "int"},
		ConfigurationKeyHardforkName:     {Value: "", DataType: "string"},
	},
}

** This is the list of possible configurations that can be changed in the explorer administration Per default these values will be taken, overridden by the values from the db, if they exist. **

Functions

func AvgBlockSizeChartData

func AvgBlockSizeChartData() (*types.GenericChartData, error)

func AvgBlockUtilChartData

func AvgBlockUtilChartData() (*types.GenericChartData, error)

func AvgGasLimitChartData

func AvgGasLimitChartData() (*types.GenericChartData, error)

func AvgGasPrice

func AvgGasPrice() (*types.GenericChartData, error)

func AvgGasUsedChartData

func AvgGasUsedChartData() (*types.GenericChartData, error)

func BlockCountChartData

func BlockCountChartData() (*types.GenericChartData, error)

func BlockTimeAvgChartData

func BlockTimeAvgChartData() (*types.GenericChartData, error)

func BurnedFeesChartData

func BurnedFeesChartData() (*types.GenericChartData, error)

func Eth1HeadBlockRootHash

func Eth1HeadBlockRootHash() []byte

Eth1HeadBlockRootHash will return the hash of the current chain head block

func EthStoreDisclaimer

func EthStoreDisclaimer() string

func FinalizationDelay

func FinalizationDelay() uint64

FinalizationDelay will return the current Finalization Delay

func GetExplorerConfigurationsWithDefaults

func GetExplorerConfigurationsWithDefaults() (types.ExplorerConfigurationMap, error)

func GetFeed

func GetFeed() [][4]string

func GetIndexForPubkey

func GetIndexForPubkey(pubkey []byte) (uint64, error)

func GetLatestStats

func GetLatestStats() *types.Stats

func GetMaxEffectiveBalance added in v1.59.0

func GetMaxEffectiveBalance() uint64

func GetPubkeyForIndex

func GetPubkeyForIndex(index uint64) ([]byte, error)

will retrieve the pubkey for a given validatorindex and store it for later use

func GetRates

func GetRates(selectedCurrency string) *types.Rates

func GlobalNotificationMessage

func GlobalNotificationMessage() template.HTML

func Init

func Init()

Init will initialize the services

func InitGitCoinFeed

func InitGitCoinFeed()

func InitNotificationCollector

func InitNotificationCollector(pubkeyCachePath string)

func InitNotificationSender

func InitNotificationSender()

func IsFeedOn

func IsFeedOn() bool

func IsSyncing

func IsSyncing() bool

IsSyncing returns true if the chain is still syncing

func LatestBurnData

func LatestBurnData() *types.BurnPageData

func LatestChartsPageData

func LatestChartsPageData() []*types.ChartsPageDataChart

LatestChartsPageData returns the latest chart page data

func LatestEpoch

func LatestEpoch() uint64

LatestEpoch will return the latest epoch

func LatestEth1BlockNumber

func LatestEth1BlockNumber() uint64

LatestEth1BlockNumber will return most recent eth1 block number

func LatestEthStoreStatistics

func LatestEthStoreStatistics() *types.EthStoreStatistics

func LatestExportedStatisticDay

func LatestExportedStatisticDay() (uint64, error)

LatestExportedStatisticDay will return the last exported day in the validator_stats table

func LatestFinalizedEpoch

func LatestFinalizedEpoch() uint64

LatestFinalizedEpoch will return the most recent epoch that has been finalized.

func LatestGasNowData

func LatestGasNowData() *types.GasNowPageData

func LatestIndexPageData

func LatestIndexPageData() *types.IndexPageData

LatestIndexPageData returns the latest index page data

func LatestMempoolTransactions

func LatestMempoolTransactions() *types.RawMempoolResponse

func LatestNodeEpoch

func LatestNodeEpoch() uint64

func LatestNodeFinalizedEpoch

func LatestNodeFinalizedEpoch() uint64

func LatestPoolsPageData

func LatestPoolsPageData() *types.PoolsResp

LatestPoolsPageData returns the latest pools page data

func LatestProposedSlot

func LatestProposedSlot() uint64

LatestProposedSlot will return the latest proposed slot

func LatestQueueData added in v1.59.0

func LatestQueueData() *types.QueuesEstimate

func LatestRelaysPageData

func LatestRelaysPageData() *types.RelaysResp

func LatestSlot

func LatestSlot() uint64

LatestSlot will return the latest slot

func LatestSlotVizMetrics

func LatestSlotVizMetrics() []*types.SlotVizEpochs

func LatestState

func LatestState() *types.LatestState

LatestState returns statistics about the current eth2 state

func MarketCapChartData

func MarketCapChartData() (*types.GenericChartData, error)

func NewAccountsChartData

func NewAccountsChartData() (*types.GenericChartData, error)

func NonFailedTxGasUsageChartData

func NonFailedTxGasUsageChartData() (*types.GenericChartData, error)

func PowerConsumptionChartData

func PowerConsumptionChartData() (*types.GenericChartData, error)

func ReportStatus

func ReportStatus(name, status string, metadata *json.RawMessage)

Report the status of a particular service, will add current Pid and executable name Throttle calls to 1/min for each service name so that we don't report too often

func RunStepDepositTagging added in v1.59.0

func RunStepDepositTagging(ctx context.Context, balanceByIndex map[uint64]int64) (err error)

RunStepDepositTagging tags remaining untagged validators by earliest deposit from_address. If balanceByIndex is nil, it will compute balances from withdrawal tagging logic first.

func RunStepImport added in v1.59.0

func RunStepImport(ctx context.Context) (err error)

RunStepImport runs the primary import step (from local CSV or Dune if configured).

func RunStepLido added in v1.59.0

func RunStepLido(ctx context.Context) (err error)

RunStepLido enriches Lido validators via the existing exporter/indexer.

func RunStepLidoCSM added in v1.59.0

func RunStepLidoCSM(ctx context.Context) (err error)

RunStepLidoCSM enriches validators from Lido CSM module.

func RunStepLidoSimpleDVT added in v1.59.0

func RunStepLidoSimpleDVT(ctx context.Context) (err error)

RunStepLidoSimpleDVT enriches validators from Lido Simple DVT module.

func RunStepPopulateValidatorNames added in v1.59.0

func RunStepPopulateValidatorNames(ctx context.Context) (err error)

RunStepPopulateValidatorNames populates validator_names based on validator_entities.

func RunStepPrecompute added in v1.59.0

func RunStepPrecompute(ctx context.Context) (err error)

RunStepPrecompute runs the precompute aggregation for entities across periods.

func RunStepRocketPool added in v1.59.0

func RunStepRocketPool(ctx context.Context) (err error)

RunStepRocketPool sets Rocket Pool sub_entity based on node address.

func RunStepWithdrawalTagging added in v1.59.0

func RunStepWithdrawalTagging(ctx context.Context) (_ map[uint64]int64, err error)

RunStepWithdrawalTagging tags untagged validators based on withdrawal credentials and returns balances map for reuse.

func RunValidatorTaggerOnDemand added in v1.59.0

func RunValidatorTaggerOnDemand(ctx context.Context, stepsCSV string) error

RunValidatorTaggerOnDemand runs one or more steps provided by name, in order, and records them as manual runs.

func RunValidatorTaggerScheduler added in v1.59.0

func RunValidatorTaggerScheduler()

RunValidatorTaggerScheduler starts the scheduler loop: - Daily at 10:00 UTC: runs all daily steps in order, then precompute. - Hourly at HH:00 UTC (other than 10:00): runs precompute only. Uses validator_tagger_job_runs to track scheduling, status, and errors.

func StartHistoricPriceService

func StartHistoricPriceService()

func TotalEmissionChartData

func TotalEmissionChartData() (*types.GenericChartData, error)

func TotalGasUsedChartData

func TotalGasUsedChartData() (*types.GenericChartData, error)

func TxCountChartData

func TxCountChartData() (*types.GenericChartData, error)

func WriteHistoricPricesForDay

func WriteHistoricPricesForDay(ts time.Time) error

Types

type BigFloat

type BigFloat big.Float

func (*BigFloat) Scan

func (b *BigFloat) Scan(value interface{}) error

func (*BigFloat) Value

func (b *BigFloat) Value() (driver.Value, error)

type BlockWrapper added in v1.59.0

type BlockWrapper struct {
	Header       *geth_types.Header
	Transactions []rpcTransaction
}

BlockWrapper is a simple wrapper for Ethereum block data.

func GetBlock added in v1.59.0

func GetBlock(client *geth_rpc.Client, blockType string) (*BlockWrapper, error)

type JobRun added in v1.59.0

type JobRun struct {
	ID             int64
	JobName        string
	RunGroupID     *string
	ScheduledAtUTC time.Time
	StartedAt      sql.NullTime
	FinishedAt     sql.NullTime
	Status         string
	ErrorText      sql.NullString
	TriggeredBy    string
}

JobRun represents a row in validator_tagger_job_runs.

type MachineEvents

type MachineEvents struct {
	SubscriptionID  uint64         `db:"id"`
	UserID          uint64         `db:"user_id"`
	MachineName     string         `db:"machine"`
	UnsubscribeHash sql.NullString `db:"unsubscribe_hash"`
	EventThreshold  float64        `db:"event_threshold"`
}

type PeriodSpec added in v1.59.0

type PeriodSpec struct {
	Label              string // one of: "1d", "7d", "30d", "90d"
	RollingTable       string // e.g., validator_dashboard_data_rolling_24h / _7d / _30d / _90d
	HistoryTable       string // e.g., validator_dashboard_data_hourly / _daily / _monthly
	HistoryWhereClause string // optional WHERE clause for limiting the history time window (without the WHERE keyword)
}

PeriodSpec defines ClickHouse sources and labels for a precomputation period.

type TxPoolContent

type TxPoolContent struct {
	Pending map[string]map[int]*TxPoolContentTransaction
}

type TxPoolContentTransaction

type TxPoolContentTransaction struct {
	GasPrice     string `json:"gasPrice"`
	MaxFeePerGas string `json:"maxFeePerGas"`
	Hash         string `json:"hash"`
}

func (*TxPoolContentTransaction) GetGasPrice

func (tx *TxPoolContentTransaction) GetGasPrice() *big.Int

type ValidatorEntityJoinRow added in v1.59.0

type ValidatorEntityJoinRow struct {
	ValidatorIndex uint64  `db:"validatorindex"`
	Status         string  `db:"status"`
	Entity         string  `db:"entity"`
	SubEntity      *string `db:"sub_entity"`
}

type WebhookQueue

type WebhookQueue struct {
	NotificationID uint64         `db:"id"`
	Url            string         `db:"url"`
	Retries        uint64         `db:"retries"`
	LastSent       time.Time      `db:"last_retry"`
	Destination    sql.NullString `db:"destination"`
	Payload        []byte         `db:"payload"`
	LastTry        time.Time      `db:"last_try"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL