etl

package
v0.0.0-...-01cd907 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TxTypePlay                               = "play"
	TxTypeManageEntity                       = "manage_entity"
	TxTypeValidatorRegistration              = "validator_registration"
	TxTypeValidatorDeregistration            = "validator_deregistration"
	TxTypeValidatorRegistrationLegacy        = "validator_registration_legacy"
	TxTypeSlaRollup                          = "sla_rollup"
	TxTypeValidatorMisbehaviorDeregistration = "validator_misbehavior_deregistration"
	TxTypeStorageProof                       = "storage_proof"
	TxTypeStorageProofVerification           = "storage_proof_verification"
	TxTypeRelease                            = "release"
)
View Source
const (
	BlockTopic = "block-subscriber"
	PlayTopic  = "play-subscriber"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockPubsub

type BlockPubsub = Pubsub[*db.EtlBlock]

type ChallengeStats

type ChallengeStats struct {
	ChallengesReceived int32
	ChallengesFailed   int32
}

ChallengeStats represents storage proof challenge statistics for a validator

type ETLService

type ETLService struct {
	ChainID string
	// contains filtered or unexported fields
}

func NewETLService

func NewETLService(core corev1connect.CoreServiceClient, logger *zap.Logger) *ETLService

func (*ETLService) GetBlockPubsub

func (e *ETLService) GetBlockPubsub() *BlockPubsub

GetBlockPubsub returns the block pubsub instance

func (*ETLService) GetBlocks

GetBlocks implements v1connect.ETLServiceHandler.

func (*ETLService) GetDB

func (e *ETLService) GetDB() *db.Queries

func (*ETLService) GetHealth

GetHealth implements v1connect.ETLServiceHandler.

func (*ETLService) GetLocation

GetLocation implements v1connect.ETLServiceHandler.

func (*ETLService) GetLocationDB

func (e *ETLService) GetLocationDB() *location.LocationService

GetLocationDB returns the location service instance

func (*ETLService) GetManageEntities

GetManageEntities implements v1connect.ETLServiceHandler.

func (*ETLService) GetPlayPubsub

func (e *ETLService) GetPlayPubsub() *PlayPubsub

GetPlayPubsub returns the play pubsub instance

func (*ETLService) GetPlays

GetPlays implements v1connect.ETLServiceHandler.

func (*ETLService) GetTransactions

GetTransactions implements v1connect.ETLServiceHandler.

func (*ETLService) GetValidators

GetValidators implements v1connect.ETLServiceHandler.

func (*ETLService) InitializeChainID

func (e *ETLService) InitializeChainID(ctx context.Context) error

InitializeChainID fetches and caches the chain ID from the core service

func (*ETLService) Ping

Ping implements v1connect.ETLServiceHandler.

func (*ETLService) Run

func (etl *ETLService) Run() error

func (*ETLService) SetCheckReadiness

func (e *ETLService) SetCheckReadiness(checkReadiness bool)

func (*ETLService) SetDBURL

func (e *ETLService) SetDBURL(dbURL string)

func (*ETLService) SetEndingBlockHeight

func (e *ETLService) SetEndingBlockHeight(endingBlockHeight int64)

func (*ETLService) SetRunDownMigrations

func (e *ETLService) SetRunDownMigrations(runDownMigrations bool)

func (*ETLService) SetStartingBlockHeight

func (e *ETLService) SetStartingBlockHeight(startingBlockHeight int64)

type MaterializedViewRefresher

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

MaterializedViewRefresher refreshes dashboard materialized views periodically

func NewMaterializedViewRefresher

func NewMaterializedViewRefresher(database db.DBTX, logger *zap.Logger) *MaterializedViewRefresher

NewMaterializedViewRefresher creates a new refresher service

func (*MaterializedViewRefresher) Start

Start begins the periodic refresh cycle (every 2 minutes) This method blocks and should be run in a goroutine (e.g., via errgroup)

func (*MaterializedViewRefresher) Stop

func (r *MaterializedViewRefresher) Stop()

Stop stops the refresher

type PlayPubsub

type PlayPubsub = Pubsub[*db.EtlPlay]

type Pubsub

type Pubsub[Message any] struct {
	// contains filtered or unexported fields
}

func NewPubsub

func NewPubsub[Message any]() *Pubsub[Message]

func (*Pubsub[Message]) HasSubscribers

func (ps *Pubsub[Message]) HasSubscribers(topic string) bool

HasSubscribers checks if there are any active subscribers for a topic

func (*Pubsub[Message]) Publish

func (ps *Pubsub[Message]) Publish(ctx context.Context, topic string, msg Message)

Publish sends a message to all subscribers of the specified topic

func (*Pubsub[Message]) Subscribe

func (ps *Pubsub[Message]) Subscribe(topic string, bufferSizes ...int) chan Message

Subscribe subscribes to a specific topic and returns a channel to receive messages.

func (*Pubsub[Message]) Unsubscribe

func (ps *Pubsub[Message]) Unsubscribe(topic string, ch chan Message)

Unsubscribe removes a subscriber from a topic and closes the channel.

type StorageProofEntry

type StorageProofEntry struct {
	Address         string
	ProverAddresses []string
	ProofSignature  []byte
	Cid             string
	SignatureValid  bool // determined during verification
}

type StorageProofState

type StorageProofState struct {
	Height          int64
	Proofs          map[string]*StorageProofEntry // address -> proof entry
	ProverAddresses map[string]int                // address -> vote count for who should be provers
	Resolved        bool
}

StorageProofState tracks storage proof challenges and their resolution

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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