dashboard

package
v0.2.4-0...-2c2ceb1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2020 License: Apache-2.0, BSD-2-Clause Imports: 49 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CfgBindAddress defines the config flag of the dashboard binding address.
	CfgBindAddress = "dashboard.bindAddress"
	// CfgDev defines the config flag of the  dashboard dev mode.
	CfgDev = "dashboard.dev"
	// CfgBasicAuthEnabled defines the config flag of the dashboard basic auth enabler.
	CfgBasicAuthEnabled = "dashboard.basic_auth.enabled"
	// CfgBasicAuthUsername defines the config flag of the dashboard basic auth username.
	CfgBasicAuthUsername = "dashboard.basic_auth.username"
	// CfgBasicAuthPassword defines the config flag of the dashboard basic auth password.
	CfgBasicAuthPassword = "dashboard.basic_auth.password"
)
View Source
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
	// 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
)
View Source
const PluginName = "Dashboard"

PluginName is the name of the dashboard plugin.

Variables

View Source
var ErrForbidden = errors.New("forbidden")

ErrForbidden defines the forbidden error.

View Source
var ErrInternalError = errors.New("internal error")

ErrInternalError defines the internal error.

View Source
var ErrInvalidParameter = errors.New("invalid parameter")

ErrInvalidParameter defines the invalid parameter error.

View Source
var ErrNotFound = errors.New("not found")

ErrNotFound defines the not found error.

Functions

func Plugin

func Plugin() *node.Plugin

Plugin gets the plugin instance.

func ProcessPayload

func ProcessPayload(p payload.Payload) interface{}

ProcessPayload returns different structs regarding to the payload type.

Types

type Balance

type Balance struct {
	Value int64  `json:"value"`
	Color string `json:"color"`
}

Balance contains the amount of specific color token

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 Beacon

type Beacon struct {
	MsgID    string `json:"msg_id"`
	SentTime int64  `json:"sent_time"`
	Synced   bool   `json:"synced"`
}

Beacon contains a sync beacons detailed status.

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 ExplorerAddress

type ExplorerAddress struct {
	Address   string           `json:"address"`
	OutputIDs []ExplorerOutput `json:"output_ids"`
}

ExplorerAddress defines the struct of the ExplorerAddress.

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 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"`
	// Solid defines the solid status of the message.
	Solid bool `json:"solid"`
	// PayloadType defines the type of the payload.
	PayloadType uint32 `json:"payload_type"`
	// Payload is the content of the payload.
	Payload interface{} `json:"payload"`
}

ExplorerMessage defines the struct of the ExplorerMessage.

type ExplorerOutput

type ExplorerOutput struct {
	ID                 string                    `json:"id"`
	Balances           []valueutils.Balance      `json:"balances"`
	InclusionState     valueutils.InclusionState `json:"inclusion_state"`
	SolidificationTime int64                     `json:"solidification_time"`
	ConsumerCount      int                       `json:"consumer_count"`
}

ExplorerOutput defines the struct of the ExplorerOutput.

type InputContent

type InputContent struct {
	Address string `json:"address"`
}

InputContent contains the inputs of a transaction

type OutputContent

type OutputContent struct {
	Address  string    `json:"address"`
	Balances []Balance `json:"balance"`
}

OutputContent contains the outputs of a transaction

type ReqMsg

type ReqMsg struct {
	ID string `json:"MsgId"`
}

ReqMsg defines the struct of the faucet request message ID.

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 SyncBeaconPayload

type SyncBeaconPayload struct {
	SentTime int64 `json:"sent_time"`
}

SyncBeaconPayload contains sent time of a sync beacon.

type ValuePayload

type ValuePayload struct {
	ID        string          `json:"payload_id"`
	Parent1ID string          `json:"parent1_id"`
	Parent2ID string          `json:"parent2_id"`
	TxID      string          `json:"tx_id"`
	Input     []InputContent  `json:"inputs"`
	Output    []OutputContent `json:"outputs"`
	Data      []byte          `json:"data"`
}

ValuePayload contains the transaction information

Jump to

Keyboard shortcuts

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