Documentation
¶
Index ¶
- Constants
- Variables
- type BlockPubsub
- type ChallengeStats
- type Config
- type Indexer
- func (e *Indexer) GetBlockPubsub() *BlockPubsub
- func (e *Indexer) GetDB() *db.Queries
- func (e *Indexer) GetPlayPubsub() *PlayPubsub
- func (e *Indexer) InitializeChainID(ctx context.Context) error
- func (e *Indexer) Run() error
- func (e *Indexer) SetCheckReadiness(checkReadiness bool)
- func (e *Indexer) SetConfig(c Config)
- func (e *Indexer) SetDBURL(dbURL string)
- func (e *Indexer) SetEndingBlockHeight(endingBlockHeight int64)
- func (e *Indexer) SetRunDownMigrations(runDownMigrations bool)
- func (e *Indexer) SetSkipMigrations(skip bool)
- func (e *Indexer) SetStartingBlockHeight(startingBlockHeight int64)
- type MaterializedViewRefresher
- type PlayPubsub
- type Pubsub
- type ScheduledReleasePublisher
- type StorageProofEntry
- type StorageProofState
Constants ¶
const ( BlockTopic = "block-subscriber" PlayTopic = "play-subscriber" )
Variables ¶
var ( TxTypePlay = processors.TxTypePlay TxTypeManageEntity = processors.TxTypeManageEntity TxTypeValidatorRegistration = processors.TxTypeValidatorRegistration TxTypeValidatorDeregistration = processors.TxTypeValidatorDeregistration TxTypeValidatorRegistrationLegacy = processors.TxTypeValidatorRegistrationLegacy TxTypeSlaRollup = processors.TxTypeSlaRollup TxTypeValidatorMisbehaviorDereg = processors.TxTypeValidatorMisbehaviorDereg TxTypeStorageProof = processors.TxTypeStorageProof TxTypeStorageProofVerification = processors.TxTypeStorageProofVerification TxTypeRelease = processors.TxTypeRelease )
Functions ¶
This section is empty.
Types ¶
type BlockPubsub ¶
type ChallengeStats ¶
ChallengeStats represents storage proof challenge statistics for a validator
type Config ¶
type Config struct {
EnableMaterializedViewRefresh bool
EnablePgNotifyListener bool
EnableScheduledReleases bool
// DataTypes controls which entity types the entity manager will index.
// If nil (default), all entity types are enabled.
// If non-nil (even if empty), only listed types are enabled.
// Populated from OPENAUDIO_ETL_ENTITY_MANAGER_DATA_TYPES env var (comma-separated).
DataTypes *[]string
}
Config holds optional ETL component flags. All are enabled by default for full indexing behavior.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns config with all optional components enabled.
func (*Config) DisableMaterializedViewRefresh ¶
func (c *Config) DisableMaterializedViewRefresh()
DisableMaterializedViewRefresh disables the periodic MV refresh (for minimal indexing).
func (*Config) DisablePgNotifyListener ¶
func (c *Config) DisablePgNotifyListener()
DisablePgNotifyListener disables the PostgreSQL LISTEN-based pubsub (for minimal indexing).
func (*Config) DisableScheduledReleases ¶
func (c *Config) DisableScheduledReleases()
DisableScheduledReleases disables the periodic publish-scheduled-releases task.
func (*Config) IsDataTypeEnabled ¶
IsDataTypeEnabled returns true if the given entity type should be indexed.
func (*Config) ReadDataTypesEnv ¶
func (c *Config) ReadDataTypesEnv()
ReadDataTypesEnv reads OPENAUDIO_ETL_ENTITY_MANAGER_DATA_TYPES and sets DataTypes accordingly. If the env var is not set, DataTypes remains nil (all types enabled). If set to empty string, DataTypes is an empty slice (no entity types enabled). If set to a comma-separated list, only those types are enabled.
type Indexer ¶
type Indexer struct {
ChainID string
// contains filtered or unexported fields
}
Indexer extracts blockchain data from a Core RPC and indexes it into PostgreSQL.
func New ¶
func New(core corev1connect.CoreServiceClient, logger *zap.Logger) *Indexer
New creates a new ETL indexer.
func (*Indexer) GetBlockPubsub ¶
func (e *Indexer) GetBlockPubsub() *BlockPubsub
GetBlockPubsub returns the block pubsub instance.
func (*Indexer) GetPlayPubsub ¶
func (e *Indexer) GetPlayPubsub() *PlayPubsub
GetPlayPubsub returns the play pubsub instance.
func (*Indexer) InitializeChainID ¶
InitializeChainID fetches and caches the chain ID from the core service.
func (*Indexer) SetCheckReadiness ¶
func (*Indexer) SetEndingBlockHeight ¶
func (*Indexer) SetRunDownMigrations ¶
func (*Indexer) SetSkipMigrations ¶
func (*Indexer) SetStartingBlockHeight ¶
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 ¶
func (r *MaterializedViewRefresher) Start(ctx context.Context) error
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 Pubsub ¶
type Pubsub[Message any] struct { // contains filtered or unexported fields }
func (*Pubsub[Message]) HasSubscribers ¶
HasSubscribers checks if there are any active subscribers for a topic
func (*Pubsub[Message]) Subscribe ¶
Subscribe subscribes to a specific topic and returns a channel to receive messages.
func (*Pubsub[Message]) Unsubscribe ¶
Unsubscribe removes a subscriber from a topic and closes the channel.
type ScheduledReleasePublisher ¶
type ScheduledReleasePublisher struct {
// contains filtered or unexported fields
}
ScheduledReleasePublisher periodically publishes scheduled tracks and albums whose release_date has passed.
- tracks: is_unlisted=true → false when is_scheduled_release and release_date < now().
- playlists: is_private=true → false when is_album AND is_scheduled_release AND release_date < now(). Non-album playlists are not auto-published.
func NewScheduledReleasePublisher ¶
func NewScheduledReleasePublisher(database db.DBTX, logger *zap.Logger) *ScheduledReleasePublisher
NewScheduledReleasePublisher creates a publisher that runs every minute.
func (*ScheduledReleasePublisher) Start ¶
func (p *ScheduledReleasePublisher) Start(ctx context.Context) error
Start runs the publish loop. Blocks; intended to run in a goroutine.
func (*ScheduledReleasePublisher) Stop ¶
func (p *ScheduledReleasePublisher) Stop()
Stop signals the loop to exit.
type StorageProofEntry ¶
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
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Parity compare tool: field-by-field comparison of Go ETL output against production data.
|
Parity compare tool: field-by-field comparison of Go ETL output against production data. |