table

package
v0.4.11 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AverageTaxRateSubmission

type AverageTaxRateSubmission struct {
	ID              uint64          `gorm:"id"`
	EpochID         uint64          `gorm:"epoch_id"`
	AverageTaxRate  decimal.Decimal `gorm:"average_tax_rate"`
	TransactionHash string          `gorm:"transaction_hash"`
	CreatedAt       time.Time       `gorm:"created_at"`
	UpdatedAt       time.Time       `gorm:"updated_at"`
}

func (*AverageTaxRateSubmission) Export

func (*AverageTaxRateSubmission) Import

func (*AverageTaxRateSubmission) TableName

func (a *AverageTaxRateSubmission) TableName() string

type AverageTaxSubmissions

type AverageTaxSubmissions []AverageTaxRateSubmission

func (*AverageTaxSubmissions) Export

func (*AverageTaxSubmissions) Import

func (a *AverageTaxSubmissions) Import(submissions []*schema.AverageTaxRateSubmission) error

type BridgeEvent

type BridgeEvent struct {
	ID                string    `gorm:"column:id"`
	Type              string    `gorm:"column:type"`
	TransactionHash   string    `gorm:"column:transaction_hash;primaryKey"`
	TransactionIndex  uint      `gorm:"column:transaction_index"`
	TransactionStatus uint64    `gorm:"column:transaction_status"`
	ChainID           uint64    `gorm:"column:chain_id"`
	BlockHash         string    `gorm:"column:block_hash;primaryKey"`
	BlockNumber       uint64    `gorm:"column:block_number"`
	BlockTimestamp    time.Time `gorm:"column:block_timestamp"`
}

func (*BridgeEvent) Export

func (b *BridgeEvent) Export() (*schema.BridgeEvent, error)

func (*BridgeEvent) Import

func (b *BridgeEvent) Import(bridgeEvent schema.BridgeEvent) error

func (*BridgeEvent) TableName

func (b *BridgeEvent) TableName() string

type BridgeTransaction

type BridgeTransaction struct {
	ID               string          `gorm:"column:id;primaryKey"`
	Type             string          `gorm:"column:type;primaryKey"`
	Sender           string          `gorm:"column:sender"`
	Receiver         string          `gorm:"column:receiver"`
	TokenAddressL1   *string         `gorm:"column:token_address_l1"`
	TokenAddressL2   *string         `gorm:"column:token_address_l2"`
	TokenValue       decimal.Decimal `gorm:"column:token_value"`
	Data             string          `gorm:"column:data"`
	ChainID          uint64          `gorm:"column:chain_id"`
	BlockTimestamp   time.Time       `gorm:"column:block_timestamp"`
	BlockNumber      uint64          `gorm:"column:block_number"`
	TransactionIndex uint            `gorm:"column:transaction_index"`
}

func (*BridgeTransaction) Export

func (*BridgeTransaction) Import

func (b *BridgeTransaction) Import(bridgeTransaction schema.BridgeTransaction) error

func (*BridgeTransaction) TableName

func (b *BridgeTransaction) TableName() string

type Checkpoint

type Checkpoint struct {
	ChainID     uint64    `gorm:"column:chain_id"`
	BlockNumber uint64    `gorm:"column:block_number"`
	BlockHash   string    `gorm:"column:block_hash"`
	CreatedAt   time.Time `gorm:"column:created_at"`
	UpdatedAt   time.Time `gorm:"column:updated_at"`
}

func (*Checkpoint) Export

func (c *Checkpoint) Export() (*schema.Checkpoint, error)

func (*Checkpoint) Import

func (c *Checkpoint) Import(checkpoint schema.Checkpoint) error

func (*Checkpoint) TableName

func (c *Checkpoint) TableName() string

type Epoch

