db

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: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunMigrations

func RunMigrations(logger *zap.Logger, pgConnectionString string, downFirst bool) error

Types

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type DeregisterValidatorParams

type DeregisterValidatorParams struct {
	DeregisteredAt pgtype.Int8      `json:"deregistered_at"`
	UpdatedAt      pgtype.Timestamp `json:"updated_at"`
	Status         string           `json:"status"`
	CometAddress   string           `json:"comet_address"`
}

type EtlAddress

type EtlAddress struct {
	ID                   int32            `json:"id"`
	Address              string           `json:"address"`
	PubKey               []byte           `json:"pub_key"`
	FirstSeenBlockHeight pgtype.Int8      `json:"first_seen_block_height"`
	CreatedAt            pgtype.Timestamp `json:"created_at"`
}

type EtlBlock

type EtlBlock struct {
	ID              int32            `json:"id"`
	ProposerAddress string           `json:"proposer_address"`
	BlockHeight     int64            `json:"block_height"`
	BlockTime       pgtype.Timestamp `json:"block_time"`
}

type EtlManageEntity

type EtlManageEntity struct {
	ID          int32            `json:"id"`
	Address     string           `json:"address"`
	EntityType  string           `json:"entity_type"`
	EntityID    int64            `json:"entity_id"`
	Action      string           `json:"action"`
	Metadata    pgtype.Text      `json:"metadata"`
	Signature   string           `json:"signature"`
	Signer      string           `json:"signer"`
	Nonce       string           `json:"nonce"`
	BlockHeight int64            `json:"block_height"`
	TxHash      string           `json:"tx_hash"`
	CreatedAt   pgtype.Timestamp `json:"created_at"`
}

type EtlPlay

type EtlPlay struct {
	ID          int32            `json:"id"`
	UserID      string           `json:"user_id"`
	TrackID     string           `json:"track_id"`
	City        string           `json:"city"`
	Region      string           `json:"region"`
	Country     string           `json:"country"`
	PlayedAt    pgtype.Timestamp `json:"played_at"`
	BlockHeight int64            `json:"block_height"`
	TxHash      string           `json:"tx_hash"`
	ListenedAt  pgtype.Timestamp `json:"listened_at"`
	RecordedAt  pgtype.Timestamp `json:"recorded_at"`
}

type EtlProofStatus

type EtlProofStatus string
const (
	EtlProofStatusUnresolved EtlProofStatus = "unresolved"
	EtlProofStatusPass       EtlProofStatus = "pass"
	EtlProofStatusFail       EtlProofStatus = "fail"
)

func (*EtlProofStatus) Scan

func (e *EtlProofStatus) Scan(src interface{}) error

type EtlSlaNodeReport

type EtlSlaNodeReport struct {
	ID                 int32            `json:"id"`
	SlaRollupID        int32            `json:"sla_rollup_id"`
	Address            string           `json:"address"`
	NumBlocksProposed  int32            `json:"num_blocks_proposed"`
	ChallengesReceived int32            `json:"challenges_received"`
	ChallengesFailed   int32            `json:"challenges_failed"`
	BlockHeight        int64            `json:"block_height"`
	TxHash             string           `json:"tx_hash"`
	CreatedAt          pgtype.Timestamp `json:"created_at"`
}

type EtlSlaRollup

type EtlSlaRollup struct {
	ID             int32            `json:"id"`
	BlockStart     int64            `json:"block_start"`
	BlockEnd       int64            `json:"block_end"`
	BlockHeight    int64            `json:"block_height"`
	ValidatorCount int32            `json:"validator_count"`
	BlockQuota     int32            `json:"block_quota"`
	Bps            float64          `json:"bps"`
	Tps            float64          `json:"tps"`
	TxHash         string           `json:"tx_hash"`
	CreatedAt      pgtype.Timestamp `json:"created_at"`
}

type EtlStorageProof

type EtlStorageProof struct {
	ID              int32            `json:"id"`
	Height          int64            `json:"height"`
	Address         string           `json:"address"`
	ProverAddresses []string         `json:"prover_addresses"`
	Cid             string           `json:"cid"`
	ProofSignature  []byte           `json:"proof_signature"`
	Proof           []byte           `json:"proof"`
	Status          EtlProofStatus   `json:"status"`
	BlockHeight     int64            `json:"block_height"`
	TxHash          string           `json:"tx_hash"`
	CreatedAt       pgtype.Timestamp `json:"created_at"`
}

type EtlStorageProofVerification

type EtlStorageProofVerification struct {
	ID          int32            `json:"id"`
	Height      int64            `json:"height"`
	Proof       []byte           `json:"proof"`
	BlockHeight int64            `json:"block_height"`
	TxHash      string           `json:"tx_hash"`
	CreatedAt   pgtype.Timestamp `json:"created_at"`
}

