utils

package
v0.0.0-...-7a2e46d Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EpochDuration = 12 * 32 * time.Second

Functions

This section is empty.

Types

type BuilderUtils

type BuilderUtils struct {
	BuilderLast    map[string]bool
	Mu             sync.Mutex
	Log            logrus.Entry
	RedisInterface *redisPackage.RedisInterface
}

func (*BuilderUtils) GetBuilders

func (builderInterface *BuilderUtils) GetBuilders(ponPool ponpool.PonRegistrySubgraph, db database.DatabaseInterface)

func (*BuilderUtils) SetBuilderStatus

func (builderInterface *BuilderUtils) SetBuilderStatus(builder string, status bool) error

type DiscordConfig

type DiscordConfig struct {
	// contains filtered or unexported fields
}

type DiscordEmbed

type DiscordEmbed struct {
	Fields []DiscordParams `json:"fields"`
	Image  DiscordImage    `json:"image"`
}

type DiscordImage

type DiscordImage struct {
	URL string `json:"url"`
}

type DiscordParams

type DiscordParams struct {
	Name   string `json:"name"`
	Value  string `json:"value"`
	Inline bool   `json:"inline,omitempty"`
}

type DiscordPublish

type DiscordPublish struct {
	Username  string         `json:"username"`
	AvatarURL string         `json:"avatar_url"`
	Content   string         `json:"content"`
	Embeds    []DiscordEmbed `json:"embeds"`
}

type GetHeaderResponse

type GetHeaderResponse struct {
	Version string                            `json:"version"`
	Data    *relayTypes.SignedBuilderBlockBid `json:"data"`
}

type GetPayloadResponse

type GetPayloadResponse struct {
	Capella *api.VersionedExecutionPayload
}

type GetPayloadUtils

type GetPayloadUtils struct {
	Version              string
	Data                 *commonTypes.VersionedExecutionPayloadHeader
	API                  string
	BuilderWalletAddress string
}

type ProposerHeaderResponse

type ProposerHeaderResponse struct {
	Slot              uint64
	ProposerPubKeyHex string
	Bid               GetHeaderResponse
}

type ProposerUpdates

type ProposerUpdates struct {
	ValidatorsLast map[string]string
	Mu             sync.Mutex
}

type ProposerUtils

type ProposerUtils struct {
	Log            logrus.Entry
	RedisInterface *redisPackage.RedisInterface
	BeaconClient   *beaconclient.MultiBeaconClient
	Validators     relayTypes.ValidatorIndexes
	ProposerStatus ProposerUpdates
}

func (*ProposerUtils) GetValidators

func (proposer *ProposerUtils) GetValidators(ponPool ponpool.PonRegistrySubgraph, db database.DatabaseInterface)

func (*ProposerUtils) SetValidatorStatus

func (proposerInterface *ProposerUtils) SetValidatorStatus(validator string, status string) error

func (*ProposerUtils) ValidatorIndex

func (proposer *ProposerUtils) ValidatorIndex(proposers []string)

type PublicKey

type PublicKey [48]byte

func (*PublicKey) FromSlice

func (p *PublicKey) FromSlice(x []byte) error

func (PublicKey) String

func (p PublicKey) String() string

func (*PublicKey) UnmarshalText

func (p *PublicKey) UnmarshalText(input []byte) error

type RelayUtils

type RelayUtils struct {
	Discord *DiscordConfig
	// contains filtered or unexported fields
}

func NewRelayUtils

func NewRelayUtils(db *database.DatabaseInterface, beaconClient *beaconclient.MultiBeaconClient, ponPool ponpool.PonRegistrySubgraph, redisInterface redisPackage.RedisInterface, discordWebhook string) *RelayUtils

func (*RelayUtils) BuilderStatus

func (relay *RelayUtils) BuilderStatus(builder string) (BuilderStatus bool, err error)

func (*RelayUtils) BuilderUpdate

func (relay *RelayUtils) BuilderUpdate()

func (*RelayUtils) ProposerUpdate

func (relay *RelayUtils) ProposerUpdate()

func (*RelayUtils) ReporterUpdate

func (relay *RelayUtils) ReporterUpdate()

func (*RelayUtils) SendDiscord

func (relay *RelayUtils) SendDiscord(slot phase0.Slot, builder string, proposer PublicKey) error

func (*RelayUtils) StartUtils

func (relayUtils *RelayUtils) StartUtils() (err error)

func (*RelayUtils) ValidatorIndexToPubkey

func (relay *RelayUtils) ValidatorIndexToPubkey(index uint64, network uint64) (PublicKey, error)

type ReporterUtils

type ReporterUtils struct {
	ReporterLast   map[string]bool
	Mu             sync.Mutex
	Log            logrus.Entry
	RedisInterface *redisPackage.RedisInterface
}

func (*ReporterUtils) GetReporters

func (reporterInterface *ReporterUtils) GetReporters(ponPool ponpool.PonRegistrySubgraph, db database.DatabaseInterface)

func (*ReporterUtils) SetReporterStatus

func (reporterInterface *ReporterUtils) SetReporterStatus(reporter string, status bool) error

Jump to

Keyboard shortcuts

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