type Epoch struct {
	ID                    uint64          `gorm:"column:id;primaryKey"`
	StartTimestamp        time.Time       `gorm:"column:start_timestamp"`
	EndTimestamp          time.Time       `gorm:"column:end_timestamp"`
	TransactionHash       string          `gorm:"column:transaction_hash"`
	TransactionIndex      uint            `gorm:"column:transaction_index"`
	BlockHash             string          `gorm:"column:block_hash"`
	BlockNumber           uint64          `gorm:"column:block_number"`
	BlockTimestamp        time.Time       `gorm:"column:block_timestamp"`
	TotalOperationRewards decimal.Decimal `gorm:"column:total_operation_rewards"`
	TotalStakingRewards   decimal.Decimal `gorm:"column:total_staking_rewards"`
	// FIXME: update column name
	TotalRewardedNodes int             `gorm:"column:total_reward_items"`
	TotalRequestCounts decimal.Decimal `gorm:"column:total_request_counts"`

	CreatedAt time.Time `gorm:"column:created_at"`
	UpdatedAt time.Time `gorm:"column:updated_at"`
}

func (*Epoch) Export

func (e *Epoch) Export(epochItems []*schema.RewardedNode) (*schema.Epoch, error)

func (*Epoch) Import

func (e *Epoch) Import(epoch *schema.Epoch) error

func (*Epoch) TableName

func (e *Epoch) TableName() string

type EpochItem

type EpochItem struct {
	EpochID          uint64          `gorm:"column:epoch_id;"`
	Index            int             `gorm:"column:index;primaryKey"`
	TransactionHash  string          `gorm:"column:transaction_hash;primaryKey"`
	NodeAddress      string          `gorm:"column:node_address"`
	OperationRewards decimal.Decimal `gorm:"column:operation_rewards"`
	StakingRewards   decimal.Decimal `gorm:"column:staking_rewards"`
	// FIXME: correct the column names
	TaxCollected decimal.Decimal `gorm:"column:tax_amounts"`
	// FIXME: correct the column names
	RequestCount decimal.Decimal `gorm:"column:request_counts"`
}

EpochItem stores information for a Node in an Epoch TODO: we should probably rename this to NodeRewardRecord?

func (*EpochItem) Export

func (e *EpochItem) Export() (*schema.RewardedNode, error)

func (*EpochItem) Import

func (e *EpochItem) Import(nodeToReward *schema.RewardedNode) error

func (*EpochItem) TableName

func (e *EpochItem) TableName() string

type EpochItems

type EpochItems []*EpochItem

func (*EpochItems) Export

func (e *EpochItems) Export() ([]*schema.RewardedNode, error)

func (*EpochItems) Import

func (e *EpochItems) Import(nodesToReward []*schema.RewardedNode) error

type EpochTrigger

type EpochTrigger struct {
	TransactionHash string          `gorm:"column:transaction_hash"`
	EpochID         uint64          `gorm:"column:epoch_id"`
	Data            json.RawMessage `gorm:"column:data"`
	CreatedAt       time.Time       `gorm:"column:created_at"`
	UpdatedAt       time.Time       `gorm:"column:updated_at"`
}

func (*EpochTrigger) Export

func (e *EpochTrigger) Export() (*schema.EpochTrigger, error)

func (*EpochTrigger) Import

func (e *EpochTrigger) Import(epochTrigger *schema.EpochTrigger) (err error)

func (*EpochTrigger) TableName

func (e *EpochTrigger) TableName() string

type Epochs

type Epochs []*Epoch

func (*Epochs) Export

func (e *Epochs) Export(epochItems []*schema.RewardedNode) ([]*schema.Epoch, error)

type Node

type Node struct {
	Address                common.Address    `gorm:"column:address;primaryKey"`
	NodeID                 uint64            `gorm:"column:id"`
	Endpoint               string            `gorm:"column:endpoint"`
	HideTaxRate            bool              `gorm:"column:hide_tax_rate"`
	IsPublicGood           bool              `gorm:"column:is_public_good"`
	Stream                 json.RawMessage   `gorm:"column:stream"`
	Config                 json.RawMessage   `gorm:"column:config;type:jsonb"`
	Status                 schema.NodeStatus `gorm:"column:status"`
	LastHeartbeatTimestamp time.Time         `gorm:"column:last_heartbeat_timestamp"`
	// TODO: rename column to Location in database once atlas is merged
	Location         json.RawMessage `gorm:"column:local;type:jsonb"`
	Avatar           json.RawMessage `gorm:"column:avatar;type:jsonb"`
	MinTokensToStake decimal.Decimal `gorm:"column:min_tokens_to_stake"`
	APY              decimal.Decimal `gorm:"column:apy"`
	Score            decimal.Decimal `gorm:"column:score"`
	CreatedAt        time.Time       `gorm:"column:created_at"`
	UpdatedAt        time.Time       `gorm:"column:updated_at"`
}

