Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type App ¶
type App struct { Logger *slog.Logger Config config.Config InitMode InitMode Monitor OnOff Api OnOff Sleep int BlockCnt int LogLevel slog.Level }
App is the main struct for the app. It contains the logger, the configuration, and the state of the app.
func (*App) EstablishConfig ¶
EstablishConfig either reads an existing configuration file or creates it if it doesn't exist.
func (*App) ParseArgs ¶
ParseArgs parses the command line options and sets the app's configuration accordingly. See README.md or run trueblocks-node --help.
func (*App) ReportOneScrape ¶ added in v3.5.0
func (a *App) ReportOneScrape(report *scraperReport)
func (*App) RunMonitor ¶
RunMonitor is a function that runs in a goroutine to monitor addresses.
func (*App) RunScraper ¶
RunScraper runs the scraper in a goroutine. It will scrape the chains in the configuration file and sleep between each run for the duration specified with --sleep.
type CustomHandler ¶ added in v3.5.0
type CustomHandler struct {
// contains filtered or unexported fields
}
type Feature ¶
type Feature string
Feature is a type that represents the features of the app
const ( // Scrape represents the scraper feature. The scraper may not be disabled. Scrape Feature = "scrape" // Monitor represents the monitor feature. The monitor is Off by default. Enable // it with the `--monitor on` option. Monitor Feature = "monitor" // Api represents the API feature. The api is On by default. Disable it // with the `--api off` option. Api Feature = "api" )
type InitMode ¶
type InitMode string
InitMode is a type that represents the initialization for the Unchained Index. It applies to the `--init` option.
const ( // All cause the initialization to download both the bloom filters and the index // portions of the Unchained Index. All InitMode = "all" // Blooms cause the initialization to download only the bloom filters portion of // the Unchained Index. Blooms InitMode = "blooms" // None cause the app to not download any part of the Unchained Index. It will be // built from scratch with the scraper. None InitMode = "none" )