model

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountEraSeq added in v0.3.0

type AccountEraSeq struct {
	ID types.ID `json:"id"`

	*EraSequence

	// Origin accounts
	StashAccount      string `json:"stash_account"`
	ControllerAccount string `json:"controller_account"`
	// Destination accounts
	ValidatorStashAccount      string         `json:"validator_stash_account"`
	ValidatorControllerAccount string         `json:"validator_controller_account"`
	Stake                      types.Quantity `json:"own_stake"`
}

func (*AccountEraSeq) Equal added in v0.3.0

func (s *AccountEraSeq) Equal(m AccountEraSeq) bool

func (AccountEraSeq) TableName added in v0.3.0

func (AccountEraSeq) TableName() string

func (*AccountEraSeq) Valid added in v0.3.0

func (s *AccountEraSeq) Valid() bool

type Aggregate

type Aggregate struct {
	StartedAtHeight int64      `json:"started_at_height"`
	StartedAt       types.Time `json:"started_at"`
	RecentAtHeight  int64      `json:"recent_at_height"`
	RecentAt        types.Time `json:"recent_at"`
}

Aggregate is used for aggregate tables

func (*Aggregate) Equal

func (a *Aggregate) Equal(m Aggregate) bool

func (*Aggregate) Valid

func (a *Aggregate) Valid() bool

type BlockSeq

type BlockSeq struct {
	ID types.ID `json:"id"`

	*Sequence

	// Indexed data
	ExtrinsicsCount         int64 `json:"extrinsics_count"`
	UnsignedExtrinsicsCount int64 `json:"unsigned_extrinsics_count"`
	SignedExtrinsicsCount   int64 `json:"signed_extrinsics_count"`
}

func (*BlockSeq) Equal

func (b *BlockSeq) Equal(m BlockSeq) bool

func (BlockSeq) TableName

func (BlockSeq) TableName() string

func (*BlockSeq) Update

func (b *BlockSeq) Update(m BlockSeq)

func (*BlockSeq) Valid

func (b *BlockSeq) Valid() bool

type BlockSeqSummary added in v0.4.5

type BlockSeqSummary struct {
	TimeBucket   types.Time `json:"time_bucket"`
	Count        int64      `json:"count"`
	BlockTimeAvg float64    `json:"block_time_avg"`
}

type BlockSummary

type BlockSummary struct {
	*Model
	*Summary

	Count        int64   `json:"count"`
	BlockTimeAvg float64 `json:"block_time_avg"`
}

swagger:response BlockSummary

func (BlockSummary) TableName

func (BlockSummary) TableName() string

type DelegationChangeData added in v0.5.0

type DelegationChangeData struct {
	StashAccounts []string `json:"stash_accounts"`
}

DelegationChangeData is data format for delegation system events

type EraSequence added in v0.1.2

type EraSequence struct {
	Era         int64      `json:"era"`
	StartHeight int64      `json:"start_height"`
	EndHeight   int64      `json:"end_height"`
	Time        types.Time `json:"time"`
}

EraSequence is used for sequences recorded per era

func (*EraSequence) Equal added in v0.1.2

func (s *EraSequence) Equal(m EraSequence) bool

func (*EraSequence) Valid added in v0.1.2

func (s *EraSequence) Valid() bool

type EventSeq added in v0.1.2

type EventSeq struct {
	ID types.ID `json:"id"`

	*Sequence

	// Indexed data
	Index          int64       `json:"index"`
	ExtrinsicIndex int64       `json:"extrinsic_index"`
	Data           types.Jsonb `json:"data"`
	Phase          string      `json:"phase"`
	Method         string      `json:"method"`
	Section        string      `json:"section"`
}

func (*EventSeq) Equal added in v0.1.2

func (b *EventSeq) Equal(m EventSeq) bool

func (EventSeq) TableName added in v0.1.2

func (EventSeq) TableName() string

func (*EventSeq) Valid added in v0.1.2

func (b *EventSeq) Valid() bool

type EventSeqWithTxHash added in v0.4.4

type EventSeqWithTxHash struct {
	Height  int64       `json:"height"`
	Data    types.Jsonb `json:"data"`
	Method  string      `json:"method"`
	Section string      `json:"section"`
	TxHash  string      `json:"hash"`
}

type MissedNConsecutive added in v0.5.0

type MissedNConsecutive struct {
	Missed    int64 `json:"missed"`
	Threshold int64 `json:"threshold"`
}

MissedNConsecutive is data format for missedNofM system events

type MissedNofMData added in v0.5.0