func (*Node) Export

func (n *Node) Export() (*schema.Node, error)

func (*Node) Import

func (n *Node) Import(node *schema.Node) (err error)

func (*Node) TableName

func (*Node) TableName() string

type NodeEvent

type NodeEvent struct {
	TransactionHash  string               `gorm:"transaction_hash"`
	TransactionIndex uint                 `gorm:"transaction_index"`
	NodeID           uint64               `gorm:"node_id"`
	AddressFrom      common.Address       `gorm:"address_from"`
	AddressTo        common.Address       `gorm:"address_to"`
	Type             schema.NodeEventType `gorm:"type"`
	LogIndex         uint                 `gorm:"log_index"`
	ChainID          uint64               `gorm:"chain_id"`
	BlockHash        string               `gorm:"block_hash"`
	BlockNumber      uint64               `gorm:"block_number"`
	BlockTimestamp   time.Time            `gorm:"block_timestamp"`
	Metadata         json.RawMessage      `gorm:"metadata"`
}

func (*NodeEvent) Export

func (n *NodeEvent) Export() (*schema.NodeEvent, error)

func (*NodeEvent) Import

func (n *NodeEvent) Import(nodeEvent schema.NodeEvent) (err error)

func (*NodeEvent) TableName

func (*NodeEvent) TableName() string

type NodeEvents

type NodeEvents []*NodeEvent

func (NodeEvents) Export

func (n NodeEvents) Export() ([]*schema.NodeEvent, error)

type NodeInvalidResponse added in v0.4.11

type NodeInvalidResponse struct {
	ID                uint64                         `gorm:"id;primaryKey"`
	EpochID           uint64                         `gorm:"column:epoch_id"`
	Type              schema.NodeInvalidResponseType `gorm:"column:type"`
	Request           string                         `gorm:"column:request"`
	ValidatorNodes    []common.Address               `gorm:"column:validator_nodes"`
	ValidatorResponse json.RawMessage                `gorm:"column:validator_response"`
	Node              common.Address                 `gorm:"column:node"`
	Response          json.RawMessage                `gorm:"column:response"`
	CreatedAt         time.Time                      `gorm:"column:created_at"`
	UpdatedAt         time.Time                      `gorm:"column:updated_at"`
}

func (*NodeInvalidResponse) Export added in v0.4.11

func (*NodeInvalidResponse) Import added in v0.4.11

func (n *NodeInvalidResponse) Import(nodeResponseFailure *schema.NodeInvalidResponse)

func (*NodeInvalidResponse) TableName added in v0.4.11

func (*NodeInvalidResponse) TableName() string

type NodeMinTokensToStakeSnapshot

type NodeMinTokensToStakeSnapshot struct {
	ID               uint64          `gorm:"column:id"`
	Date             time.Time       `gorm:"column:date"`
	EpochID          uint64          `gorm:"column:epoch_id"`
	NodeAddress      common.Address  `gorm:"column:node_address"`
	MinTokensToStake decimal.Decimal `gorm:"column:min_tokens_to_stake"`
	CreatedAt        time.Time       `gorm:"column:created_at"`
	UpdatedAt        time.Time       `gorm:"column:updated_at"`
}

func (*NodeMinTokensToStakeSnapshot) Export

func (*NodeMinTokensToStakeSnapshot) Import

func (*NodeMinTokensToStakeSnapshot) TableName

func (s *NodeMinTokensToStakeSnapshot) TableName() string

type NodeMinTokensToStakeSnapshots

type NodeMinTokensToStakeSnapshots []NodeMinTokensToStakeSnapshot

func (*NodeMinTokensToStakeSnapshots) Export

func (*NodeMinTokensToStakeSnapshots) Import

