Documentation ¶
Index ¶
- Constants
- Variables
- func BlockGenerator(ctx context.Context, d *daemon) error
- func BlocksCollection(ctx context.Context, d *daemon) error
- func CheckDB() bool
- func Confirmations(ctx context.Context, d *daemon) error
- func DBLock()
- func DBUnlock()
- func Disseminator(ctx context.Context, d *daemon) error
- func IsReachable(host string, blockID int64, ch0 chan string, logger *log.Entry)
- func MarshallBlock(block *model.InfoBlock) []byte
- func MarshallTr(tr model.Transaction) []byte
- func MarshallTrHash(tr model.Transaction) []byte
- func Monitoring(w http.ResponseWriter, r *http.Request)
- func Notificate(ctx context.Context, d *daemon) error
- func QueueParserBlocks(ctx context.Context, d *daemon) error
- func QueueParserTx(ctx context.Context, d *daemon) error
- func Scheduler(ctx context.Context, d *daemon) error
- func StartDaemons()
- func UpdateChain(ctx context.Context, d *daemon, host string, maxBlockID int64) error
- func WaitDB(ctx context.Context) error
- func WaitForSignals()
- func WaitStopTime()
Constants ¶
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 )
const (
// WordSize is size of word in file
WordSize = 5
)
Variables ¶
var ( // MonitorDaemonCh is monitor daemon channel MonitorDaemonCh = make(chan []string, 100) )
var SigChan chan os.Signal
SigChan is a channel
Functions ¶
func BlockGenerator ¶
BlockGenerator is daemon that generates blocks
func BlocksCollection ¶
BlocksCollection collects and parses blocks
func Confirmations ¶
Confirmations gets and checks blocks from nodes Getting amount of nodes, which has the same hash as we do
func Disseminator ¶
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 ¶
IsReachable checks if there is blockID on the host
func MarshallBlock ¶
MarshallBlock returns block as []byte
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 ¶
Notificate is sending notifications
func QueueParserBlocks ¶
QueueParserBlocks parses and applies blocks from the queue
func QueueParserTx ¶
QueueParserTx parses transaction from the queue
func UpdateChain ¶
UpdateChain load from host all blocks from our last block to maxBlockID
Types ¶
This section is empty.