type EtlTransaction

type EtlTransaction struct {
	ID          int32            `json:"id"`
	TxHash      string           `json:"tx_hash"`
	BlockHeight int64            `json:"block_height"`
	TxIndex     int32            `json:"tx_index"`
	TxType      string           `json:"tx_type"`
	Address     pgtype.Text      `json:"address"`
	CreatedAt   pgtype.Timestamp `json:"created_at"`
}

type EtlValidator

type EtlValidator struct {
	ID             int32            `json:"id"`
	Address        string           `json:"address"`
	Endpoint       string           `json:"endpoint"`
	CometAddress   string           `json:"comet_address"`
	NodeType       string           `json:"node_type"`
	Spid           string           `json:"spid"`
	VotingPower    int64            `json:"voting_power"`
	Status         string           `json:"status"`
	RegisteredAt   int64            `json:"registered_at"`
	DeregisteredAt pgtype.Int8      `json:"deregistered_at"`
	CreatedAt      pgtype.Timestamp `json:"created_at"`
	UpdatedAt      pgtype.Timestamp `json:"updated_at"`
}

type EtlValidatorDeregistration

type EtlValidatorDeregistration struct {
	ID           int32  `json:"id"`
	CometAddress string `json:"comet_address"`
	CometPubkey  []byte `json:"comet_pubkey"`
	BlockHeight  int64  `json:"block_height"`
	TxHash       string `json:"tx_hash"`
}

type EtlValidatorMisbehaviorDeregistration

type EtlValidatorMisbehaviorDeregistration struct {
	ID           int32            `json:"id"`
	CometAddress string           `json:"comet_address"`
	PubKey       []byte           `json:"pub_key"`
	BlockHeight  int64            `json:"block_height"`
	TxHash       string           `json:"tx_hash"`
	CreatedAt    pgtype.Timestamp `json:"created_at"`
}

type EtlValidatorRegistration

type EtlValidatorRegistration struct {
	ID           int32  `json:"id"`
	Address      string `json:"address"`
	Endpoint     string `json:"endpoint"`
	CometAddress string `json:"comet_address"`
	EthBlock     string `json:"eth_block"`
	NodeType     string `json:"node_type"`
	Spid         string `json:"spid"`
	CometPubkey  []byte `json:"comet_pubkey"`
	VotingPower  int64  `json:"voting_power"`
	BlockHeight  int64  `json:"block_height"`
	TxHash       string `json:"tx_hash"`
}

type GetActiveValidatorsParams

type GetActiveValidatorsParams struct {
	Limit  int32 `json:"limit"`
	Offset int32 `json:"offset"`
}

type GetAllActiveValidatorsWithRecentRollupsRow

type GetAllActiveValidatorsWithRecentRollupsRow struct {
	ID                 int32            `json:"id"`
	Address            string           `json:"address"`
	Endpoint           string           `json:"endpoint"`
	CometAddress       string           `json:"comet_address"`
	NodeType           string           `json:"node_type"`
	Spid               string           `json:"spid"`
	VotingPower        int64            `json:"voting_power"`
	Status             string           `json:"status"`
	RegisteredAt       int64            `json:"registered_at"`
	DeregisteredAt     pgtype.Int8      `json:"deregistered_at"`
	CreatedAt          pgtype.Timestamp `json:"created_at"`
	UpdatedAt          pgtype.Timestamp `json:"updated_at"`
	SlaRollupID        pgtype.Int4      `json:"sla_rollup_id"`
	NumBlocksProposed  pgtype.Int4      `json:"num_blocks_proposed"`
	ChallengesReceived pgtype.Int4      `json:"challenges_received"`
	ChallengesFailed   pgtype.Int4      `json:"challenges_failed"`
	ReportBlockHeight  pgtype.Int8      `json:"report_block_height"`
	ReportCreatedAt    pgtype.Timestamp `json:"report_created_at"`
}

type GetBlockRangeFirstParams

type GetBlockRangeFirstParams struct {
	BlockTime   pgtype.Timestamp `json:"block_time"`
	BlockTime_2 pgtype.Timestamp `json:"block_time_2"`
}

type GetBlockRangeLastParams

type GetBlockRangeLastParams struct {
	BlockTime   pgtype.Timestamp `json:"block_time"`
	BlockTime_2 pgtype.Timestamp `json:"block_time_2"`
}

type GetBlocksByPageParams

type GetBlocksByPageParams struct {
	Limit  int32 `json:"limit"`
	Offset int32 `json:"offset"`
}

type GetChallengeStatisticsForBlockRangeParams

type GetChallengeStatisticsForBlockRangeParams struct {
	Height   int64 `json:"height"`
	Height_2 int64 `json:"height_2"`
}

