miner

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Address  string `json:"address"`
	Balance  uint64 `json:"balance"`
	NonceCap uint64 `json:"nonceCap"`
}

Account represents individual account of a particular person mining

func (*Account) LookupStakeWeight

func (account *Account) LookupStakeWeight(
	now uint64,
	until *blockchain.Block,
	nonceCap uint64,
	chain *blockchain.Blockchain,
) (weight uint64)

*

  • Implements stake amount calculation. *
  • POS-3: Stake maturity period
  • POS-4: Stake amount
  • POS-22: Partial stake amount *
  • This is a basic helper for stake amount calculation.
  • There are ways to optimize it for high load, but we need something
  • to start with.

type Staker

type Staker struct {
	Name     string    `json:"name"`
	Accounts []Account `json:"accounts"`
}

Staker is individual person mining with accoount(s)

func (*Staker) Mine

func (staker *Staker) Mine(chain *blockchain.Blockchain)

Mine starts separate mining routines for each account

Jump to

Keyboard shortcuts

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