Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ShutdownTracker ¶
type ShutdownTracker struct {
// contains filtered or unexported fields
}
ShutdownTracker is a service that reports previous unclean shutdowns upon start. It needs to be started after a successful start-up and stopped after a successful shutdown, just before the db is closed.
func NewShutdownTracker ¶
func NewShutdownTracker(db ethdb.Database) *ShutdownTracker
NewShutdownTracker creates a new ShutdownTracker instance and has no other side-effect.
func (*ShutdownTracker) MarkStartup ¶
func (t *ShutdownTracker) MarkStartup()
MarkStartup is to be called in the beginning when the node starts. It will: - Push a new startup marker to the db - Report previous unclean shutdowns
func (*ShutdownTracker) Start ¶
func (t *ShutdownTracker) Start()
Start runs an event loop that updates the current marker's timestamp every 5 minutes.
func (*ShutdownTracker) Stop ¶
func (t *ShutdownTracker) Stop()
Stop will stop the update loop and clear the current marker.
Click to show internal directories.
Click to hide internal directories.