Documentation ¶
Index ¶
- func NodeInvalidResponseTypeStrings() []string
- func NodeStatusStrings() []string
- type AverageTaxRateSubmission
- type AverageTaxRateSubmissionQuery
- type BatchUpdateNode
- type BridgeEvent
- type BridgeEventExporter
- type BridgeEventImporter
- type BridgeEventTransformer
- type BridgeEventType
- type BridgeEventsQuery
- type BridgeTransaction
- type BridgeTransactionExporter
- type BridgeTransactionImporter
- type BridgeTransactionQuery
- type BridgeTransactionTransformer
- type BridgeTransactionType
- type BridgeTransactionsQuery
- type Checkpoint
- type CheckpointExporter
- type CheckpointImporter
- type CheckpointTransformer
- type Epoch
- type EpochTrigger
- type FindNodesQuery
- type Node
- type NodeCreatedMetadata
- type NodeEvent
- type NodeEventMetadata
- type NodeEventType
- type NodeInvalidResponse
- type NodeInvalidResponseType
- func (i NodeInvalidResponseType) IsANodeInvalidResponseType() bool
- func (i NodeInvalidResponseType) MarshalJSON() ([]byte, error)
- func (i NodeInvalidResponseType) MarshalYAML() (interface{}, error)
- func (i *NodeInvalidResponseType) Scan(value interface{}) error
- func (i NodeInvalidResponseType) String() string
- func (i *NodeInvalidResponseType) UnmarshalJSON(data []byte) error
- func (i *NodeInvalidResponseType) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (i NodeInvalidResponseType) Value() (driver.Value, error)
- func (NodeInvalidResponseType) Values() []string
- type NodeLocation
- type NodeMinTokensToStakeSnapshot
- type NodeSnapshot
- type NodeSnapshotExporter
- type NodeSnapshotImporter
- type NodeSnapshotTransformer
- type NodeStatus
- func (i NodeStatus) IsANodeStatus() bool
- func (i NodeStatus) MarshalJSON() ([]byte, error)
- func (i NodeStatus) MarshalYAML() (interface{}, error)
- func (i *NodeStatus) Scan(value interface{}) error
- func (i NodeStatus) String() string
- func (i *NodeStatus) UnmarshalJSON(data []byte) error
- func (i *NodeStatus) UnmarshalYAML(unmarshal func(interface{}) error) error
- func (i NodeStatus) Value() (driver.Value, error)
- func (NodeStatus) Values() []string
- type OperatorProfitSnapshot
- type OperatorProfitSnapshotsQuery
- type RewardedNode
- type SettlementData
- type StakeChip
- type StakeChipExporter
- type StakeChipImporter
- type StakeChipQuery
- type StakeChipTransformer
- type StakeChipsQuery
- type StakeEvent
- type StakeEventExporter
- type StakeEventImporter
- type StakeEventQuery
- type StakeEventTransformer
- type StakeEventType
- type StakeEventsQuery
- type StakeRecentCount
- type StakeSnapshotTransformer
- type StakeStaking
- type StakeStakingChips
- type StakeStakingsQuery
- type StakeTransaction
- type StakeTransactionExporter
- type StakeTransactionImporter
- type StakeTransactionQuery
- type StakeTransactionTransformer
- type StakeTransactionType
- type StakeTransactionsQuery
- type StakerCountSnapshot
- type StakerCountSnapshotExporter
- type StakerCountSnapshotImporter
- type StakerProfitSnapshot
- type StakerProfitSnapshotsQuery
- type Stat
- type StatQuery
- type Worker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NodeInvalidResponseTypeStrings ¶ added in v0.4.11
func NodeInvalidResponseTypeStrings() []string
NodeInvalidResponseTypeStrings returns a slice of all String values of the enum
func NodeStatusStrings ¶
func NodeStatusStrings() []string
NodeStatusStrings returns a slice of all String values of the enum
Types ¶
type BatchUpdateNode ¶
type BridgeEvent ¶
type BridgeEvent struct { ID common.Hash `json:"id"` Type BridgeEventType `json:"type"` TransactionHash common.Hash `json:"transactionHash"` TransactionIndex uint `json:"transactionIndex"` TransactionStatus uint64 `json:"transactionStatus"` ChainID uint64 `json:"chainID"` BlockHash common.Hash `json:"blockHash"` BlockNumber *big.Int `json:"blockNumber"` BlockTimestamp time.Time `json:"blockTimestamp"` }
func NewBridgeEvent ¶
func NewBridgeEvent(id common.Hash, eventType BridgeEventType, chainID uint64, header *types.Header, transaction *types.Transaction, receipt *types.Receipt) *BridgeEvent
type BridgeEventExporter ¶
type BridgeEventExporter interface {
Export() (*BridgeEvent, error)
}
type BridgeEventImporter ¶
type BridgeEventImporter interface {
Import(bridgeEvent BridgeEvent) error
}
type BridgeEventTransformer ¶
type BridgeEventTransformer interface { BridgeEventImporter BridgeEventExporter }
type BridgeEventType ¶
type BridgeEventType string
const ( BridgeEventTypeDepositInitialized BridgeEventType = "initialized" BridgeEventTypeDepositFinalized BridgeEventType = "finalized" BridgeEventTypeWithdrawalInitialized BridgeEventType = "initialized" BridgeEventTypeWithdrawalProved BridgeEventType = "proved" BridgeEventTypeWithdrawalFinalized BridgeEventType = "finalized" )
type BridgeEventsQuery ¶
type BridgeTransaction ¶
type BridgeTransaction struct { ID common.Hash `json:"id"` Type BridgeTransactionType `json:"type"` Sender common.Address `json:"sender"` Receiver common.Address `json:"receiver"` TokenAddressL1 *common.Address `json:"tokenAddressL1"` TokenAddressL2 *common.Address `json:"tokenAddressL2"` TokenValue *big.Int `json:"tokenValue"` Data string `json:"data"` ChainID uint64 `json:"chainID"` BlockTimestamp time.Time `json:"blockTimestamp"` BlockNumber uint64 `json:"blockNumber"` TransactionIndex uint `json:"transactionIndex"` }
type BridgeTransactionExporter ¶
type BridgeTransactionExporter interface {
Export() (*BridgeTransaction, error)
}
type BridgeTransactionImporter ¶
type BridgeTransactionImporter interface {
Import(bridgeTransaction BridgeTransaction) error
}
type BridgeTransactionQuery ¶
type BridgeTransactionTransformer ¶
type BridgeTransactionTransformer interface { BridgeTransactionImporter BridgeTransactionExporter }
type BridgeTransactionType ¶
type BridgeTransactionType string
const ( BridgeTransactionTypeDeposit BridgeTransactionType = "deposit" BridgeTransactionTypeWithdraw BridgeTransactionType = "withdraw" )
type BridgeTransactionsQuery ¶
type Checkpoint ¶
type CheckpointExporter ¶
type CheckpointExporter interface {
Export() (*Checkpoint, error)
}
type CheckpointImporter ¶
type CheckpointImporter interface {
Import(checkpoint Checkpoint) error
}
type CheckpointTransformer ¶
type CheckpointTransformer interface { CheckpointImporter CheckpointExporter }
type Epoch ¶
type Epoch struct { ID uint64 `json:"id"` // StartTimestamp when an Epoch begins. StartTimestamp int64 `json:"startTimestamp"` // EndTimestamp when an Epoch ends. EndTimestamp int64 `json:"endTimestamp"` TransactionHash common.Hash `json:"transactionHash"` TransactionIndex uint `json:"transactionIndex"` BlockHash common.Hash `json:"blockHash"` BlockNumber *big.Int `json:"blockNumber"` BlockTimestamp int64 `json:"blockTimestamp"` // total Operation Rewards distributed. TotalOperationRewards decimal.Decimal `json:"totalOperationRewards"` // total Staking Rewards distributed. TotalStakingRewards decimal.Decimal `json:"totalStakingRewards"` // the number of Nodes that received rewards. TotalRewardedNodes int `json:"totalRewardedNodes"` // the list of Nodes that received rewards and the amount they received. RewardedNodes []*RewardedNode `json:"rewardedNodes,omitempty"` // the total number of DSL requests made during the Epoch. TotalRequestCounts decimal.Decimal `json:"totalRequestCounts"` CreatedAt int64 `json:"-"` UpdatedAt int64 `json:"-"` }
Epoch records an Epoch and its proof of rewards distribution
type EpochTrigger ¶
type FindNodesQuery ¶
type Node ¶
type Node struct { ID *big.Int `json:"id"` Address common.Address `json:"address"` Name string `json:"name"` Description string `json:"description"` TaxRateBasisPoints *uint64 `json:"taxRateBasisPoints"` HideTaxRate bool `json:"-"` IsPublicGood bool `json:"isPublicGood"` OperationPoolTokens string `json:"operationPoolTokens"` StakingPoolTokens string `json:"stakingPoolTokens"` SlashedTokens string `json:"slashedTokens"` Alpha bool `json:"alpha"` Endpoint string `json:"-"` Stream json.RawMessage `json:"-"` Config json.RawMessage `json:"-"` Status NodeStatus `json:"status"` LastHeartbeatTimestamp int64 `json:"lastHeartbeat"` Location []*NodeLocation `json:"location"` Avatar *l2.ChipsTokenMetadata `json:"avatar"` MinTokensToStake decimal.Decimal `json:"minTokensToStake"` APY decimal.Decimal `json:"apy"` ActiveScore decimal.Decimal `json:"activeScore"` ReliabilityScore decimal.Decimal `json:"reliabilityScore"` Type string `json:"type"` CreatedAt int64 `json:"createdAt"` }
type NodeCreatedMetadata ¶
type NodeEvent ¶
type NodeEvent struct { TransactionHash common.Hash `json:"transactionHash"` TransactionIndex uint `json:"transactionIndex"` NodeID *big.Int `json:"nodeID"` AddressFrom common.Address `json:"addressFrom"` AddressTo common.Address `json:"addressTo"` Type NodeEventType `json:"type"` LogIndex uint `json:"logIndex"` ChainID uint64 `json:"chainID"` BlockHash common.Hash `json:"blockHash"` BlockNumber *big.Int `json:"blockNumber"` BlockTimestamp int64 `json:"blockTimestamp"` Metadata NodeEventMetadata `json:"metadata"` }
type NodeEventMetadata ¶
type NodeEventMetadata struct {
NodeCreatedMetadata *NodeCreatedMetadata `json:"nodeCreated"`
}
type NodeEventType ¶
type NodeEventType string
const (
NodeEventNodeCreated NodeEventType = "nodeCreated"
)
type NodeInvalidResponse ¶ added in v0.4.11
type NodeInvalidResponse struct { ID uint64 `json:"id"` EpochID uint64 `json:"epochID"` Type NodeInvalidResponseType `json:"type"` Request string `json:"request"` VerifierNodes []common.Address `json:"verifierNodes"` VerifierResponse json.RawMessage `json:"verifierResponse"` Node common.Address `json:"node"` Response json.RawMessage `json:"response"` CreatedAt int64 `json:"createdAt"` }
NodeInvalidResponse records an alleged invalid response of a Node A group of Nodes are selected as verifiers to verify the response returned by a Node The response (with all responses from all verifiers) is saved in the database pending challenge by the penalized Node
type NodeInvalidResponseType ¶ added in v0.4.11
type NodeInvalidResponseType int64
const ( // NodeInvalidResponseTypeInconsistent when the Node's response differs from the majority of verifiers NodeInvalidResponseTypeInconsistent NodeInvalidResponseType = iota // inconsistent // NodeInvalidResponseTypeError when the Node returns an error NodeInvalidResponseTypeError // error )
func NodeInvalidResponseTypeString ¶ added in v0.4.11
func NodeInvalidResponseTypeString(s string) (NodeInvalidResponseType, error)
NodeInvalidResponseTypeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func NodeInvalidResponseTypeValues ¶ added in v0.4.11
func NodeInvalidResponseTypeValues() []NodeInvalidResponseType
NodeInvalidResponseTypeValues returns all values of the enum
func (NodeInvalidResponseType) IsANodeInvalidResponseType ¶ added in v0.4.11
func (i NodeInvalidResponseType) IsANodeInvalidResponseType() bool
IsANodeInvalidResponseType returns "true" if the value is listed in the enum definition. "false" otherwise
func (NodeInvalidResponseType) MarshalJSON ¶ added in v0.4.11
func (i NodeInvalidResponseType) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface for NodeInvalidResponseType
func (NodeInvalidResponseType) MarshalYAML ¶ added in v0.4.11
func (i NodeInvalidResponseType) MarshalYAML() (interface{}, error)
MarshalYAML implements a YAML Marshaler for NodeInvalidResponseType
func (*NodeInvalidResponseType) Scan ¶ added in v0.4.11
func (i *NodeInvalidResponseType) Scan(value interface{}) error
func (NodeInvalidResponseType) String ¶ added in v0.4.11
func (i NodeInvalidResponseType) String() string
func (*NodeInvalidResponseType) UnmarshalJSON ¶ added in v0.4.11
func (i *NodeInvalidResponseType) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface for NodeInvalidResponseType
func (*NodeInvalidResponseType) UnmarshalYAML ¶ added in v0.4.11
func (i *NodeInvalidResponseType) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements a YAML Unmarshaler for NodeInvalidResponseType
func (NodeInvalidResponseType) Value ¶ added in v0.4.11
func (i NodeInvalidResponseType) Value() (driver.Value, error)
func (NodeInvalidResponseType) Values ¶ added in v0.4.11
func (NodeInvalidResponseType) Values() []string
type NodeLocation ¶ added in v0.4.4
type NodeSnapshot ¶
type NodeSnapshotExporter ¶
type NodeSnapshotExporter interface {
Export() (*NodeSnapshot, error)
}
type NodeSnapshotImporter ¶
type NodeSnapshotImporter interface {
Import(nodeSnapshot NodeSnapshot) error
}
type NodeSnapshotTransformer ¶
type NodeSnapshotTransformer interface { NodeSnapshotImporter NodeSnapshotExporter }
type NodeStatus ¶
type NodeStatus int64
const ( // NodeStatusRegistered // Node has been registered but does not meet the minimum requirements to be enter NodeStatusOnline. // Possible reasons: // - Node is not reachable by the Network. // - Node Operator has not deposited the minimum amount of tokens required. NodeStatusRegistered NodeStatus = iota // registered // NodeStatusOnline // Node is online and fully operational. NodeStatusOnline // online // NodeStatusOffline // Node was previously in NodeStatusOnline, but is currently offline. // Possible reasons: // - [Alpha only] Node missed a heartbeat. // - Node was slashed in the previous epoch, and was kicked out of the Network, the Operator did not acknowledge the slash and rejoin the Network. // - Node did not perform the mandatory upgrade before the deadline required by the Network. NodeStatusOffline // offline // NodeStatusExited // Node was previously in NodeStatusOnline, but is not anymore. // Possible reasons: // - Node announced its intention to leave the Network and gracefully exited after the mandatory waiting period. // - Node has been offline for a long time and is considered as exited. NodeStatusExited // exited // NodeStatusSlashed // Node was slashed in the current epoch, and was kicked out of the Network. NodeStatusSlashed // slashed // NodeStatusExiting // Node announced its intention to leave the Network, and is now in the mandatory waiting period. NodeStatusExiting // exiting )
func NodeStatusString ¶
func NodeStatusString(s string) (NodeStatus, error)
NodeStatusString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func NodeStatusValues ¶
func NodeStatusValues() []NodeStatus
NodeStatusValues returns all values of the enum
func (NodeStatus) IsANodeStatus ¶
func (i NodeStatus) IsANodeStatus() bool
IsANodeStatus returns "true" if the value is listed in the enum definition. "false" otherwise
func (NodeStatus) MarshalJSON ¶
func (i NodeStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface for NodeStatus
func (NodeStatus) MarshalYAML ¶
func (i NodeStatus) MarshalYAML() (interface{}, error)
MarshalYAML implements a YAML Marshaler for NodeStatus
func (*NodeStatus) Scan ¶
func (i *NodeStatus) Scan(value interface{}) error
func (NodeStatus) String ¶
func (i NodeStatus) String() string
func (*NodeStatus) UnmarshalJSON ¶
func (i *NodeStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface for NodeStatus
func (*NodeStatus) UnmarshalYAML ¶
func (i *NodeStatus) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements a YAML Unmarshaler for NodeStatus
func (NodeStatus) Values ¶
func (NodeStatus) Values() []string
type OperatorProfitSnapshot ¶
type RewardedNode ¶ added in v0.4.9
type RewardedNode struct { EpochID uint64 `json:"epochID"` Index int `json:"index"` TransactionHash common.Hash `json:"transactionHash"` NodeAddress common.Address `json:"nodeAddress"` OperationRewards decimal.Decimal `json:"operationRewards"` StakingRewards decimal.Decimal `json:"stakingRewards"` TaxCollected decimal.Decimal `json:"taxCollected"` RequestCount decimal.Decimal `json:"requestCount"` }
type SettlementData ¶
type StakeChip ¶
type StakeChip struct { ID *big.Int `json:"id"` Owner common.Address `json:"owner"` Node common.Address `json:"node"` Value decimal.Decimal `json:"value"` LatestValue decimal.Decimal `json:"latestValue,omitempty"` Metadata json.RawMessage `json:"metadata"` BlockNumber *big.Int `json:"blockNumber"` BlockTimestamp uint64 `json:"blockTimestamp"` }
type StakeChipExporter ¶
type StakeChipImporter ¶
type StakeChipQuery ¶
type StakeChipTransformer ¶
type StakeChipTransformer interface { StakeChipImporter StakeChipExporter }
type StakeChipsQuery ¶
type StakeEvent ¶
type StakeEvent struct { ID common.Hash `json:"id"` Type StakeEventType `json:"type"` TransactionHash common.Hash `json:"transactionHash"` TransactionIndex uint `json:"transactionIndex"` TransactionStatus uint64 `json:"transactionStatus"` BlockHash common.Hash `json:"blockHash"` BlockNumber *big.Int `json:"blockNumber"` BlockTimestamp time.Time `json:"blockTimestamp"` }
type StakeEventExporter ¶
type StakeEventExporter interface {
Export() (*StakeEvent, error)
}
type StakeEventImporter ¶
type StakeEventImporter interface {
Import(stakeEvent StakeEvent) error
}
type StakeEventQuery ¶
type StakeEventTransformer ¶
type StakeEventTransformer interface { StakeEventImporter StakeEventExporter }
type StakeEventType ¶
type StakeEventType string
const ( StakeEventTypeDepositDeposited StakeEventType = "deposited" StakeEventTypeWithdrawRequested StakeEventType = "requested" StakeEventTypeWithdrawClaimed StakeEventType = "claimed" StakeEventTypeStakeStaked StakeEventType = "staked" StakeEventTypeUnstakeRequested StakeEventType = "requested" StakeEventTypeUnstakeClaimed StakeEventType = "claimed" )
type StakeEventsQuery ¶
type StakeRecentCount ¶
type StakeSnapshotTransformer ¶
type StakeSnapshotTransformer interface { StakerCountSnapshotImporter StakerCountSnapshotExporter }
type StakeStaking ¶
type StakeStakingChips ¶
type StakeStakingsQuery ¶
type StakeTransaction ¶
type StakeTransactionExporter ¶
type StakeTransactionExporter interface {
Export() (*StakeTransaction, error)
}
type StakeTransactionImporter ¶
type StakeTransactionImporter interface {
Import(stakeTransaction StakeTransaction) error
}
type StakeTransactionQuery ¶
type StakeTransactionTransformer ¶
type StakeTransactionTransformer interface { StakeTransactionImporter StakeTransactionExporter }
type StakeTransactionType ¶
type StakeTransactionType string
const ( StakeTransactionTypeDeposit StakeTransactionType = "deposit" StakeTransactionTypeWithdraw StakeTransactionType = "withdraw" StakeTransactionTypeStake StakeTransactionType = "stake" StakeTransactionTypeUnstake StakeTransactionType = "unstake" )
type StakeTransactionsQuery ¶
type StakerCountSnapshot ¶
type StakerCountSnapshotExporter ¶
type StakerCountSnapshotExporter interface {
Export() (*StakerCountSnapshot, error)
}
type StakerCountSnapshotImporter ¶
type StakerCountSnapshotImporter interface {
Import(stakeSnapshot StakerCountSnapshot) error
}
type StakerProfitSnapshot ¶
type StakerProfitSnapshot struct { Date time.Time `json:"date"` EpochID uint64 `json:"epochID"` OwnerAddress common.Address `json:"ownerAddress"` TotalChipAmounts decimal.Decimal `json:"totalChipAmounts"` TotalChipValues decimal.Decimal `json:"totalChipValues"` ID uint64 `json:"-"` CreatedAt time.Time `json:"-"` UpdatedAt time.Time `json:"-"` }
type Stat ¶
type Stat struct { Address common.Address `json:"address"` Endpoint string `json:"-"` Score float64 `json:"score"` IsPublicGood bool `json:"isPublicGood"` IsFullNode bool `json:"isFullNode"` IsRssNode bool `json:"isRssNode"` Staking float64 `json:"staking"` Epoch int64 `json:"epoch"` TotalRequest int64 `json:"totalRequest"` EpochRequest int64 `json:"epochRequest"` EpochInvalidRequest int64 `json:"epochInvalidRequest"` DecentralizedNetwork int `json:"decentralizedNetwork"` FederatedNetwork int `json:"federatedNetwork"` Indexer int `json:"indexer"` ResetAt time.Time `json:"resetAt"` }
type StatQuery ¶
type StatQuery struct { Address *common.Address `query:"address" form:"address,omitempty"` Addresses []common.Address `query:"Addresses" form:"addresses,omitempty"` IsFullNode *bool `query:"isFullNode" form:"isFullNode,omitempty"` IsRssNode *bool `query:"isRssNode" form:"isRssNode,omitempty"` PointsOrder *string `query:"pointsOrder" form:"pointsOrder,omitempty"` ValidRequest *int `query:"validRequest" form:"validRequest,omitempty"` Limit *int `query:"limit" form:"limit,omitempty"` Cursor *string `query:"cursor" form:"cursor,omitempty"` }
Source Files ¶
- average_tax_rate_submission.go
- bridge_event.go
- bridge_transaction.go
- checkpoint.go
- epoch.go
- epoch_trigger.go
- node.go
- node_event.go
- node_indexer.go
- node_invalid_response.go
- node_invalid_response_type_string.go
- node_min_tokens_to_stake_snapshot.go
- node_snapshot.go
- node_stat.go
- node_status_string.go
- operator_profit_snapshot.go
- stake_chip.go
- stake_event.go
- stake_staking.go
- stake_transaction.go
- staker_count_snapshot.go
- staker_profit_snapshot.go