messages

package
v0.5.11 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2020 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BroadcastMsg = "broadcast"
	RandsendMsg  = "randsend"
)

Internal msg keys

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseMsg

type BaseMsg struct {
	Type string
	Msg  interface{}
}

BaseMsg base message

func (*BaseMsg) GetMsg

func (m *BaseMsg) GetMsg() interface{}

GetMsg get message

func (*BaseMsg) GetType

func (m *BaseMsg) GetType() string

GetType get message type

func (*BaseMsg) String

func (m *BaseMsg) String() string

type BlockData

type BlockData struct {
	Chain uint64
	Key   []byte
	Data  []byte
}

BlockData response block data

type BlockForMining

type BlockForMining struct {
	BaseMsg
	Chain uint64
	Data  []byte
}

BlockForMining block for mining

type BlockInfo

type BlockInfo struct {
	Chain     uint64
	Index     uint64
	HashPower uint64
	Key       []byte
	User      []byte
	PreKey    []byte
}

BlockInfo response block info

type ChainEvent

type ChainEvent struct {
	BaseMsg
	Chain uint64
	Who   string
	Event string
	Param string
}

ChainEvent ChainEvent

type Mine

type Mine struct {
	BaseMsg
	Chain uint64
	Index uint64
}

Mine Mine

type MinerInfo

type MinerInfo struct {
	BaseMsg
	Total  int
	ID     string
	Online bool
}

MinerInfo Miners

type NewNode

type NewNode struct {
	BaseMsg
	Peer string
}

NewNode new node

type NewTransaction

type NewTransaction struct {
	BaseMsg
	Chain uint64
	Key   []byte
	Data  []byte
}

NewTransaction internal message

type NodeInfo

type NodeInfo struct {
	Alias           string `json:"alias,omitempty"`
	Version         string `json:"version,omitempty"`
	RunTime         int64  `json:"run_time,omitempty"`
	NodesConnected  int    `json:"nodes_connected,omitempty"`
	MinersConnected int    `json:"miners_connected,omitempty"`
	Height          uint64 `json:"height,omitempty"`
}

NodeInfo node info

type RawData

type RawData struct {
	BaseMsg
	Chain     uint64
	Key       []byte
	Broadcast bool
	IsTrans   bool
	Data      []byte
}

RawData raw data

type ReqBlock

type ReqBlock struct {
	Chain uint64
	Index uint64
	Key   []byte
}

ReqBlock request block data

type ReqBlockInfo

type ReqBlockInfo struct {
	Chain uint64
	Index uint64
}

ReqBlockInfo request block info

type ReqTransList

type ReqTransList struct {
	Chain uint64
	Key   []byte
}

ReqTransList request transaction list

type ReqTransaction

type ReqTransaction struct {
	Chain uint64
	Key   []byte
}

ReqTransaction request transaction data

type TransactionData

type TransactionData struct {
	Chain uint64
	Key   []byte
	Data  []byte
}

TransactionData response transaction data

type TransactionInfo

type TransactionInfo struct {
	Chain uint64
	Time  uint64
	Key   []byte
	User  []byte
}

TransactionInfo transaction info

type TransactionList

type TransactionList struct {
	Chain uint64
	Key   []byte
	Data  []byte
}

TransactionList response transaction list

Jump to

Keyboard shortcuts

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