daemons

package
v0.0.0-...-b8f9f05 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2018 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// I_AM_FULL_NODE is full node flag
	I_AM_FULL_NODE = 1
	// I_AM_NOT_FULL_NODE is not full node flag
	I_AM_NOT_FULL_NODE = 2
)
View Source
const (
	// WordSize is size of word in file
	WordSize = 5
)

Variables

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 IsReachable

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

IsReachable checks if there is blockID on the host

func MarshallBlock

func MarshallBlock(block *model.InfoBlock) []byte

MarshallBlock returns block as []byte

func MarshallTr

func MarshallTr(tr model.Transaction) []byte

MarshallTr returns transaction data

func MarshallTrHash

func MarshallTrHash(tr model.Transaction) []byte

MarshallTrHash returns transaction hash

func Monitoring

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

Monitoring starts monitoring

func Notificate

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

Notificate is sending notifications

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 Scheduler

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

Scheduler starts contracts on schedule

func StartDaemons

func StartDaemons()

StartDaemons starts daemons

func UpdateChain

func UpdateChain(ctx context.Context, d *daemon, host string, maxBlockID int64) 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

This section is empty.

Jump to

Keyboard shortcuts

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