type GetChallengeStatisticsForBlockRangeRow

type GetChallengeStatisticsForBlockRangeRow struct {
	Address            string `json:"address"`
	ChallengesReceived int64  `json:"challenges_received"`
	ChallengesFailed   int64  `json:"challenges_failed"`
}

type GetHealthyValidatorCountsForRollupsRow

type GetHealthyValidatorCountsForRollupsRow struct {
	RollupID          int32       `json:"rollup_id"`
	HealthyValidators interface{} `json:"healthy_validators"`
}

type GetManageEntitiesByBlockHeightCursorParams

type GetManageEntitiesByBlockHeightCursorParams struct {
	BlockHeight int64 `json:"block_height"`
	ID          int32 `json:"id"`
	Limit       int32 `json:"limit"`
}

type GetPlaysByBlockHeightCursorParams

type GetPlaysByBlockHeightCursorParams struct {
	BlockHeight int64 `json:"block_height"`
	ID          int32 `json:"id"`
	Limit       int32 `json:"limit"`
}

type GetSlaNodeReportsByAddressParams

type GetSlaNodeReportsByAddressParams struct {
	Lower string `json:"lower"`
	Limit int32  `json:"limit"`
}

type GetSlaNodeReportsByBlockHeightCursorParams

type GetSlaNodeReportsByBlockHeightCursorParams struct {
	BlockHeight int64 `json:"block_height"`
	ID          int32 `json:"id"`
	Limit       int32 `json:"limit"`
}

type GetSlaRollupsByBlockHeightCursorParams

type GetSlaRollupsByBlockHeightCursorParams struct {
	BlockHeight int64 `json:"block_height"`
	ID          int32 `json:"id"`
	Limit       int32 `json:"limit"`
}

type GetSlaRollupsWithPaginationParams

type GetSlaRollupsWithPaginationParams struct {
	Limit  int32 `json:"limit"`
	Offset int32 `json:"offset"`
}

type GetStorageProofVerificationsByBlockHeightCursorParams

type GetStorageProofVerificationsByBlockHeightCursorParams struct {
	BlockHeight int64 `json:"block_height"`
	ID          int32 `json:"id"`
	Limit       int32 `json:"limit"`
}

type GetStorageProofsByBlockHeightCursorParams

type GetStorageProofsByBlockHeightCursorParams struct {
	BlockHeight int64 `json:"block_height"`
	ID          int32 `json:"id"`
	Limit       int32 `json:"limit"`
}

type GetTransactionCountByAddressParams

type GetTransactionCountByAddressParams struct {
	Lower   string           `json:"lower"`
	Column2 interface{}      `json:"column_2"`
	Column3 pgtype.Timestamp `json:"column_3"`
	Column4 pgtype.Timestamp `json:"column_4"`
}

type GetTransactionsByAddressParams

type GetTransactionsByAddressParams struct {
	Lower   string           `json:"lower"`
	Column2 interface{}      `json:"column_2"`
	Column3 pgtype.Timestamp `json:"column_3"`
	Column4 pgtype.Timestamp `json:"column_4"`
	Limit   int32            `json:"limit"`
	Offset  int32            `json:"offset"`
}

type GetTransactionsByAddressRow

type GetTransactionsByAddressRow struct {
	ID          int32            `json:"id"`
	TxHash      string           `json:"tx_hash"`
	BlockHeight int64            `json:"block_height"`
	TxIndex     int32            `json:"tx_index"`
	TxType      string           `json:"tx_type"`
	Address     pgtype.Text      `json:"address"`
	CreatedAt   pgtype.Timestamp `json:"created_at"`
	Relation    interface{}      `json:"relation"`
}

type GetTransactionsByBlockHeightCursorParams

type GetTransactionsByBlockHeightCursorParams struct {
	BlockHeight int64 `json:"block_height"`
	ID          int32 `json:"id"`
	Limit       int32 `json:"limit"`
}

type GetTransactionsByPageParams

type GetTransactionsByPageParams struct {
	Limit  int32 `json:"limit"`
	Offset int32 `json:"offset"`
}

type GetValidatorDeregistrationsByBlockHeightCursorParams

type GetValidatorDeregistrationsByBlockHeightCursorParams struct {
	BlockHeight int64 `json:"block_height"`
	ID          int32 `json:"id"`
	Limit       int32 `json:"limit"`
}

type GetValidatorDeregistrationsParams

type GetValidatorDeregistrationsParams struct {
	Limit  int32 `json:"limit"`
	Offset int32 `json:"offset"`
}

type GetValidatorDeregistrationsRow

