mana

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2021 License: Apache-2.0, BSD-2-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const PluginName = "WebAPI Mana Endpoint"

PluginName is the name of the web API mana endpoint plugin.

Variables

This section is empty.

Functions

func GetPendingMana added in v0.5.3

func GetPendingMana(c echo.Context) error

GetPendingMana handles the request.

func Plugin

func Plugin() *node.Plugin

Plugin gets the plugin instance.

Types

type EventLogsJSON

type EventLogsJSON struct {
	Pledge []*mana.PledgedEventJSON `json:"pledge"`
	Revoke []*mana.RevokedEventJSON `json:"revoke"`
}

EventLogsJSON is a events log in JSON.

type GetAllManaResponse

type GetAllManaResponse struct {
	Access             []mana.NodeStr `json:"access"`
	AccessTimestamp    int64          `json:"accessTimestamp"`
	Consensus          []mana.NodeStr `json:"consensus"`
	ConsensusTimestamp int64          `json:"consensusTimestamp"`
	Error              string         `json:"error,omitempty"`
}

GetAllManaResponse is the request to a getAllManaHandler request.

type GetEventLogsRequest

type GetEventLogsRequest struct {
	NodeIDs   []string `json:"nodeIDs"`
	StartTime int64    `json:"startTime"`
	EndTime   int64    `json:"endTime"`
}

GetEventLogsRequest is the request.

type GetEventLogsResponse

type GetEventLogsResponse struct {
	Logs      map[string]*EventLogsJSON `json:"logs"`
	Error     string                    `json:"error,omitempty"`
	StartTime int64                     `json:"startTime"`
	EndTime   int64                     `json:"endTime"`
}

GetEventLogsResponse is the response.

type GetManaRequest

type GetManaRequest struct {
	NodeID string `json:"nodeID"`
}

GetManaRequest is the request for get mana.

type GetManaResponse

type GetManaResponse struct {
	Error              string  `json:"error,omitempty"`
	ShortNodeID        string  `json:"shortNodeID"`
	NodeID             string  `json:"nodeID"`
	Access             float64 `json:"access"`
	AccessTimestamp    int64   `json:"accessTimestamp"`
	Consensus          float64 `json:"consensus"`
	ConsensusTimestamp int64   `json:"consensusTimestamp"`
}

GetManaResponse defines the response for get mana.

type GetNHighestResponse

type GetNHighestResponse struct {
	Error     string         `json:"error,omitempty"`
	Nodes     []mana.NodeStr `json:"nodes,omitempty"`
	Timestamp int64          `json:"timestamp"`
}

GetNHighestResponse holds info about nodes and their mana values.

type GetOnlineResponse

type GetOnlineResponse struct {
	Online    []OnlineNodeStr `json:"online"`
	Error     string          `json:"error,omitempty"`
	Timestamp int64           `json:"timestamp"`
}

GetOnlineResponse is the response to an online mana request.

type GetPercentileRequest

type GetPercentileRequest struct {
	NodeID string `json:"nodeID"`
}

GetPercentileRequest is the request object of mana/percentile.

type GetPercentileResponse

type GetPercentileResponse struct {
	Error              string  `json:"error,omitempty"`
	ShortNodeID        string  `json:"shortNodeID"`
	NodeID             string  `json:"nodeID"`
	Access             float64 `json:"access"`
	AccessTimestamp    int64   `json:"accessTimestamp"`
	Consensus          float64 `json:"consensus"`
	ConsensusTimestamp int64   `json:"consensusTimestamp"`
}

GetPercentileResponse holds info about the mana percentile(s) of a node.

type OnlineNodeStr

type OnlineNodeStr struct {
	OnlineRank int     `json:"rank"`
	ShortID    string  `json:"shortNodeID"`
	ID         string  `json:"nodeID"`
	Mana       float64 `json:"mana"`
}

OnlineNodeStr holds information about online rank, nodeID and mana,

type PastConsensusManaVectorRequest

type PastConsensusManaVectorRequest struct {
	Timestamp int64 `json:"timestamp"`
}

PastConsensusManaVectorRequest is the request.

type PastConsensusManaVectorResponse

type PastConsensusManaVectorResponse struct {
	Consensus []mana.NodeStr `json:"consensus"`
	Error     string         `json:"error,omitempty"`
	TimeStamp int64          `json:"timestamp"`
}

PastConsensusManaVectorResponse is the response.

type PastConsensusVectorMetadataResponse

type PastConsensusVectorMetadataResponse struct {
	Metadata *mana.ConsensusBasePastManaVectorMetadata `json:"metadata,omitempty"`
	Error    string                                    `json:"error,omitempty"`
}

PastConsensusVectorMetadataResponse is the response.

type PendingRequest

type PendingRequest struct {
	OutputID string `json:"outputID"`
}

PendingRequest is the pending mana request.

type PendingResponse

type PendingResponse struct {
	Mana      float64 `json:"mana"`
	OutputID  string  `json:"outputID"`
	Error     string  `json:"error,omitempty"`
	Timestamp int64   `json:"timestamp"`
}

PendingResponse is the pending mana response.

Jump to

Keyboard shortcuts

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