onroad

package
v1.2.3-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2019 License: GPL-3.0 Imports: 22 Imported by: 8

Documentation

Index

Constants

View Source
const (
	Create = iota
	Start
	Stop
)

Variables

View Source
var (
	POMAXPROCS                = runtime.NumCPU()
	CommonFetchSize           = 4 * POMAXPROCS
	ContractTaskProcessorSize = 2 * POMAXPROCS
	ContractFetchSize         = 2 * POMAXPROCS
)
View Source
var (
	ErrNotSyncDone = errors.New("network synchronization is not complete")
)

Functions

This section is empty.

Types

type AutoReceiveWorker

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

func NewAutoReceiveWorker

func NewAutoReceiveWorker(manager *Manager, entropystore string, address types.Address, filters map[types.TokenTypeId]big.Int, powDifficulty *big.Int) *AutoReceiveWorker

func (*AutoReceiveWorker) Close

func (w *AutoReceiveWorker) Close() error

func (AutoReceiveWorker) GetEntropystore

func (w AutoReceiveWorker) GetEntropystore() string

func (*AutoReceiveWorker) NewOnroadTxAlarm

func (w *AutoReceiveWorker) NewOnroadTxAlarm()

func (*AutoReceiveWorker) ProcessOneBlock

func (w *AutoReceiveWorker) ProcessOneBlock(sendBlock *ledger.AccountBlock)

func (*AutoReceiveWorker) ResetAutoReceiveFilter

func (w *AutoReceiveWorker) ResetAutoReceiveFilter(filters map[types.TokenTypeId]big.Int)

func (AutoReceiveWorker) ResetPowDifficulty added in v1.2.0

func (w AutoReceiveWorker) ResetPowDifficulty(powDifficulty *big.Int)

func (*AutoReceiveWorker) Start

func (w *AutoReceiveWorker) Start()

func (AutoReceiveWorker) Status

func (w AutoReceiveWorker) Status() int

func (*AutoReceiveWorker) Stop

func (w *AutoReceiveWorker) Stop()

type ContractTaskProcessor

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

func NewContractTaskProcessor

func NewContractTaskProcessor(worker *ContractWorker, index int) *ContractTaskProcessor

func (*ContractTaskProcessor) Close

func (tp *ContractTaskProcessor) Close() error

func (*ContractTaskProcessor) Start

func (tp *ContractTaskProcessor) Start()

func (*ContractTaskProcessor) Status

func (tp *ContractTaskProcessor) Status() int

func (*ContractTaskProcessor) Stop

func (tp *ContractTaskProcessor) Stop()

func (*ContractTaskProcessor) WakeUp

func (tp *ContractTaskProcessor) WakeUp()

type ContractWorker

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

func NewContractWorker

func NewContractWorker(manager *Manager) *ContractWorker

func (*ContractWorker) Close

func (w *ContractWorker) Close() error

func (*ContractWorker) GetPledgeQuota added in v1.3.0

func (w *ContractWorker) GetPledgeQuota(addr types.Address) uint64

func (*ContractWorker) GetPledgeQuotas added in v1.3.0

func (w *ContractWorker) GetPledgeQuotas(beneficialList []types.Address) map[types.Address]uint64

func (*ContractWorker) NewOnroadTxAlarm

func (w *ContractWorker) NewOnroadTxAlarm()

func (*ContractWorker) Start

func (w *ContractWorker) Start(accEvent producerevent.AccountStartEvent)

func (ContractWorker) Status

func (w ContractWorker) Status() int

func (*ContractWorker) Stop

func (w *ContractWorker) Stop()

type Manager

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

func NewManager

func NewManager(net Net, pool Pool, producer Producer, wallet *wallet.Manager) *Manager

func (Manager) Chain

func (manager Manager) Chain() chain.Chain

func (*Manager) Close

func (manager *Manager) Close() error

func (Manager) DbAccess

func (manager Manager) DbAccess() *model.UAccess

func (Manager) GetOnroadBlocksPool

func (manager Manager) GetOnroadBlocksPool() *model.OnroadBlocksPool

func (*Manager) Init

func (manager *Manager) Init(chain chain.Chain)

func (Manager) ListWorkingAutoReceiveWorker

func (manager Manager) ListWorkingAutoReceiveWorker() []types.Address

func (Manager) Net

func (manager Manager) Net() Net

func (Manager) Producer

func (manager Manager) Producer() Producer

func (*Manager) ResetAutoReceiveFilter

func (manager *Manager) ResetAutoReceiveFilter(addr types.Address, filter map[types.TokenTypeId]big.Int)

func (*Manager) Start

func (manager *Manager) Start()

func (*Manager) StartAutoReceiveWorker

func (manager *Manager) StartAutoReceiveWorker(entropystore string, addr types.Address, filter map[types.TokenTypeId]big.Int, powDifficulty *big.Int) error

func (*Manager) Stop

func (manager *Manager) Stop()

func (*Manager) StopAutoReceiveWorker

func (manager *Manager) StopAutoReceiveWorker(addr types.Address) error

type Net

type Net interface {
	SubscribeSyncStatus(fn func(net.SyncState)) (subId int)
	UnsubscribeSyncStatus(subId int)
	SyncState() net.SyncState
}

type Pool

type Pool interface {
	ExistInPool(address types.Address, fromBlockHash types.Hash) bool
	AddDirectAccountBlock(address types.Address, vmAccountBlock *vm_context.VmAccountBlock) error
	AddDirectAccountBlocks(address types.Address, received *vm_context.VmAccountBlock, sendBlocks []*vm_context.VmAccountBlock) error
}

type Producer

type Producer interface {
	SetAccountEventFunc(func(producerevent.AccountEvent))
}

type SimpleAutoReceiveFilterPair

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

type Worker

type Worker interface {
	Status() int
	Start()
	Stop()
	Close() error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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