type GetValidatorDeregistrationsRow struct {
	ID           int32       `json:"id"`
	CometAddress string      `json:"comet_address"`
	CometPubkey  []byte      `json:"comet_pubkey"`
	BlockHeight  int64       `json:"block_height"`
	TxHash       string      `json:"tx_hash"`
	Endpoint     pgtype.Text `json:"endpoint"`
	NodeType     pgtype.Text `json:"node_type"`
	Spid         pgtype.Text `json:"spid"`
	VotingPower  pgtype.Int8 `json:"voting_power"`
	Status       pgtype.Text `json:"status"`
}

type GetValidatorMisbehaviorDeregistrationsByBlockHeightCursorParams

type GetValidatorMisbehaviorDeregistrationsByBlockHeightCursorParams struct {
	BlockHeight int64 `json:"block_height"`
	ID          int32 `json:"id"`
	Limit       int32 `json:"limit"`
}

type GetValidatorRegistrationsByBlockHeightCursorParams

type GetValidatorRegistrationsByBlockHeightCursorParams struct {
	BlockHeight int64 `json:"block_height"`
	ID          int32 `json:"id"`
	Limit       int32 `json:"limit"`
}

type GetValidatorRegistrationsParams

type GetValidatorRegistrationsParams struct {
	Limit  int32 `json:"limit"`
	Offset int32 `json:"offset"`
}

type GetValidatorRegistrationsRow

type GetValidatorRegistrationsRow struct {
	ID            int32       `json:"id"`
	Address       string      `json:"address"`
	Endpoint      string      `json:"endpoint"`
	CometAddress  string      `json:"comet_address"`
	EthBlock      string      `json:"eth_block"`
	NodeType      string      `json:"node_type"`
	Spid          string      `json:"spid"`
	CometPubkey   []byte      `json:"comet_pubkey"`
	VotingPower   int64       `json:"voting_power"`
	BlockHeight   int64       `json:"block_height"`
	TxHash        string      `json:"tx_hash"`
	Endpoint_2    pgtype.Text `json:"endpoint_2"`
	NodeType_2    pgtype.Text `json:"node_type_2"`
	Spid_2        pgtype.Text `json:"spid_2"`
	VotingPower_2 pgtype.Int8 `json:"voting_power_2"`
	Status        pgtype.Text `json:"status"`
}

type GetValidatorsForSlaRollupRow

type GetValidatorsForSlaRollupRow struct {
	ID                 int32            `json:"id"`
	Address            string           `json:"address"`
	Endpoint           string           `json:"endpoint"`
	CometAddress       string           `json:"comet_address"`
	NodeType           string           `json:"node_type"`
	Spid               string           `json:"spid"`
	VotingPower        int64            `json:"voting_power"`
	Status             string           `json:"status"`
	RegisteredAt       int64            `json:"registered_at"`
	DeregisteredAt     pgtype.Int8      `json:"deregistered_at"`
	CreatedAt          pgtype.Timestamp `json:"created_at"`
	UpdatedAt          pgtype.Timestamp `json:"updated_at"`
	NumBlocksProposed  pgtype.Int4      `json:"num_blocks_proposed"`
	ChallengesReceived pgtype.Int4      `json:"challenges_received"`
	ChallengesFailed   pgtype.Int4      `json:"challenges_failed"`
}

type InsertAddressParams

type InsertAddressParams struct {
	Address              string           `json:"address"`
	PubKey               []byte           `json:"pub_key"`
	FirstSeenBlockHeight pgtype.Int8      `json:"first_seen_block_height"`
	CreatedAt            pgtype.Timestamp `json:"created_at"`
}

type InsertBlockParams

type InsertBlockParams struct {
	ProposerAddress string           `json:"proposer_address"`
	BlockHeight     int64            `json:"block_height"`
	BlockTime       pgtype.Timestamp `json:"block_time"`
}

type InsertFailedStorageProofParams

type InsertFailedStorageProofParams struct {
	Height      int64            `json:"height"`
	Address     string           `json:"address"`
	BlockHeight int64            `json:"block_height"`
	TxHash      string           `json:"tx_hash"`
	CreatedAt   pgtype.Timestamp `json:"created_at"`
}

type InsertManageEntityParams

type InsertManageEntityParams struct {
	Address     string           `json:"address"`
	EntityType  string           `json:"entity_type"`
	EntityID    int64            `json:"entity_id"`
	Action      string           `json:"action"`
	Metadata    pgtype.Text      `json:"metadata"`
	Signature   string           `json:"signature"`
	Signer      string           `json:"signer"`
	Nonce       string           `json:"nonce"`
	BlockHeight int64            `json:"block_height"`
	TxHash      string           `json:"tx_hash"`
	CreatedAt   pgtype.Timestamp `json:"created_at"`
}

type InsertPlayParams