type MissedNofMData struct {
	Missed           int64 `json:"missed"`
	Threshold        int64 `json:"threshold"`
	MaxTotalSessions int64 `json:"max_total_sessions"`
}

MissedNofMData is data format for missedNofM system events

type Model

type Model struct {
	ID        types.ID   `json:"id"`
	CreatedAt types.Time `json:"created_at"`
	UpdatedAt types.Time `json:"updated_at"`
}

Model is used for general table

func (*Model) Equal

func (e *Model) Equal(m Model) bool

func (*Model) Valid

func (e *Model) Valid() bool

type PercentChangeData added in v0.5.0

type PercentChangeData struct {
	Before int64   `json:"before"`
	After  int64   `json:"after"`
	Change float64 `json:"change"`
}

PercentChangeData is data format for change system events

type Report

type Report struct {
	*Model

	Kind         ReportKind
	IndexVersion int64
	StartHeight  int64
	EndHeight    int64
	SuccessCount *int64
	ErrorCount   *int64
	ErrorMsg     *string
	Duration     time.Duration
	CompletedAt  *types.Time
}

func (*Report) Complete

func (r *Report) Complete(successCount int64, errorCount int64, err error)

func (*Report) Equal

func (r *Report) Equal(m Report) bool

func (Report) TableName

func (Report) TableName() string

func (*Report) Valid

func (r *Report) Valid() bool

type ReportKind

type ReportKind int
const (
	ReportKindIndex ReportKind = iota + 1
	ReportKindParallelReindex
	ReportKindSequentialReindex
)

func (ReportKind) String

func (k ReportKind) String() string

type RewardEraSeq added in v0.6.0

type RewardEraSeq struct {
	*EraSequence

	StashAccount          string     `json:"stash_account"`
	ValidatorStashAccount string     `json:"validator_stash_account"`
	Amount                string     `json:"amount"`
	Kind                  RewardKind `json:"kind"`
	Claimed               bool       `json:"claimed"`
	TxHash                string     `json:"tx_hash"`
}

func (*RewardEraSeq) IsEmpty added in v0.10.0

func (r *RewardEraSeq) IsEmpty() bool

func (RewardEraSeq) TableName added in v0.6.0

func (RewardEraSeq) TableName() string

type RewardKind added in v0.6.0

type RewardKind string
const (
	RewardCommission RewardKind = "commission"
	RewardReward     RewardKind = "reward"
	// for historical data, it's not possible to dissect reward from commission
	RewardCommissionAndReward RewardKind = "commission_and_reward"
)

func (RewardKind) String added in v0.6.0

func (o RewardKind) String() string

type Sequence

type Sequence struct {
	Height int64      `json:"height"`
	Time   types.Time `json:"time"`
}

Sequence is used for sequence tables

func (*Sequence) Equal

func (s *Sequence) Equal(m Sequence) bool

func (*Sequence) Valid

func (s *Sequence) Valid() bool

type SessionSequence added in v0.1.2

type SessionSequence struct {
	Session     int64      `json:"session"`
	StartHeight int64      `json:"start_height"`
	EndHeight   int64      `json:"end_height"`
	Time        types.Time `json:"time"`
}

SessionSequence is used for sequences recorded per session

func (*SessionSequence) Equal added in v0.1.2

func (s *SessionSequence) Equal(m SessionSequence) bool

func (*SessionSequence) Valid added in v0.1.2

func (s *SessionSequence) Valid() bool

type Summary

type Summary struct {
	IndexVersion int64                 `json:"index_version"`
	TimeInterval types.SummaryInterval `json:"time_interval"`
	TimeBucket   types.Time            `json:"time_bucket"`
}

Summary is used for summary tables

func (*Summary) Equal

func (a *Summary) Equal(m Summary) bool

func (*Summary) Valid

func (a *Summary) Valid() bool

type Syncable

type Syncable struct {
	*Model

	Height        int64      `json:"height"`
	Time          types.Time `json:"time"`
	SpecVersion   string     `json:"spec_version"`
	ChainUID      string     `json:"chain_uid"`
	Session       int64      `json:"session"`
	Era           int64      `json:"era"`
	LastInSession bool       `json:"last_in_session"`
	LastInEra     bool       `json:"last_in_era"`

	IndexVersion int64          `json:"index_version"`
	Status       SyncableStatus `json:"status"`
	ReportID     types.ID       `json:"report_id"`
	StartedAt    types.Time     `json:"started_at"`
	ProcessedAt  *types.Time    `json:"processed_at"`
	Duration     time.Duration  `json:"duration"`
}

func (*Syncable) Equal

func (s *Syncable) Equal(m Syncable) bool

func (*Syncable) MarkProcessed

