Documentation
¶
Index ¶
- func ServeChainData(config config.HttpConfig)
- type ChainData
- func (c *ChainData) GetCollator(address string) CollatorData
- func (c *ChainData) GetCollators() CollatorData
- func (c *ChainData) GetDelegations(address string) DelegationData
- func (c *ChainData) GetInfo() *ChainInfo
- func (c *ChainData) HandleCollator(w http.ResponseWriter, r *http.Request)
- func (c *ChainData) HandleCollators(w http.ResponseWriter, r *http.Request)
- func (c *ChainData) HandleDelegations(w http.ResponseWriter, r *http.Request)
- func (c *ChainData) HandleHealth(w http.ResponseWriter, r *http.Request)
- func (c *ChainData) HandleInfo(w http.ResponseWriter, r *http.Request)
- func (c *ChainData) StoreToJson(jsonPath string) error
- func (c *ChainData) Update(historyRounds uint32) error
- func (c *ChainData) UpdateFromJson(jsonPath string) error
- type ChainInfo
- type ChainUpdate
- type CollatorData
- type DelegationData
- type DelegationInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ServeChainData ¶
func ServeChainData(config config.HttpConfig)
Types ¶
type ChainData ¶
type ChainData struct {
Info ChainInfo `json:"info"`
Collators []client.CollatorInfo `json:"collators"`
// contains filtered or unexported fields
}
func NewChainData ¶
func (*ChainData) GetCollator ¶
func (c *ChainData) GetCollator(address string) CollatorData
func (*ChainData) GetCollators ¶
func (c *ChainData) GetCollators() CollatorData
func (*ChainData) GetDelegations ¶
func (c *ChainData) GetDelegations(address string) DelegationData
func (*ChainData) HandleCollator ¶
func (c *ChainData) HandleCollator(w http.ResponseWriter, r *http.Request)
func (*ChainData) HandleCollators ¶
func (c *ChainData) HandleCollators(w http.ResponseWriter, r *http.Request)
func (*ChainData) HandleDelegations ¶
func (c *ChainData) HandleDelegations(w http.ResponseWriter, r *http.Request)
func (*ChainData) HandleHealth ¶
func (c *ChainData) HandleHealth(w http.ResponseWriter, r *http.Request)
func (*ChainData) HandleInfo ¶
func (c *ChainData) HandleInfo(w http.ResponseWriter, r *http.Request)
func (*ChainData) StoreToJson ¶
func (*ChainData) UpdateFromJson ¶
type ChainInfo ¶
type ChainInfo struct {
Server string `json:"server"`
Update ChainUpdate `json:"update"`
Chain string `json:"chain"`
SpecVersion int `json:"spec"`
SnapBlock client.SnapBlock `json:"block"`
SnapRound client.SnapRound `json:"round"`
SnapStaking client.SnapStaking `json:"candidate_pool"`
TokenInfo client.TokenInfo `json:"token"`
}
type ChainUpdate ¶
type CollatorData ¶
type CollatorData struct {
Info ChainInfo `json:"info"`
Collators []client.CollatorInfo `json:"collators"`
}
type DelegationData ¶
type DelegationData struct {
Info ChainInfo `json:"info"`
Delegations []DelegationInfo `json:"delegations"`
}
type DelegationInfo ¶
type DelegationInfo struct {
Collator string `json:"collator"`
Address string `json:"address"`
Amount client.TokenBalance `json:"amount"`
RevokeAmount client.TokenBalance `json:"revoke_amount,omitempty"`
RevokeReason string `json:"revoke_reason,omitempty"`
RevokeRound uint32 `json:"revoke_round,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.