Documentation
¶
Index ¶
- Constants
- Variables
- func Plugin() *node.Plugin
- func ProcessPayload(p payload.Payload) interface{}
- type AllowedNodeStr
- type AllowedPledgeIDsMsgData
- type Balance
- type BasicPayload
- type BasicStringPayload
- type Conflict
- type DrngCollectiveBeaconPayload
- type DrngPayload
- type Essence
- type ExplorerAddress
- type ExplorerInclusionState
- type ExplorerMessage
- type ExplorerOutput
- type InputContent
- type ManaBuffer
- func (m *ManaBuffer) SendEvents(ws *websocket.Conn) error
- func (m *ManaBuffer) SendMapOnline(ws *websocket.Conn) error
- func (m *ManaBuffer) SendMapOverall(ws *websocket.Conn) error
- func (m *ManaBuffer) SendValueMsgs(ws *websocket.Conn) error
- func (m *ManaBuffer) StoreEvent(event mana.Event)
- func (m *ManaBuffer) StoreMapOnline(msgs ...*ManaNetworkListMsgData)
- func (m *ManaBuffer) StoreMapOverall(msgs ...*ManaNetworkListMsgData)
- func (m *ManaBuffer) StoreValueMsg(msg *ManaValueMsgData)
- type ManaNetworkListMsgData
- type ManaValueMsgData
- type Opinion
- type OutputContent
- type ParametersDefinition
- type PledgeIDFilter
- type SearchResult
- type StatementPayload
- type Timestamp
- type TransactionPayload
Constants ¶
const ( // MsgTypeNodeStatus is the type of the NodeStatus message. MsgTypeNodeStatus byte = iota // MsgTypeMPSMetric is the type of the message per second (MPS) metric message. MsgTypeMPSMetric // MsgTypeMessage is the type of the message. MsgTypeMessage // MsgTypeNeighborMetric is the type of the NeighborMetric message. MsgTypeNeighborMetric // MsgTypeComponentCounterMetric is the type of the component counter triggered per second. MsgTypeComponentCounterMetric // MsgTypeDrng is the type of the dRNG message. MsgTypeDrng // MsgTypeTipsMetric is the type of the TipsMetric message. MsgTypeTipsMetric // MsgTypeVertex defines a vertex message. MsgTypeVertex // MsgTypeTipInfo defines a tip info message. MsgTypeTipInfo // MsgTypeManaValue defines a mana value message. MsgTypeManaValue // MsgTypeManaMapOverall defines a message containing overall mana map. MsgTypeManaMapOverall // MsgTypeManaMapOnline defines a message containing online mana map. MsgTypeManaMapOnline // MsgTypeManaAllowedPledge defines a message containing a list of allowed mana pledge nodeIDs. MsgTypeManaAllowedPledge // MsgTypeManaPledge defines a message that is sent when mana was pledged to the node. MsgTypeManaPledge // MsgTypeManaInitPledge defines a message that is sent when initial pledge events are sent to the dashboard. MsgTypeManaInitPledge // MsgTypeManaRevoke defines a message that is sent when mana was revoked from a node. MsgTypeManaRevoke // MsgTypeManaInitRevoke defines a message that is sent when initial revoke events are sent to the dashboard. MsgTypeManaInitRevoke // MsgTypeManaInitDone defines a message that is sent when all initial values are sent. MsgTypeManaInitDone // MsgManaDashboardAddress is the socket address of the dashboard to stream mana from. MsgManaDashboardAddress // MsgTypeMsgOpinionFormed defines a tip info message. MsgTypeMsgOpinionFormed // MsgTypeChat defines a chat message. MsgTypeChat )
const PluginName = "Dashboard"
PluginName is the name of the dashboard plugin.
Variables ¶
var ErrForbidden = errors.New("forbidden")
ErrForbidden defines the forbidden error.
var ErrInternalError = errors.New("internal error")
ErrInternalError defines the internal error.
var ErrInvalidParameter = errors.New("invalid parameter")
ErrInvalidParameter defines the invalid parameter error.
var ErrNotFound = errors.New("not found")
ErrNotFound defines the not found error.
var Parameters = &ParametersDefinition{}
Parameters contains the configuration parameters of the dashboard plugin.
Functions ¶
func ProcessPayload ¶
ProcessPayload returns different structs regarding to the payload type.
Types ¶
type AllowedNodeStr ¶ added in v0.5.0
AllowedNodeStr contains the short and full nodeIDs of a node.
type AllowedPledgeIDsMsgData ¶ added in v0.5.0
type AllowedPledgeIDsMsgData struct {
Access PledgeIDFilter `json:"accessFilter"`
Consensus PledgeIDFilter `json:"consensusFilter"`
}
AllowedPledgeIDsMsgData contains information on the allowed pledge ID configuration of the node.
type BasicPayload ¶
type BasicPayload struct {
ContentTitle string `json:"content_title"`
Content []byte `json:"content"`
}
BasicPayload contains content title and bytes It can be reused with different payload that only contains one field.
type BasicStringPayload ¶
type BasicStringPayload struct {
ContentTitle string `json:"content_title"`
Content string `json:"content"`
}
BasicStringPayload contains content title and string content
type DrngCollectiveBeaconPayload ¶
type DrngCollectiveBeaconPayload struct {
Round uint64 `json:"round"`
PrevSig []byte `json:"prev_sig"`
Sig []byte `json:"sig"`
Dpk []byte `json:"dpk"`
}
DrngCollectiveBeaconPayload is the subpayload of DrngPayload.
type DrngPayload ¶
type DrngPayload struct {
SubPayloadType byte `json:"subpayload_type"`
InstanceID uint32 `json:"instance_id"`
SubPayload interface{} `json:"drngpayload"`
}
DrngPayload contains the subtype of drng payload, instance ID and the subpayload
type Essence ¶ added in v0.4.0
type Essence struct {
Version uint8 `json:"version"`
Timestamp int `json:"timestamp"`
AccessPledgeID string `json:"access_pledge_id"`
ConsensusPledgeID string `json:"cons_pledge_id"`
Inputs []*jsonmodels.Output `json:"inputs"`
Outputs []*jsonmodels.Output `json:"outputs"`
Data string `json:"data"`
}
Essence contains the transaction essence information.
type ExplorerAddress ¶
type ExplorerAddress struct {
Address string `json:"address"`
ExplorerOutputs []ExplorerOutput `json:"explorerOutputs"`
}
ExplorerAddress defines the struct of the ExplorerAddress.
type ExplorerInclusionState ¶ added in v0.6.2
type ExplorerInclusionState struct {
Confirmed bool `json:"confirmed,omitempty"`
Rejected bool `json:"rejected,omitempty"`
Liked bool `json:"liked,omitempty"`
Conflicting bool `json:"conflicting,omitempty"`
Finalized bool `json:"finalized,omitempty"`
}
ExplorerInclusionState defines the struct for storing inclusion states for ExplorerOutput
type ExplorerMessage ¶
type ExplorerMessage struct {
// ID is the message ID.
ID string `json:"id"`
// SolidificationTimestamp is the timestamp of the message.
SolidificationTimestamp int64 `json:"solidification_timestamp"`
// The time when this message was issued
IssuanceTimestamp int64 `json:"issuance_timestamp"`
// The issuer's sequence number of this message.
SequenceNumber uint64 `json:"sequence_number"`
// The public key of the issuer who issued this message.
IssuerPublicKey string `json:"issuer_public_key"`
// The shortID of the issuer.
IssuerShortID string `json:"issuer_short_id"`
// The signature of the message.
Signature string `json:"signature"`
// StrongParents are the strong parents (references) of the message.
StrongParents []string `json:"strongParents"`
// WeakParents are the weak parents (references) of the message.
WeakParents []string `json:"weakParents"`
// StrongApprovers are the strong approvers of the message.
StrongApprovers []string `json:"strongApprovers"`
// WeakApprovers are the weak approvers of the message.
WeakApprovers []string `json:"weakApprovers"`
// Solid defines the solid status of the message.
Solid bool `json:"solid"`
BranchID string `json:"branchID"`
Scheduled bool `json:"scheduled"`
ScheduledBypass bool `json:"scheduledBypass"`
Booked bool `json:"booked"`
Eligible bool `json:"eligible"`
Invalid bool `json:"invalid"`
Finalized bool `json:"finalized"`
// PayloadType defines the type of the payload.
PayloadType uint32 `json:"payload_type"`
// Payload is the content of the payload.
Payload interface{} `json:"payload"`
// Structure details
Rank uint64 `json:"rank"`
SequenceID uint64 `json:"sequenceID"`
PastMarkerGap uint64 `json:"pastMarkerGap"`
IsPastMarker bool `json:"isPastMarker"`
PastMarkers string `json:"pastMarkers"`
FutureMarkers string `json:"futureMarkers"`
}
ExplorerMessage defines the struct of the ExplorerMessage.
type ExplorerOutput ¶
type ExplorerOutput struct {
ID *jsonmodels.OutputID `json:"id"`
Output *jsonmodels.Output `json:"output"`
Metadata *jsonmodels.OutputMetadata `json:"metadata"`
InclusionState ExplorerInclusionState `json:"inclusionState"`
TxTimestamp int `json:"txTimestamp"`
PendingMana float64 `json:"pendingMana"`
}
ExplorerOutput defines the struct of the ExplorerOutput.
type InputContent ¶
type InputContent struct {
OutputID string `json:"output_id"`
Address string `json:"address"`
Balances []Balance `json:"balance"`
}
InputContent contains the inputs of a transaction
type ManaBuffer ¶ added in v0.5.0
type ManaBuffer struct {
// Events store PledgedEvent and RevokedEvent structs in chronological order.
Events []mana.Event
ValueMsgs []*ManaValueMsgData
MapOverall map[mana.Type]*ManaNetworkListMsgData
MapOnline map[mana.Type]*ManaNetworkListMsgData
// contains filtered or unexported fields
}
ManaBuffer holds recent data related to mana in the dashboard. Used to fill frontend on page load/reload.
func ManaBufferInstance ¶ added in v0.6.2
func ManaBufferInstance() *ManaBuffer
ManaBufferInstance is the ManaBuffer singleton.
func NewManaBuffer ¶ added in v0.5.0
func NewManaBuffer() *ManaBuffer
NewManaBuffer creates and initializes a new, empty buffer.
func (*ManaBuffer) SendEvents ¶ added in v0.5.0
func (m *ManaBuffer) SendEvents(ws *websocket.Conn) error
SendEvents send all events in the buffer through the provided websocket connection.
func (*ManaBuffer) SendMapOnline ¶ added in v0.5.0
func (m *ManaBuffer) SendMapOnline(ws *websocket.Conn) error
SendMapOnline sends buffered overall mana maps to the provided websocket connection.
func (*ManaBuffer) SendMapOverall ¶ added in v0.5.0
func (m *ManaBuffer) SendMapOverall(ws *websocket.Conn) error
SendMapOverall sends buffered overall mana maps to the provided websocket connection.
func (*ManaBuffer) SendValueMsgs ¶ added in v0.5.0
func (m *ManaBuffer) SendValueMsgs(ws *websocket.Conn) error
SendValueMsgs sends all msgs in the buffer through the provided websocket connection.
func (*ManaBuffer) StoreEvent ¶ added in v0.5.0
func (m *ManaBuffer) StoreEvent(event mana.Event)
StoreEvent stores an event in the buffer. If it is full, drops the oldest event.
func (*ManaBuffer) StoreMapOnline ¶ added in v0.5.0
func (m *ManaBuffer) StoreMapOnline(msgs ...*ManaNetworkListMsgData)
StoreMapOnline stores network mana map msg data.
func (*ManaBuffer) StoreMapOverall ¶ added in v0.5.0
func (m *ManaBuffer) StoreMapOverall(msgs ...*ManaNetworkListMsgData)
StoreMapOverall stores network mana map msg data.
func (*ManaBuffer) StoreValueMsg ¶ added in v0.5.0
func (m *ManaBuffer) StoreValueMsg(msg *ManaValueMsgData)
StoreValueMsg stores a value msg in the buffer. If it is full, drops the oldest msg.
type ManaNetworkListMsgData ¶ added in v0.5.0
type ManaNetworkListMsgData struct {
ManaType string `json:"manaType"`
TotalMana float64 `json:"totalMana"`
Nodes []mana.NodeStr `json:"nodes"`
}
ManaNetworkListMsgData contains a list of mana values for nodes in the network.
type ManaValueMsgData ¶ added in v0.5.0
type ManaValueMsgData struct {
NodeID string `json:"nodeID"`
Access float64 `json:"access"`
Consensus float64 `json:"consensus"`
Time int64 `json:"time"`
}
ManaValueMsgData contains mana values for a particular node.
type OutputContent ¶
type OutputContent struct {
OutputID string `json:"output_id"`
Address string `json:"address"`
Balances []Balance `json:"balance"`
}
OutputContent contains the outputs of a transaction
type ParametersDefinition ¶ added in v0.7.4
type ParametersDefinition struct {
// BindAddress defines the config flag of the dashboard binding address.
BindAddress string `default:"127.0.0.1:8081" usage:"the bind address of the dashboard"`
// Dev defines the config flag of the dashboard dev mode.
Dev bool `default:"false" usage:"whether the dashboard runs in dev mode"`
BasicAuth struct {
// Enabled defines the config flag of the dashboard basic auth enabler.
Enabled bool `default:"false" usage:"whether to enable HTTP basic auth"`
// Username defines the config flag of the dashboard basic auth username.
Username string `default:"goshimmer" usage:"HTTP basic auth username"`
// Password defines the config flag of the dashboard basic auth password.
Password string `default:"goshimmer" usage:"HTTP basic auth password"`
} `name:"basic_auth"`
}
ParametersDefinition contains the definition of configuration parameters used by the dashboard plugin.
type PledgeIDFilter ¶ added in v0.5.0
type PledgeIDFilter struct {
Enabled bool `json:"enabled"`
AllowedNodeIDs []AllowedNodeStr `json:"allowedNodeIDs"`
}
PledgeIDFilter defines if the filter is enabled, and what nodeIDs are allowed.
type SearchResult ¶
type SearchResult struct {
// Message is the *ExplorerMessage.
Message *ExplorerMessage `json:"message"`
// Address is the *ExplorerAddress.
Address *ExplorerAddress `json:"address"`
}
SearchResult defines the struct of the SearchResult.
type StatementPayload ¶ added in v0.3.2
type StatementPayload struct {
Conflicts []Conflict `json:"conflicts"`
Timestamps []Timestamp `json:"timestamps"`
}
StatementPayload is a JSON serializable statement payload.
type TransactionPayload ¶ added in v0.4.0
type TransactionPayload struct {
TxID string `json:"txID"`
Transaction *jsonmodels.Transaction `json:"transaction"`
}
TransactionPayload contains the transaction information.