func (s *Syncable) MarkProcessed(indexVersion int64)

func (*Syncable) SetStatus

func (s *Syncable) SetStatus(newStatus SyncableStatus)

func (Syncable) TableName

func (Syncable) TableName() string

- Methods

func (*Syncable) Valid

func (s *Syncable) Valid() bool

type SyncableStatus

type SyncableStatus int
const (
	SyncableStatusRunning SyncableStatus = iota + 1
	SyncableStatusCompleted
)

type SystemEvent added in v0.5.0

type SystemEvent struct {
	*Model

	Height int64           `json:"height"`
	Time   types.Time      `json:"time"`
	Actor  string          `json:"actor"`
	Kind   SystemEventKind `json:"kind"`
	Data   types.Jsonb     `json:"data"`
}

type SystemEventKind added in v0.5.0

type SystemEventKind string
const (
	SystemEventActiveBalanceChange1 SystemEventKind = "active_balance_change_1"
	SystemEventActiveBalanceChange2 SystemEventKind = "active_balance_change_2"
	SystemEventActiveBalanceChange3 SystemEventKind = "active_balance_change_3"
	SystemEventCommissionChange1    SystemEventKind = "commission_change_1"
	SystemEventCommissionChange2    SystemEventKind = "commission_change_2"
	SystemEventCommissionChange3    SystemEventKind = "commission_change_3"
	SystemEventJoinedSet            SystemEventKind = "joined_set"
	SystemEventLeftSet              SystemEventKind = "left_set"
	SystemEventMissedNConsecutive   SystemEventKind = "missed_n_consecutive"
	SystemEventDelegationLeft       SystemEventKind = "delegation_left"
	SystemEventDelegationJoined     SystemEventKind = "delegation_joined"
)

func (SystemEventKind) String added in v0.5.0

func (o SystemEventKind) String() string

type TransactionKind added in v0.7.0

type TransactionKind struct {
	Section string `json:"section"`
	Method  string `json:"method"`
}

type TransactionSeq added in v0.4.4

type TransactionSeq struct {
	ID types.ID `json:"id"`

	*Sequence

	// Indexed data
	Index   int64  `json:"index"`
	Hash    string `json:"hash"`
	Method  string `json:"method"`
	Section string `json:"section"`
	Args    string `json:"args"`
}

func (TransactionSeq) TableName added in v0.4.4

func (TransactionSeq) TableName() string

func (*TransactionSeq) Valid added in v0.4.4

func (t *TransactionSeq) Valid() bool

type ValidatorAgg added in v0.1.2

type ValidatorAgg struct {
	*Model
	*Aggregate

	StashAccount            string `json:"stash_account"`
	DisplayName             string `json:"display_name"`
	RecentAsValidatorHeight int64  `json:"recent_as_validator_height"`
	AccumulatedUptime       int64  `json:"accumulated_uptime"`
	AccumulatedUptimeCount  int64  `json:"accumulated_uptime_count"`
}

func (*ValidatorAgg) Equal added in v0.1.2

func (s *ValidatorAgg) Equal(m ValidatorAgg) bool

func (ValidatorAgg) TableName added in v0.1.2

func (ValidatorAgg) TableName() string

- Methods

func (*ValidatorAgg) Update added in v0.1.2

func (s *ValidatorAgg) Update(u *ValidatorAgg)

func (*ValidatorAgg) Valid added in v0.1.2

func (s *ValidatorAgg) Valid() bool

type ValidatorEraSeq added in v0.1.2

type ValidatorEraSeq struct {
	ID types.ID `json:"id"`

	*EraSequence

	StashAccount      string         `json:"stash_account"`
	ControllerAccount string         `json:"controller_account"`
	SessionAccounts   pq.StringArray `json:"session_accounts"`
	Index             int64          `json:"index"`
	TotalStake        types.Quantity `json:"total_stake"`
	OwnStake          types.Quantity `json:"own_stake"`
	StakersStake      types.Quantity `json:"stakers_stake"`
	RewardPoints      int64          `json:"reward_points"`
	Commission        int64          `json:"commission"`
	StakersCount      int            `json:"stakers_count"`
}

func (*ValidatorEraSeq) Equal added in v0.1.2

func (s *ValidatorEraSeq) Equal(m ValidatorEraSeq) bool

func (ValidatorEraSeq) TableName added in v0.1.2

func (ValidatorEraSeq) TableName() string

func (*ValidatorEraSeq) Valid added in v0.1.2

func (s *ValidatorEraSeq) Valid() bool

type ValidatorEraSeqSummary added in v0.4.5

