daemons

package
v0.0.0-...-8e17a21 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2020 License: GPL-2.0 Imports: 41 Imported by: 6

Documentation

Index

Constants

View Source
const (
	// WordSize is size of word in file
	WordSize = 5
)

Variables

View Source
var (
	// ErrNodesUnavailable is returned when all nodes is unavailable
	ErrNodesUnavailable = errors.New("All nodes unavailable")
)
View Source
var (
	// MonitorDaemonCh is monitor daemon channel
	MonitorDaemonCh = make(chan []string, 100)
)
View Source
var SigChan chan os.Signal

SigChan is a channel

Functions

func BlockGenerator

func BlockGenerator(ctx context.Context, d *daemon) error

BlockGenerator is daemon that generates blocks

func BlocksCollection

func BlocksCollection(ctx context.Context, d *daemon) error

BlocksCollection collects and parses blocks

func CheckDB

func CheckDB() bool

CheckDB check if installation complete or not

func Confirmations

func Confirmations(ctx context.Context, d *daemon) error

Confirmations gets and checks blocks from nodes Getting amount of nodes, which has the same hash as we do

func DBLock

func DBLock()

DBLock locks daemons

func DBUnlock

func DBUnlock()

DBUnlock unlocks database

func Disseminator

func Disseminator(ctx context.Context, d *daemon) error

Disseminator is send to all nodes from nodes_connections the following data if we are full node(miner): sends blocks and transactions hashes else send the full transactions

func ExternalNetwork

func ExternalNetwork(ctx context.Context, d *daemon) error

ExternalNetwork sends txinfo to the external network

func InitialLoad

func InitialLoad(logger *log.Entry) error

func IsReachable

func IsReachable(host string, blockID int64, ch0 chan string, logger *log.Entry)

IsReachable checks if there is blockID on the host

func Monitoring

func Monitoring(w http.ResponseWriter, r *http.Request)

Monitoring starts monitoring

func QueueParserBlocks

func QueueParserBlocks(ctx context.Context, d *daemon) error

QueueParserBlocks parses and applies blocks from the queue

func QueueParserTx

func QueueParserTx(ctx context.Context, d *daemon) error

QueueParserTx parses transaction from the queue

func ReplaceBlocksFromHost

func ReplaceBlocksFromHost(ctx context.Context, host string, blockID, replaceCount int64) error

ReplaceBlocksFromHost replaces blockchain received from the host. Number (replaceCount) of blocks starting from blockID will be re-played.

func Scheduler

func Scheduler(ctx context.Context, d *daemon) error

Scheduler starts contracts on schedule

func SendExternalTransaction

func SendExternalTransaction() error

func StartDaemons

func StartDaemons(ctx context.Context, daemonsToStart []string)

StartDaemons starts daemons

func UpdateChain

func UpdateChain(ctx context.Context, d *daemon, host string, maxBlockID int64) (err error)

UpdateChain load from host all blocks from our last block to maxBlockID

func WaitDB

func WaitDB(ctx context.Context) error

WaitDB waits for the end of the installation

func WaitForSignals

func WaitForSignals()

WaitForSignals waits for Interrupt os.Kill signals

func WaitStopTime

func WaitStopTime()

WaitStopTime closes the database and stop daemons

Types

type DelayedTx

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

DelayedTx represents struct which works with delayed contracts

func (*DelayedTx) RunForBlockID

func (dtx *DelayedTx) RunForBlockID(blockID int64)

RunForBlockID creates the transactions that need to be run for blockID

Jump to

Keyboard shortcuts

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