services

package
v1.58.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: GPL-3.0 Imports: 53 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 (
	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 GeneratePdfReport

func GeneratePdfReport(hist rewardHistory, currency string) []byte

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 GetPdfReport

func GetPdfReport(validatorArr []uint64, currency string, start uint64, end uint64) []byte

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 GetValidatorHist

func GetValidatorHist(validatorArr []uint64, currency string, start uint64, end uint64) rewardHistory

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 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

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 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 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 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