Documentation
¶
Index ¶
- Variables
- func AlternateUint256ToUint64(bytes [32]byte) uint64
- func BitAtVector(b []byte, i int) bool
- func BitAtVectorReversed(b []byte, i int) bool
- func CalculatePercentage(value uint64, total uint64) float64
- func ConvertPeerIDStringToEnodeID(pidStr string) (enode.ID, error)
- func CustodyColumnSubnets(nodeId enode.ID, custodySubnetCount uint64, ...) (map[uint64]bool, error)
- func CustodyColumnSubnetsSlice(nodeId enode.ID, custodySubnetCount uint64, ...) ([]uint64, error)
- func CustodyColumns(nodeId enode.ID, custodySubnetCount uint64, numberOfColumns uint64, ...) (map[uint64]bool, error)
- func CustodyColumnsSlice(nodeId enode.ID, custodySubnetCount uint64, numberOfColumns uint64, ...) ([]uint64, error)
- func DecodeENR(raw string) (*enr.Record, error)
- func DecodeUint64BitfieldFromQuery(query string, fieldName string) uint64
- func FindMatchingIndices(a, b []uint64) []uint64
- func FormatAddCommas(n uint64) template.HTML
- func FormatAddCommasFormatted(num float64, precision uint) template.HTML
- func FormatAmount(amount *big.Int, unit string, digits int) template.HTML
- func FormatAmountFormatted(amount *big.Int, unit string, digits int, maxPreCommaDigitsBeforeTrim int, ...) template.HTML
- func FormatBaseFee(weiValue uint64) template.HTML
- func FormatBigAmount(amount *hexutil.Big, unit string, digits int) template.HTML
- func FormatBigNumberAddCommasFormatted(val hexutil.Big, precision uint) template.HTML
- func FormatBitlist(b []byte, v []types.NamedValidator) template.HTML
- func FormatBlobFeeDifference(eip7918Value, originalValue uint64) template.HTML
- func FormatByteAmount(bytes uint64) template.HTML
- func FormatBytesAmount(amount []byte, unit string, digits int) template.HTML
- func FormatETH(num string) string
- func FormatETHAddCommasFromGwei(gwei uint64) template.HTML
- func FormatETHFromGwei(gwei uint64) string
- func FormatETHFromGweiShort(gwei uint64) string
- func FormatEthAddress(address []byte) template.HTML
- func FormatEthAddressLink(address []byte) template.HTML
- func FormatEthBlockHashLink(blockHash []byte) template.HTML
- func FormatEthBlockLink(blockNum uint64) template.HTML
- func FormatEthTransactionLink(hash []byte, width uint64) template.HTML
- func FormatFloat(num float64, precision int) string
- func FormatFullEthFromGwei(gwei uint64) string
- func FormatGraffiti(graffiti []byte) template.HTML
- func FormatGraffitiString(graffiti string) string
- func FormatGweiValue(val uint64) string
- func FormatParticipation(v float64) template.HTML
- func FormatRecentTimeShort(ts time.Time) template.HTML
- func FormatRecvDelay(delay int32) template.HTML
- func FormatSlashedValidator(index uint64, name string) template.HTML
- func FormatTransactionValue(ethValue float64) template.HTML
- func FormatValidator(index uint64, name string) template.HTML
- func FormatValidatorNameWithIndex(index uint64, name string) template.HTML
- func FormatValidatorWithIndex(index uint64, name string) template.HTML
- func FormatWithdawalCredentials(hash []byte) template.HTML
- func GetBaseFeeAsUint64(baseFee interface{}) uint64
- func GetExplorerVersion() string
- func GetFrontendRPCUrl() string
- func GetKeyValuesFromENR(r *enr.Record) map[string]interface{}
- func GetKeyValuesFromENRFiltered(r *enr.Record) map[string]interface{}
- func GetNodeIDFromENR(r *enr.Record) enode.ID
- func GetRedactedUrl(requrl string) string
- func GetTemplateFuncs() template.FuncMap
- func GraffitiToString(graffiti []byte) string
- func HandleSubroutinePanic(identifier string, restartFn func())
- func IncludeHTML(path string) template.HTML
- func IncludeJSON(obj any, escapeHTML bool) template.HTML
- func LoadGenesisFromPathOrURL(pathOrURL string) (*core.Genesis, error)
- func LogError(err error, errorMsg interface{}, callerSkip int, ...)
- func LogFatal(err error, errorMsg interface{}, callerSkip int, ...)
- func MustParseHex(hexString string) []byte
- func ParseSpecMap(data map[string]any) map[string]any
- func ReadConfig(cfg *types.Config, path string) error
- func SliceContains(list []string, target string) bool
- func SyncCommitteeParticipation(bits []byte, syncCommitteeSize uint64) float64
- func Uint256ToUint64(bytes [32]byte) uint64
- func WaitForCtrlC()
- type Dispatcher
- type LogWriter
- type LogWriterHook
- type Subscription
Constants ¶
This section is empty.
Variables ¶
var BuildRelease string
var BuildVersion string
var Buildtime string
var Config *types.Config
Config is the globally accessible configuration
var GWEI *big.Int = big.NewInt(1000000000)
Functions ¶
func AlternateUint256ToUint64 ¶ added in v1.16.0
AlternateUint256ToUint64 converts a [32]byte representation of a uint256 to a uint64 using big.Int
func BitAtVector ¶
func BitAtVectorReversed ¶
func CalculatePercentage ¶ added in v1.16.0
CalculatePercentage calculates the percentage of a value from a total
func ConvertPeerIDStringToEnodeID ¶ added in v1.12.1
ConvertPeerIDStringToEnodeID converts a libp2p peer ID string to an enode.ID.
func CustodyColumnSubnets ¶ added in v1.12.1
func CustodyColumnSubnetsSlice ¶ added in v1.12.1
func CustodyColumns ¶ added in v1.12.1
func CustodyColumns(nodeId enode.ID, custodySubnetCount uint64, numberOfColumns uint64, dataColumnSidecarSubnetCount uint64) (map[uint64]bool, error)
CustodyColumns computes the columns the node should custody. https://github.com/ethereum/consensus-specs/blob/dev/specs/fulu/das-core.md#helper-functions
func CustodyColumnsSlice ¶ added in v1.12.1
func DecodeUint64BitfieldFromQuery ¶ added in v1.19.6
func FindMatchingIndices ¶ added in v1.15.0
FindMatchingIndices returns indices that appear in both slices assumes both slices contain uint64 values
func FormatAddCommas ¶
func FormatAddCommasFormatted ¶ added in v1.14.0
func FormatAmountFormatted ¶
func FormatBaseFee ¶ added in v1.17.0
func FormatBigAmount ¶
func FormatBigNumberAddCommasFormatted ¶ added in v1.14.0
func FormatBitlist ¶
func FormatBitlist(b []byte, v []types.NamedValidator) template.HTML
func FormatBlobFeeDifference ¶ added in v1.19.4
func FormatByteAmount ¶ added in v1.16.0
FormatByteAmount converts a byte count to a human-readable string with appropriate unit (B, kB, MB, GB)
func FormatBytesAmount ¶
func FormatETHFromGwei ¶
func FormatETHFromGweiShort ¶
func FormatEthAddress ¶
func FormatEthAddressLink ¶
func FormatEthBlockHashLink ¶
func FormatEthBlockLink ¶
func FormatFloat ¶
func FormatFullEthFromGwei ¶ added in v1.16.0
func FormatGraffiti ¶
func FormatGraffitiString ¶
FormatGraffitiString formats (and escapes) the graffiti
func FormatGweiValue ¶ added in v1.16.0
FormatGweiValue formats a gas value in Gwei
func FormatParticipation ¶
func FormatRecvDelay ¶ added in v1.17.0
func FormatTransactionValue ¶ added in v1.19.4
func FormatValidatorNameWithIndex ¶ added in v1.13.0
func GetBaseFeeAsUint64 ¶ added in v1.16.0
func GetBaseFeeAsUint64(baseFee interface{}) uint64
GetBaseFeeAsUint64 is a generic function that converts any BaseFeePerGas type to uint64 It handles both [32]byte and objects with Uint64() method
func GetExplorerVersion ¶
func GetExplorerVersion() string
func GetFrontendRPCUrl ¶ added in v1.19.1
func GetFrontendRPCUrl() string
GetFrontendRPCUrl returns the appropriate RPC URL for the frontend. If RPC proxy is enabled, it returns the local proxy endpoint. Otherwise, it returns the configured public RPC URL.
func GetKeyValuesFromENR ¶ added in v1.11.2
func GetKeyValuesFromENRFiltered ¶ added in v1.18.2
func GetRedactedUrl ¶
func GetTemplateFuncs ¶
GetTemplateFuncs will get the template functions
func GraffitiToString ¶
func HandleSubroutinePanic ¶
func HandleSubroutinePanic(identifier string, restartFn func())
func IncludeJSON ¶ added in v1.12.1
IncludeJSON adds json to the page
func LoadGenesisFromPathOrURL ¶ added in v1.19.0
LoadGenesisFromPathOrURL loads a genesis config from either a local file path or HTTP/HTTPS URL
func LogError ¶
func LogError(err error, errorMsg interface{}, callerSkip int, additionalInfos ...map[string]interface{})
LogError logs an error with callstack info that skips callerSkip many levels with arbitrarily many additional infos. callerSkip equal to 0 gives you info directly where LogError is called.
func LogFatal ¶
func LogFatal(err error, errorMsg interface{}, callerSkip int, additionalInfos ...map[string]interface{})
LogFatal logs a fatal error with callstack info that skips callerSkip many levels with arbitrarily many additional infos. callerSkip equal to 0 gives you info directly where LogFatal is called.
func MustParseHex ¶
MustParseHex will parse a string into hex
func ReadConfig ¶
ReadConfig will process a configuration
func SliceContains ¶
sliceContains reports whether the provided string is present in the given slice of strings.
func Uint256ToUint64 ¶ added in v1.16.0
Uint256ToUint64 converts a [32]byte representation of a uint256 to a uint64
Types ¶
type Dispatcher ¶ added in v1.17.0
type Dispatcher[T interface{}] struct {
// contains filtered or unexported fields
}
func (*Dispatcher[T]) Fire ¶ added in v1.17.0
func (d *Dispatcher[T]) Fire(data T)
func (*Dispatcher[T]) Subscribe ¶ added in v1.17.0
func (d *Dispatcher[T]) Subscribe(capacity int, blocking bool) *Subscription[T]
func (*Dispatcher[T]) Unsubscribe ¶ added in v1.17.0
func (d *Dispatcher[T]) Unsubscribe(subscription *Subscription[T])
type LogWriter ¶
type LogWriter struct {
// contains filtered or unexported fields
}
func InitLogger ¶
func InitLogger() (*LogWriter, logrus.FieldLogger)
type LogWriterHook ¶
WriterHook is a hook that writes logs of specified LogLevels to specified Writer
func (*LogWriterHook) Fire ¶
func (hook *LogWriterHook) Fire(entry *logrus.Entry) error
Fire will be called when some logging function is called with current hook It will format log entry to string and write it to appropriate writer
func (*LogWriterHook) Levels ¶
func (hook *LogWriterHook) Levels() []logrus.Level
type Subscription ¶ added in v1.17.0
type Subscription[T interface{}] struct {
// contains filtered or unexported fields
}
func (*Subscription[T]) Channel ¶ added in v1.17.0
func (s *Subscription[T]) Channel() <-chan T
func (*Subscription[T]) Unsubscribe ¶ added in v1.17.0
func (s *Subscription[T]) Unsubscribe()