node

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2022 License: BSD-3-Clause Imports: 18 Imported by: 6

Documentation

Index

Constants

View Source
const (
	WalletFile    = "wallet.json"
	LogFile       = "log.svn"
	ConfFile      = "conf.svn"
	DBDir         = "dabtabse"
	ConnTimeOut   = 4
	LogModuleName = "node"
)
View Source
const (
	DefaultBufSize = 1 << 20
)
View Source
const (
	MsgPingTest
)

Variables

View Source
var Version = "1.0.1"

Functions

func ChangeConnCloseTimeOut

func ChangeConnCloseTimeOut(toInSeconds int)

func PrepareConfig

func PrepareConfig(auth, confPath string)

Types

type Config

type Config struct {
	WalletPath string        `json:"wallet.path"`
	DBPath     string        `json:"database"`
	LogPath    string        `json:"log_file"`
	TimeOut    time.Duration `json:"conn_timeout"`
	LogLevel   logging.Level `json:"log_level"`
}

func InitDefaultConfig

func InitDefaultConfig() *Config

func (*Config) String

func (pc *Config) String() string

type CtrlMsg

type CtrlMsg struct {
	Typ int       `json:"typ"`
	PT  *PingTest `json:"pt,omitempty"`
}

func (*CtrlMsg) String

func (mr *CtrlMsg) String() string

type MinerWallet

type MinerWallet struct {
	account.Wallet
}

func WInst

func WInst() *MinerWallet

type MsgAck

type MsgAck struct {
	Typ  int         `json:"typ"`
	Code int         `json:"code"` //0 success 1 failure
	Msg  string      `json:"msg"`
	Data interface{} `json:"data,omitempty"`
}

func (*MsgAck) String

func (ack *MsgAck) String() string

type Node

type Node struct {
	// contains filtered or unexported fields
}

func Inst

func Inst() *Node

func (*Node) CtrlService

func (n *Node) CtrlService()

func (*Node) Mining

func (n *Node) Mining()

func (*Node) StartUp

func (n *Node) StartUp()

func (*Node) Stop

func (n *Node) Stop()

type PingTest

type PingTest struct {
	PayLoad string
}

func (*PingTest) String

func (pt *PingTest) String() string

type ProbeReq

type ProbeReq struct {
	Target string `json:"Target"`
}

type SetupReq

type SetupReq struct {
	IV      network.Salt
	SubAddr account.ID
	MTU     int `json:"mtu,omitempty"`
}

func (*SetupReq) String

func (sr *SetupReq) String() string

Jump to

Keyboard shortcuts

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