Documentation ¶
Index ¶
- Variables
- func BlockGenerator(ctx context.Context, d *daemon) error
- func BlockGeneratorCandidate(ctx context.Context, d *daemon) error
- func BlocksCollection(ctx context.Context, d *daemon) error
- func CandidateNodeVoting(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 ExternalNetwork(ctx context.Context, d *daemon) error
- func GetCandidateNodePositionByPublicKey() (int64, error)
- func GetCandidateNodes() (sqldb.CandidateNodes, error)
- func GetRemoteGoodHosts() ([]string, error)
- func GetThisNodePosition(candidateNodes sqldb.CandidateNodes, prevBlock *sqldb.InfoBlock) (sqldb.CandidateNode, bool)
- func InitialLoad(logger *log.Entry) error
- func IsReachable(host string, blockID int64, ch0 chan string, logger *log.Entry)
- func Monitoring(w http.ResponseWriter, r *http.Request)
- func Ntp_Work(ctx context.Context)
- func QueueParserBlocks(ctx context.Context, d *daemon) error
- func QueueParserTx(ctx context.Context, d *daemon) error
- func ReplaceBlocksFromHost(ctx context.Context, host string, blockID, replaceCount int64) error
- func Scheduler(ctx context.Context, d *daemon) error
- func SendExternalTransaction() error
- func StartDaemons(ctx context.Context, daemonsToStart []string)
- func ToBroadcastNodeConnInfo(votingTotal VotingTotal, tcpAddress string, logger *log.Entry) error
- func ToUpdateMachineStatus(currentTcpAddress, tcpAddress string, ch chan map[string]VotingRes, ...) error
- func UpdateChain(ctx context.Context, d *daemon, host string, maxBlockID int64) error
- func WaitDB(ctx context.Context) error
- func WaitForSignals()
- func WaitStopTime()
- type CandidateNodeMode
- type DelayedTx
- type HonorNodeMode
- type Model
- type SelectModel
- type VotingRes
- type VotingTotal
Constants ¶
This section is empty.
Variables ¶
var ( // MonitorDaemonCh is monitor daemon channel MonitorDaemonCh = make(chan []string, 100) NtpDriftFlag = false )
var SigChan chan os.Signal
SigChan is a channel
Functions ¶
func BlockGenerator ¶
BlockGenerator is daemon that generates blocks
func BlockGeneratorCandidate ¶
func BlocksCollection ¶
BlocksCollection collects and parses blocks
func CandidateNodeVoting ¶
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 honor node: sends blocks and transactions hashes else send the full transactions
func ExternalNetwork ¶
ExternalNetwork sends txinfo to the external network
func GetCandidateNodes ¶
func GetCandidateNodes() (sqldb.CandidateNodes, error)
func GetRemoteGoodHosts ¶
func GetThisNodePosition ¶
func GetThisNodePosition(candidateNodes sqldb.CandidateNodes, prevBlock *sqldb.InfoBlock) (sqldb.CandidateNode, bool)
func InitialLoad ¶
func IsReachable ¶
IsReachable checks if there is blockID on the host
func Monitoring ¶
func Monitoring(w http.ResponseWriter, r *http.Request)
Monitoring starts monitoring
func QueueParserBlocks ¶
QueueParserBlocks parses and applies blocks from the queue
func QueueParserTx ¶
QueueParserTx parses transaction from the queue
func ReplaceBlocksFromHost ¶
ReplaceBlocksFromHost replaces blockchain received from the host. Number (replaceCount) of blocks starting from blockID will be re-played.
func SendExternalTransaction ¶
func SendExternalTransaction() error
func StartDaemons ¶
StartDaemons starts daemons
func ToBroadcastNodeConnInfo ¶
func ToBroadcastNodeConnInfo(votingTotal VotingTotal, tcpAddress string, logger *log.Entry) error
func ToUpdateMachineStatus ¶
func UpdateChain ¶
UpdateChain load from host all blocks from our last block to maxBlockID
Types ¶
type CandidateNodeMode ¶
type CandidateNodeMode struct { }
func (*CandidateNodeMode) GetHostWithMaxID ¶
func (candidateNodeMode *CandidateNodeMode) GetHostWithMaxID() ([]string, error)
func (*CandidateNodeMode) GetThisNodePosition ¶
func (candidateNodeMode *CandidateNodeMode) GetThisNodePosition() (int64, error)
type DelayedTx ¶
type DelayedTx struct {
// contains filtered or unexported fields
}
DelayedTx represents struct which works with delayed contracts
func (*DelayedTx) RunForDelayBlockID ¶
func (dtx *DelayedTx) RunForDelayBlockID(blockID int64) ([]*sqldb.Transaction, error)
RunForDelayBlockID creates the transactions that need to be run for blockID
type HonorNodeMode ¶
type HonorNodeMode struct { }
func (*HonorNodeMode) GetHostWithMaxID ¶
func (honorNodeMode *HonorNodeMode) GetHostWithMaxID() ([]string, error)
func (*HonorNodeMode) GetThisNodePosition ¶
func (honorNodeMode *HonorNodeMode) GetThisNodePosition() (int64, error)
type SelectModel ¶
type SelectModel struct { }
func (*SelectModel) GetHostWithMaxID ¶
func (s *SelectModel) GetHostWithMaxID() ([]string, error)
func (*SelectModel) GetThisNodePosition ¶
func (s *SelectModel) GetThisNodePosition() (int64, error)
func (SelectModel) GetWorkMode ¶
func (s SelectModel) GetWorkMode() Model
Source Files ¶
- block_generator.go
- block_generator_candidate.go
- block_generator_tx.go
- blocks_collection.go
- candidate_node_votings.go
- common.go
- confirmations.go
- disseminator.go
- external_network.go
- genesis.go
- locking.go
- mode.go
- monitoring.go
- queue_parser_blocks.go
- queue_parser_tx.go
- scheduler.go
- stopdaemons.go
- upd_full_nodes.go
- wait_for_signals.go