masternode

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2018 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ACTIVE_MASTERNODE_INITIAL     = 0 // initial state
	ACTIVE_MASTERNODE_SYNCING     = 2
	ACTIVE_MASTERNODE_NOT_CAPABLE = 3
	ACTIVE_MASTERNODE_STARTED     = 4
)
View Source
const (
	MASTERNODE_PING_INTERVAL = 1200 * time.Second
)
View Source
const (
	MasternodeInit = iota
)

Variables

View Source
var ErrUnknownMasternode = errors.New("unknown masternode")

ErrUnknownMasternode is returned for any requested operation for which no backend provides the specified masternode.

Functions

func GetFreeStorage

func GetFreeStorage() uint64

func GetMasternodeID added in v0.1.5

func GetMasternodeID(ID discover.NodeID) string

Types

type ActiveMasternode added in v0.1.5

type ActiveMasternode struct {
	ID          string
	NodeID      discover.NodeID
	NodeAccount common.Address
	PrivateKey  *ecdsa.PrivateKey

	Addr net.TCPAddr
	// contains filtered or unexported fields
}

Responsible for activating the Masternode and pinging the network

func NewActiveMasternode added in v0.1.5

func NewActiveMasternode(srvr *p2p.Server) *ActiveMasternode

func (*ActiveMasternode) SetState added in v0.1.5

func (am *ActiveMasternode) SetState(state int)

func (*ActiveMasternode) SignHash added in v0.1.5

func (a *ActiveMasternode) SignHash(id string, hash []byte) ([]byte, error)

SignHash calculates a ECDSA signature for the given hash. The produced signature is in the [R || S || V] format where V is 0 or 1.

func (*ActiveMasternode) State added in v0.1.5

func (am *ActiveMasternode) State() int

type Masternode added in v0.1.5

type Masternode struct {
	ID          string
	NodeID      discover.NodeID
	Account     common.Address
	OriginBlock *big.Int
	State       int

	BlockOnlineAcc *big.Int
	BlockLastPing  *big.Int
}

func New added in v0.1.5

func New(nodeId discover.NodeID, account common.Address, block, blockOnlineAcc, blockLastPing *big.Int) *Masternode

func (*Masternode) String added in v0.1.5

func (n *Masternode) String() string

Jump to

Keyboard shortcuts

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