type ValidatorEraSeqSummary struct {
	StashAccount    string         `json:"stash_account"`
	TimeBucket      types.Time     `json:"time_bucket"`
	TotalStakeAvg   types.Quantity `json:"total_stake_avg"`
	TotalStakeMin   types.Quantity `json:"total_stake_min"`
	TotalStakeMax   types.Quantity `json:"total_stake_max"`
	OwnStakeAvg     types.Quantity `json:"own_stake_avg"`
	OwnStakeMin     types.Quantity `json:"own_stake_min"`
	OwnStakeMax     types.Quantity `json:"own_stake_max"`
	StakersStakeAvg types.Quantity `json:"stakers_stake_avg"`
	StakersStakeMin types.Quantity `json:"stakers_stake_min"`
	StakersStakeMax types.Quantity `json:"stakers_stake_max"`
	RewardPointsAvg float64        `json:"reward_points_avg"`
	RewardPointsMin int64          `json:"reward_points_min"`
	RewardPointsMax int64          `json:"reward_points_max"`
	CommissionAvg   float64        `json:"commission_avg"`
	CommissionMin   int64          `json:"commission_min"`
	CommissionMax   int64          `json:"commission_max"`
	StakersCountAvg float64        `json:"stakers_count_avg"`
	StakersCountMin int64          `json:"stakers_count_min"`
	StakersCountMax int64          `json:"stakers_count_max"`
}

type ValidatorSeq added in v0.5.0

type ValidatorSeq struct {
	ID types.ID `json:"id"`

	*Sequence

	StashAccount  string         `json:"stash_account"`
	ActiveBalance types.Quantity `json:"active_balance"`
}

func (*ValidatorSeq) Equal added in v0.5.0

func (vs *ValidatorSeq) Equal(m ValidatorSeq) bool

func (ValidatorSeq) TableName added in v0.5.0

func (ValidatorSeq) TableName() string

func (*ValidatorSeq) Valid added in v0.5.0

func (vs *ValidatorSeq) Valid() bool

type ValidatorSessionSeq added in v0.1.2

type ValidatorSessionSeq struct {
	ID types.ID `json:"id"`

	*SessionSequence

	StashAccount string `json:"stash_account"`
	Online       bool   `json:"online"`
}

func (*ValidatorSessionSeq) Equal added in v0.1.2

func (ValidatorSessionSeq) TableName added in v0.1.2

func (ValidatorSessionSeq) TableName() string

func (*ValidatorSessionSeq) Valid added in v0.1.2

func (s *ValidatorSessionSeq) Valid() bool

type ValidatorSessionSeqSummary added in v0.4.5

type ValidatorSessionSeqSummary struct {
	StashAccount string     `json:"stash_account"`
	TimeBucket   types.Time `json:"time_bucket"`
	UptimeAvg    float64    `json:"uptime_avg"`
	UptimeMin    int64      `json:"uptime_min"`
	UptimeMax    int64      `json:"uptime_max"`
}

type ValidatorSummary added in v0.1.2

type ValidatorSummary struct {
	*Model
	*Summary

	StashAccount string `json:"address"`

	// Era info
	TotalStakeAvg   types.Quantity `json:"total_stake_avg"`
	TotalStakeMin   types.Quantity `json:"total_stake_min"`
	TotalStakeMax   types.Quantity `json:"total_stake_max"`
	OwnStakeAvg     types.Quantity `json:"own_stake_avg"`
	OwnStakeMin     types.Quantity `json:"own_stake_min"`
	OwnStakeMax     types.Quantity `json:"own_stake_max"`
	StakersStakeAvg types.Quantity `json:"stakers_stake_avg"`
	StakersStakeMin types.Quantity `json:"stakers_stake_min"`
	StakersStakeMax types.Quantity `json:"stakers_stake_max"`
	RewardPointsAvg float64        `json:"reward_points_avg"`
	RewardPointsMin int64          `json:"reward_points_min"`
	RewardPointsMax int64          `json:"reward_points_max"`
	CommissionAvg   float64        `json:"commission_avg"`
	CommissionMin   int64          `json:"commission_min"`
	CommissionMax   int64          `json:"commission_max"`
	StakersCountAvg float64        `json:"stakers_count_avg"`
	StakersCountMin int64          `json:"stakers_count_min"`
	StakersCountMax int64          `json:"stakers_count_max"`

	// Session info
	UptimeAvg float64 `json:"uptime_avg"`
	UptimeMax int64   `json:"uptime_max"`
	UptimeMin int64   `json:"uptime_min"`
}

func (ValidatorSummary) TableName added in v0.1.2

func (ValidatorSummary) TableName() string

Jump to

Keyboard shortcuts

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