type InsertPlayParams struct {
	UserID      string           `json:"user_id"`
	TrackID     string           `json:"track_id"`
	City        string           `json:"city"`
	Region      string           `json:"region"`
	Country     string           `json:"country"`
	PlayedAt    pgtype.Timestamp `json:"played_at"`
	BlockHeight int64            `json:"block_height"`
	TxHash      string           `json:"tx_hash"`
	ListenedAt  pgtype.Timestamp `json:"listened_at"`
	RecordedAt  pgtype.Timestamp `json:"recorded_at"`
}

type InsertPlaysParams

type InsertPlaysParams struct {
	Column1  []string           `json:"column_1"`
	Column2  []string           `json:"column_2"`
	Column3  []string           `json:"column_3"`
	Column4  []string           `json:"column_4"`
	Column5  []string           `json:"column_5"`
	Column6  []pgtype.Timestamp `json:"column_6"`
	Column7  []int64            `json:"column_7"`
	Column8  []string           `json:"column_8"`
	Column9  []pgtype.Timestamp `json:"column_9"`
	Column10 []pgtype.Timestamp `json:"column_10"`
}

type InsertSlaNodeReportParams

type InsertSlaNodeReportParams struct {
	SlaRollupID        int32            `json:"sla_rollup_id"`
	Address            string           `json:"address"`
	NumBlocksProposed  int32            `json:"num_blocks_proposed"`
	ChallengesReceived int32            `json:"challenges_received"`
	ChallengesFailed   int32            `json:"challenges_failed"`
	BlockHeight        int64            `json:"block_height"`
	TxHash             string           `json:"tx_hash"`
	CreatedAt          pgtype.Timestamp `json:"created_at"`
}

type InsertSlaRollupParams

type InsertSlaRollupParams struct {
	BlockStart     int64            `json:"block_start"`
	BlockEnd       int64            `json:"block_end"`
	BlockHeight    int64            `json:"block_height"`
	ValidatorCount int32            `json:"validator_count"`
	BlockQuota     int32            `json:"block_quota"`
	Bps            float64          `json:"bps"`
	Tps            float64          `json:"tps"`
	TxHash         string           `json:"tx_hash"`
	CreatedAt      pgtype.Timestamp `json:"created_at"`
}

type InsertSlaRollupReturningIdParams

type InsertSlaRollupReturningIdParams struct {
	BlockStart     int64            `json:"block_start"`
	BlockEnd       int64            `json:"block_end"`
	BlockHeight    int64            `json:"block_height"`
	ValidatorCount int32            `json:"validator_count"`
	BlockQuota     int32            `json:"block_quota"`
	Bps            float64          `json:"bps"`
	Tps            float64          `json:"tps"`
	TxHash         string           `json:"tx_hash"`
	CreatedAt      pgtype.Timestamp `json:"created_at"`
}

type InsertStorageProofParams

type InsertStorageProofParams struct {
	Height          int64            `json:"height"`
	Address         string           `json:"address"`
	ProverAddresses []string         `json:"prover_addresses"`
	Cid             string           `json:"cid"`
	ProofSignature  []byte           `json:"proof_signature"`
	Proof           []byte           `json:"proof"`
	Status          EtlProofStatus   `json:"status"`
	BlockHeight     int64            `json:"block_height"`
	TxHash          string           `json:"tx_hash"`
	CreatedAt       pgtype.Timestamp `json:"created_at"`
}

type InsertStorageProofVerificationParams

type InsertStorageProofVerificationParams struct {
	Height      int64            `json:"height"`
	Proof       []byte           `json:"proof"`
	BlockHeight int64            `json:"block_height"`
	TxHash      string           `json:"tx_hash"`
	CreatedAt   pgtype.Timestamp `json:"created_at"`
}

type InsertTransactionParams

type InsertTransactionParams struct {
	TxHash      string           `json:"tx_hash"`
	BlockHeight int64            `json:"block_height"`
	TxIndex     int32            `json:"tx_index"`
	TxType      string           `json:"tx_type"`
	Address     pgtype.Text      `json:"address"`
	CreatedAt   pgtype.Timestamp `json:"created_at"`
}

type InsertValidatorDeregistrationParams

type InsertValidatorDeregistrationParams struct {
	CometAddress string `json:"comet_address"`
	CometPubkey  []byte `json:"comet_pubkey"`
	BlockHeight  int64  `json:"block_height"`
	TxHash       string `json:"tx_hash"`
}

type InsertValidatorMisbehaviorDeregistrationParams

type InsertValidatorMisbehaviorDeregistrationParams struct {
	CometAddress string           `json:"comet_address"`
	PubKey       []byte           `json:"pub_key"`
	BlockHeight  int64            `json:"block_height"`
	TxHash       string           `json:"tx_hash"`
	CreatedAt    pgtype.Timestamp `json:"created_at"`
}

type InsertValidatorRegistrationParams

