minerpool

package
v0.0.0-...-e287cc3 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2022 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MinerPoolStatusSize = 4 * 12
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

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

func NewAccountByPeriod

func NewAccountByPeriod(address fields.Address, period *RealtimePeriod) *Account

func (*Account) CopyByPeriod

func (a *Account) CopyByPeriod(period *RealtimePeriod) *Account

func (*Account) GetAddress

func (a *Account) GetAddress() fields.Address

func (*Account) GetClientCount

func (a *Account) GetClientCount() int

func (*Account) GetRealtimePowWorth

func (a *Account) GetRealtimePowWorth() *big.Int

func (*Account) GetStoreData

func (a *Account) GetStoreData() *AccountStoreData

type AccountStoreData

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

func NewEmptyAccountStoreData

func NewEmptyAccountStoreData(curhei uint64) *AccountStoreData

func (*AccountStoreData) GetFinds

func (s *AccountStoreData) GetFinds() (int, int)

func (*AccountStoreData) GetRewards

func (s *AccountStoreData) GetRewards() (int64, int64, int64)

func (*AccountStoreData) Parse

func (s *AccountStoreData) Parse(buf []byte, seek uint32) (uint32, error)

func (*AccountStoreData) Serialize

func (s *AccountStoreData) Serialize() ([]byte, error)

func (*AccountStoreData) Size

func (s *AccountStoreData) Size() uint32

type Client

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

func NewClient

func NewClient(acc *Account, conn *net.TCPConn) *Client

type MinerPool

type MinerPool struct {
	Config *MinerPoolConfig
	// contains filtered or unexported fields
}

func NewMinerPool

func NewMinerPool(cnf *MinerPoolConfig) *MinerPool

func (*MinerPool) Excavate

func (p *MinerPool) Excavate(inputBlock interfaces.Block, outputBlockCh chan interfaces.Block)

func (*MinerPool) GetCurrentAddressCount

func (p *MinerPool) GetCurrentAddressCount() int

func (*MinerPool) GetCurrentMiningAccounts

func (p *MinerPool) GetCurrentMiningAccounts() map[string]*Account

func (*MinerPool) GetCurrentRealtimePeriod

func (p *MinerPool) GetCurrentRealtimePeriod() *RealtimePeriod

func (*MinerPool) GetCurrentTcpConnectingCount

func (p *MinerPool) GetCurrentTcpConnectingCount() int

func (*MinerPool) SetBlockChain

func (p *MinerPool) SetBlockChain(blockchain interfaces.BlockChain)

func (*MinerPool) SetTxPool

func (p *MinerPool) SetTxPool(tp interfaces.TxPool)

func (*MinerPool) Start

func (p *MinerPool) Start() error

func (*MinerPool) StopMining

func (p *MinerPool) StopMining()

stop all

type MinerPoolConfig

type MinerPoolConfig struct {
	Datadir           string
	TcpListenPort     int
	TcpConnectMaxSize uint
	FeePercentage     float64
	RewardAccount     *account.Account
	///////////////////////////////
	DelayedConfirmRewardHeight   int
	DoTransferRewardPeriodHeight int
}

func NewEmptyMinerPoolConfig

func NewEmptyMinerPoolConfig() *MinerPoolConfig

func NewMinerPoolConfig

func NewMinerPoolConfig(cnffile *sys.Inicnf) *MinerPoolConfig

type MinerPoolStatus

type MinerPoolStatus struct {
	FindBlockHashHeightTableLastestNumber fields.VarUint4 // Latest value of excavated block ID table
	TransferHashTableLastestNumber        fields.VarUint4 // Latest value of transfer serial number table
}

func NewEmptyMinerPoolStatus

func NewEmptyMinerPoolStatus() *MinerPoolStatus

func (*MinerPoolStatus) Parse

func (s *MinerPoolStatus) Parse(buf []byte, seek uint32) (uint32, error)

func (*MinerPoolStatus) Serialize

func (s *MinerPoolStatus) Serialize() ([]byte, error)

func (*MinerPoolStatus) Size

func (s *MinerPoolStatus) Size() uint32

type RealtimePeriod

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

func NewRealtimePeriod

func NewRealtimePeriod(minerpool *MinerPool, block interfaces.Block) *RealtimePeriod

func (*RealtimePeriod) GetAccounts

func (r *RealtimePeriod) GetAccounts() []*Account

func (*RealtimePeriod) IsOverEndBlock

func (r *RealtimePeriod) IsOverEndBlock(blkheibts []byte) bool

type SettlementPeriod

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

type WorkItem

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

func NewWorkItem

func NewWorkItem(cli *Client, blk interfaces.Block, num uint32) *WorkItem

Jump to

Keyboard shortcuts

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