type NodeSnapshot

type NodeSnapshot struct {
	Date  time.Time `gorm:"column:date"`
	Count uint64    `gorm:"column:count"`
}

func (*NodeSnapshot) Export

func (s *NodeSnapshot) Export() (*schema.NodeSnapshot, error)

func (*NodeSnapshot) Import

func (s *NodeSnapshot) Import(stakeSnapshot schema.NodeSnapshot) error

func (*NodeSnapshot) TableName

func (s *NodeSnapshot) TableName() string

type Nodes

type Nodes []Node

func (Nodes) Export

func (n Nodes) Export() ([]*schema.Node, error)

func (*Nodes) Import

func (n *Nodes) Import(nodes []*schema.Node) (err error)

type OperatorProfitSnapshot

type OperatorProfitSnapshot struct {
	ID            uint64          `gorm:"column:id"`
	Date          time.Time       `gorm:"column:date"`
	EpochID       uint64          `gorm:"column:epoch_id"`
	Operator      common.Address  `gorm:"column:operator"`
	OperationPool decimal.Decimal `gorm:"column:operation_pool"`
	CreatedAt     time.Time       `gorm:"column:created_at"`
	UpdatedAt     time.Time       `gorm:"column:updated_at"`
}

func (*OperatorProfitSnapshot) Export

func (*OperatorProfitSnapshot) Import

func (*OperatorProfitSnapshot) TableName

func (s *OperatorProfitSnapshot) TableName() string

type OperatorProfitSnapshots

type OperatorProfitSnapshots []OperatorProfitSnapshot

func (*OperatorProfitSnapshots) Export

func (*OperatorProfitSnapshots) Import

type StakeChip

type StakeChip struct {
	ID             decimal.Decimal `gorm:"column:id"`
	Owner          string          `gorm:"column:owner"`
	Node           string          `gorm:"column:node"`
	Value          decimal.Decimal `gorm:"column:value"`
	Metadata       json.RawMessage `gorm:"column:metadata"`
	BlockNumber    decimal.Decimal `gorm:"column:block_number"`
	BlockTimestamp time.Time       `gorm:"column:block_timestamp"`
}

func (*StakeChip) Export

func (s *StakeChip) Export() (*schema.StakeChip, error)

func (*StakeChip) Import

func (s *StakeChip) Import(stakeChip schema.StakeChip) error

func (*StakeChip) TableName

func (s *StakeChip) TableName() string

type StakeEvent

type StakeEvent struct {
	ID                string    `gorm:"column:id"`
	Type              string    `gorm:"column:type"`
	TransactionHash   string    `gorm:"column:transaction_hash;primaryKey"`
	TransactionIndex  uint      `gorm:"column:transaction_index"`
	TransactionStatus uint64    `gorm:"column:transaction_status"`
	BlockHash         string    `gorm:"column:block_hash;primaryKey"`
	BlockNumber       uint64    `gorm:"column:block_number"`
	BlockTimestamp    time.Time `gorm:"column:block_timestamp"`
}

func (*StakeEvent) Export

func (b *StakeEvent) Export() (*schema.StakeEvent, error)

func (*StakeEvent) Import

func (b *StakeEvent) Import(stakeEvent schema.StakeEvent) error

func (*StakeEvent) TableName

func (b *StakeEvent) TableName() string

type StakeTransaction

type StakeTransaction struct {
	ID               string          `gorm:"column:id;primaryKey"`
	Type             string          `gorm:"column:type;primaryKey"`
	User             string          `gorm:"column:user"`
	Node             string          `gorm:"column:node"`
	Value            decimal.Decimal `gorm:"column:value"`
	Chips            pq.Int64Array   `gorm:"column:chips;type:bigint[]"`
	BlockTimestamp   time.Time       `gorm:"column:block_timestamp"`
	BlockNumber      uint64          `gorm:"column:block_number"`
	TransactionIndex uint            `gorm:"column:transaction_index"`
}

func (*StakeTransaction) Export

func (*StakeTransaction) Import

func (s *StakeTransaction) Import(stakeTransaction schema.StakeTransaction) error