type InsertValidatorRegistrationParams struct {
	Address      string `json:"address"`
	Endpoint     string `json:"endpoint"`
	CometAddress string `json:"comet_address"`
	EthBlock     string `json:"eth_block"`
	NodeType     string `json:"node_type"`
	Spid         string `json:"spid"`
	CometPubkey  []byte `json:"comet_pubkey"`
	VotingPower  int64  `json:"voting_power"`
	BlockHeight  int64  `json:"block_height"`
	TxHash       string `json:"tx_hash"`
}

type MaterializedViewManager

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

MaterializedViewManager handles refreshing materialized views for optimal performance

func NewMaterializedViewManager

func NewMaterializedViewManager(db *pgxpool.Pool, logger *slog.Logger) *MaterializedViewManager

NewMaterializedViewManager creates a new manager for materialized views

func (*MaterializedViewManager) ForceRefreshIfStale

func (m *MaterializedViewManager) ForceRefreshIfStale(ctx context.Context, maxAge time.Duration) error

ForceRefreshIfStale refreshes views if they haven't been refreshed recently

func (*MaterializedViewManager) GetViewRefreshStatus

func (m *MaterializedViewManager) GetViewRefreshStatus(ctx context.Context) (map[string]time.Time, error)

GetViewRefreshStatus returns information about when views were last refreshed

func (*MaterializedViewManager) HealthCheck

func (m *MaterializedViewManager) HealthCheck(ctx context.Context) error

Health check for materialized views - useful for monitoring

func (*MaterializedViewManager) RefreshSlaRollupViews

func (m *MaterializedViewManager) RefreshSlaRollupViews(ctx context.Context) error

RefreshSlaRollupViews refreshes all SLA rollup related materialized views

func (*MaterializedViewManager) StartPeriodicRefresh

func (m *MaterializedViewManager) StartPeriodicRefresh(ctx context.Context, interval time.Duration)

StartPeriodicRefresh starts a background goroutine that refreshes materialized views periodically

type MvDashboardTransactionStat

type MvDashboardTransactionStat struct {
	Transactions24h         int64 `json:"transactions_24h"`
	TransactionsPrevious24h int64 `json:"transactions_previous_24h"`
	Transactions7d          int64 `json:"transactions_7d"`
	Transactions30d         int64 `json:"transactions_30d"`
	TotalTransactions       int64 `json:"total_transactions"`
}

type MvDashboardTransactionType

type MvDashboardTransactionType struct {
	TxType           string `json:"tx_type"`
	TransactionCount int64  `json:"transaction_count"`
}

type NullEtlProofStatus

type NullEtlProofStatus struct {
	EtlProofStatus EtlProofStatus `json:"etl_proof_status"`
	Valid          bool           `json:"valid"` // Valid is true if EtlProofStatus is not NULL
}

func (*NullEtlProofStatus) Scan

func (ns *NullEtlProofStatus) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullEtlProofStatus) Value

func (ns NullEtlProofStatus) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) DeregisterValidator

func (q *Queries) DeregisterValidator(ctx context.Context, arg DeregisterValidatorParams) error

func (*Queries) GetActiveValidatorCount

func (q *Queries) GetActiveValidatorCount(ctx context.Context) (int64, error)

func (*Queries) GetActiveValidators

func (q *Queries) GetActiveValidators(ctx context.Context, arg GetActiveValidatorsParams) ([]EtlValidator, error)

func (*Queries) GetAllActiveValidatorsWithRecentRollups

func (q *Queries) GetAllActiveValidatorsWithRecentRollups(ctx context.Context) ([]GetAllActiveValidatorsWithRecentRollupsRow, error)

func (*Queries) GetBlockByHeight

func (q *Queries) GetBlockByHeight(ctx context.Context, blockHeight int64) (EtlBlock, error)

func (*Queries) GetBlockRangeFirst

func (q *Queries) GetBlockRangeFirst(ctx context.Context, arg GetBlockRangeFirstParams) (EtlBlock, error)

func (*Queries) GetBlockRangeLast

func (q *Queries) GetBlockRangeLast(ctx context.Context, arg GetBlockRangeLastParams) (EtlBlock, error)

func (*Queries) GetBlockTransactionCount

func (q *Queries) GetBlockTransactionCount(ctx context.Context, blockHeight int64) (int64, error)

func (*Queries) GetBlocksByPage

func (q *Queries) GetBlocksByPage(ctx context.Context, arg GetBlocksByPageParams) ([]EtlBlock, error)

func (*Queries) GetDashboardTransactionStats

func (q *Queries) GetDashboardTransactionStats(ctx context.Context) (MvDashboardTransactionStat, error)

Dashboard materialized view queries

func (*Queries) GetDashboardTransactionTypes

