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
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 (*Masternode) String ¶ added in v0.1.5
func (n *Masternode) String() string
Click to show internal directories.
Click to hide internal directories.