func (*StakeTransaction) TableName

func (s *StakeTransaction) TableName() string

type StakerCountSnapshot

type StakerCountSnapshot struct {
	Date  time.Time `gorm:"column:date"`
	Count uint64    `gorm:"column:count"`
}

func (*StakerCountSnapshot) Export

func (*StakerCountSnapshot) Import

func (s *StakerCountSnapshot) Import(stakeSnapshot schema.StakerCountSnapshot) error

func (*StakerCountSnapshot) TableName

func (s *StakerCountSnapshot) TableName() string

type StakerProfitSnapshot

type StakerProfitSnapshot struct {
	ID               uint64          `gorm:"column:id"`
	Date             time.Time       `gorm:"column:date"`
	EpochID          uint64          `gorm:"column:epoch_id"`
	OwnerAddress     common.Address  `gorm:"column:owner_address"`
	TotalChipAmounts decimal.Decimal `gorm:"column:total_chip_amounts"`
	TotalChipValues  decimal.Decimal `gorm:"column:total_chip_values"`
	CreatedAt        time.Time       `gorm:"column:created_at"`
	UpdatedAt        time.Time       `gorm:"column:updated_at"`
}

func (*StakerProfitSnapshot) Export

func (*StakerProfitSnapshot) Import

func (*StakerProfitSnapshot) TableName

func (s *StakerProfitSnapshot) TableName() string

type StakerProfitSnapshots

type StakerProfitSnapshots []StakerProfitSnapshot

func (*StakerProfitSnapshots) Export

func (*StakerProfitSnapshots) Import

func (s *StakerProfitSnapshots) Import(snapshots []*schema.StakerProfitSnapshot) error

type Stat

type Stat struct {
	Address              common.Address `gorm:"column:address;primaryKey"`
	Endpoint             string         `gorm:"column:endpoint"`
	Points               float64        `gorm:"column:points"`
	IsPublicGood         bool           `gorm:"column:is_public_good"`
	IsFullNode           bool           `gorm:"column:is_full_node"`
	IsRssNode            bool           `gorm:"column:is_rss_node"`
	Staking              float64        `gorm:"column:staking"`
	Epoch                int64          `gorm:"column:epoch"`
	TotalRequest         int64          `gorm:"column:total_request_count"`
	EpochRequest         int64          `gorm:"column:epoch_request_count"`
	EpochInvalidRequest  int64          `gorm:"column:epoch_invalid_request_count"`
	DecentralizedNetwork int            `gorm:"column:decentralized_network_count"`
	FederatedNetwork     int            `gorm:"column:federated_network_count"`
	Indexer              int            `gorm:"column:indexer_count"`
	ResetAt              time.Time      `gorm:"column:reset_at"`
	CreatedAt            time.Time      `gorm:"column:created_at"`
	UpdatedAt            time.Time      `gorm:"column:updated_at"`
}

func (*Stat) Export

func (s *Stat) Export() (*schema.Stat, error)

func (*Stat) Import

func (s *Stat) Import(stat *schema.Stat) (err error)

func (*Stat) TableName

func (*Stat) TableName() string

type Stats

type Stats []Stat

func (*Stats) Export

func (s *Stats) Export() ([]*schema.Stat, error)

func (*Stats) Import

func (s *Stats) Import(stats []*schema.Stat) (err error)

type Worker added in v0.4.11

type Worker struct {
	Address common.Address `gorm:"column:address;primaryKey"`
	Network string         `gorm:"column:network;primaryKey"`
	Name    string         `gorm:"column:name;primaryKey"`
}

func (*Worker) Export added in v0.4.11

func (w *Worker) Export() *schema.Worker

func (*Worker) Import added in v0.4.11

func (w *Worker) Import(worker *schema.Worker)

func (*Worker) TableName added in v0.4.11

func (*Worker) TableName() string

type Workers added in v0.4.11

type Workers []Worker

func (*Workers) Export added in v0.4.11

func (w *Workers) Export() []*schema.Worker

func (*Workers) Import added in v0.4.11

func (w *Workers) Import(workers []*schema.Worker)

Jump to

Keyboard shortcuts

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