func (q *Queries) GetDashboardTransactionTypes(ctx context.Context) ([]MvDashboardTransactionType, error)

func (*Queries) GetHealthyValidatorCountsForRollups

func (q *Queries) GetHealthyValidatorCountsForRollups(ctx context.Context, dollar_1 []int32) ([]GetHealthyValidatorCountsForRollupsRow, error)

func (*Queries) GetLatestIndexedBlock

func (q *Queries) GetLatestIndexedBlock(ctx context.Context) (int64, error)

get latest indexed block height

func (*Queries) GetLatestSlaRollup

func (q *Queries) GetLatestSlaRollup(ctx context.Context) (EtlSlaRollup, error)

func (*Queries) GetManageEntitiesByBlockHeightCursor

func (q *Queries) GetManageEntitiesByBlockHeightCursor(ctx context.Context, arg GetManageEntitiesByBlockHeightCursorParams) ([]EtlManageEntity, error)

func (*Queries) GetManageEntityByTxHash

func (q *Queries) GetManageEntityByTxHash(ctx context.Context, txHash string) (EtlManageEntity, error)

func (*Queries) GetPlaysByBlockHeightCursor

func (q *Queries) GetPlaysByBlockHeightCursor(ctx context.Context, arg GetPlaysByBlockHeightCursorParams) ([]EtlPlay, error)

func (*Queries) GetPlaysByTxHash

func (q *Queries) GetPlaysByTxHash(ctx context.Context, txHash string) ([]EtlPlay, error)

Transaction content queries by hash

func (*Queries) GetRelationTypesByAddress

func (q *Queries) GetRelationTypesByAddress(ctx context.Context, lower string) ([]interface{}, error)

func (*Queries) GetSlaNodeReportsByAddress

func (q *Queries) GetSlaNodeReportsByAddress(ctx context.Context, arg GetSlaNodeReportsByAddressParams) ([]EtlSlaNodeReport, error)

func (*Queries) GetSlaNodeReportsByBlockHeightCursor

func (q *Queries) GetSlaNodeReportsByBlockHeightCursor(ctx context.Context, arg GetSlaNodeReportsByBlockHeightCursorParams) ([]EtlSlaNodeReport, error)

func (*Queries) GetSlaRollupById

func (q *Queries) GetSlaRollupById(ctx context.Context, id int32) (EtlSlaRollup, error)

func (*Queries) GetSlaRollupByTxHash

func (q *Queries) GetSlaRollupByTxHash(ctx context.Context, txHash string) (EtlSlaRollup, error)

func (*Queries) GetSlaRollupsByBlockHeightCursor

func (q *Queries) GetSlaRollupsByBlockHeightCursor(ctx context.Context, arg GetSlaRollupsByBlockHeightCursorParams) ([]EtlSlaRollup, error)

func (*Queries) GetSlaRollupsWithPagination

func (q *Queries) GetSlaRollupsWithPagination(ctx context.Context, arg GetSlaRollupsWithPaginationParams) ([]EtlSlaRollup, error)

func (*Queries) GetStorageProofByTxHash

func (q *Queries) GetStorageProofByTxHash(ctx context.Context, txHash string) (EtlStorageProof, error)

func (*Queries) GetStorageProofVerificationByTxHash

func (q *Queries) GetStorageProofVerificationByTxHash(ctx context.Context, txHash string) (EtlStorageProofVerification, error)

func (*Queries) GetStorageProofsByBlockHeightCursor

func (q *Queries) GetStorageProofsByBlockHeightCursor(ctx context.Context, arg GetStorageProofsByBlockHeightCursorParams) ([]EtlStorageProof, error)

func (*Queries) GetStorageProofsForHeight

func (q *Queries) GetStorageProofsForHeight(ctx context.Context, height int64) ([]EtlStorageProof, error)

Storage proof consensus queries

func (*Queries) GetTotalTransactions

func (q *Queries) GetTotalTransactions(ctx context.Context) (int32, error)

func (*Queries) GetTransactionByHash

func (q *Queries) GetTransactionByHash(ctx context.Context, txHash string) (EtlTransaction, error)

func (*Queries) GetTransactionCountByAddress

func (q *Queries) GetTransactionCountByAddress(ctx context.Context, arg GetTransactionCountByAddressParams) (int64, error)

func (*Queries) GetTransactionsByAddress

func (q *Queries) GetTransactionsByAddress(ctx context.Context, arg GetTransactionsByAddressParams) ([]GetTransactionsByAddressRow, error)

Account transaction queries

func (*Queries) GetTransactionsByBlockHeightCursor

func (q *Queries) GetTransactionsByBlockHeightCursor(ctx context.Context, arg GetTransactionsByBlockHeightCursorParams) ([]EtlTransaction, error)

func (*Queries) GetTransactionsByPage

func (q *Queries) GetTransactionsByPage(ctx context.Context, arg GetTransactionsByPageParams) ([]EtlTransaction, error)

func (*Queries) GetValidatorByAddress

func (q *Queries) GetValidatorByAddress(ctx context.Context, lower string) (EtlValidator, error)

func (*Queries) GetValidatorDeregistrationByTxHash

func (q *Queries) GetValidatorDeregistrationByTxHash(ctx context.Context, txHash string) (EtlValidatorDeregistration, error)

func (*Queries) GetValidatorRegistrationByTxHash

func (q *Queries) GetValidatorRegistrationByTxHash(ctx context.Context, txHash string) (EtlValidatorRegistration, error)

func (*Queries) GetValidatorRegistrations

func (q *Queries) GetValidatorRegistrations(ctx context.Context, arg GetValidatorRegistrationsParams) ([]GetValidatorRegistrationsRow, error)

func (*Queries) GetValidatorsForSlaRollup

func (q *Queries) GetValidatorsForSlaRollup(ctx context.Context, slaRollupID int32) ([]GetValidatorsForSlaRollupRow, error)

func (*Queries) InsertAddress

func (q *Queries) InsertAddress(ctx context.Context, arg InsertAddressParams) error

func (*Queries) InsertBlock

func (q *Queries) InsertBlock(ctx context.Context, arg InsertBlockParams) error

func (*Queries) InsertFailedStorageProof

func (q *Queries) InsertFailedStorageProof(ctx context.Context, arg InsertFailedStorageProofParams) error

func (*Queries) InsertManageEntity

func (q *Queries) InsertManageEntity(ctx context.Context, arg InsertManageEntityParams) error

func (*Queries) InsertPlay

func (q *Queries) InsertPlay(ctx context.Context, arg InsertPlayParams) error

func (*Queries) InsertPlays

func (q *Queries) InsertPlays(ctx context.Context, arg InsertPlaysParams) error

func (*Queries) InsertSlaNodeReport

func (q *Queries) InsertSlaNodeReport(ctx context.Context, arg InsertSlaNodeReportParams) error

func (*Queries) InsertSlaRollup

func (q *Queries) InsertSlaRollup(ctx context.Context, arg InsertSlaRollupParams) error

func (*Queries) InsertSlaRollupReturningId

func (q *Queries) InsertSlaRollupReturningId(ctx context.Context, arg InsertSlaRollupReturningIdParams) (int32, error)

func (*Queries) InsertStorageProof

func (q *Queries) InsertStorageProof(ctx context.Context, arg InsertStorageProofParams) error

func (*Queries) InsertStorageProofVerification

func (q *Queries) InsertStorageProofVerification(ctx context.Context, arg InsertStorageProofVerificationParams) error

func (*Queries) InsertTransaction

func (q *Queries) InsertTransaction(ctx context.Context, arg InsertTransactionParams) error

func (*Queries) InsertValidatorDeregistration

func (q *Queries) InsertValidatorDeregistration(ctx context.Context, arg InsertValidatorDeregistrationParams) error

func (*Queries) InsertValidatorMisbehaviorDeregistration

func (q *Queries) InsertValidatorMisbehaviorDeregistration(ctx context.Context, arg InsertValidatorMisbehaviorDeregistrationParams) error

func (*Queries) InsertValidatorRegistration

func (q *Queries) InsertValidatorRegistration(ctx context.Context, arg InsertValidatorRegistrationParams) error

func (*Queries) RegisterValidator

func (q *Queries) RegisterValidator(ctx context.Context, arg RegisterValidatorParams) error

func (*Queries) UpdateStorageProofStatus

func (q *Queries) UpdateStorageProofStatus(ctx context.Context, arg UpdateStorageProofStatusParams) error

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type RegisterValidatorParams

type RegisterValidatorParams struct {
	Address        string           `json:"address"`
	Endpoint       string           `json:"endpoint"`
	CometAddress   string           `json:"comet_address"`
	NodeType       string           `json:"node_type"`
	Spid           string           `json:"spid"`
	VotingPower    int64            `json:"voting_power"`
	Status         string           `json:"status"`
	RegisteredAt   int64            `json:"registered_at"`
	DeregisteredAt pgtype.Int8      `json:"deregistered_at"`
	CreatedAt      pgtype.Timestamp `json:"created_at"`
	UpdatedAt      pgtype.Timestamp `json:"updated_at"`
}

type UpdateStorageProofStatusParams

type UpdateStorageProofStatusParams struct {
	Status  EtlProofStatus `json:"status"`
	Proof   []byte         `json:"proof"`
	Height  int64          `json:"height"`
	Address string         `json:"address"`
}

Jump to

Keyboard shortcuts

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