Documentation
¶
Overview ¶
Package config reads and manages configuration files
Index ¶
- Variables
- func EstablishCachePaths(cachePath string)
- func EstablishIndexPaths(indexPath string)
- func ExpectedVersion() string
- func GetChain(chain string) chainGroup
- func GetChains() []chainGroup
- func GetKey(set string) keyGroup
- func GetPinning() pinningGroup
- func GetPublisher(value string) string
- func GetSettings() settingsGroup
- func GetUnchained() unchainedGroup
- func GetVersion() versionGroup
- func HeaderHash(version string) []byte
- func IpfsRunning() bool
- func IsChainConfigured(needle string) bool
- func KnownVersionTag(tag string) bool
- func MergeScrapeConfig(fn string, scrape *ScrapeSettings) error
- func MustGetPathToChainConfig(chain string) string
- func PathToCache(chain string) string
- func PathToChainConfig(chain string) (string, error)
- func PathToConfigFile() string
- func PathToIndex(chain string) string
- func PathToManifest(chain string) string
- func PathToRootConfig() string
- func PathToTimestamps(chain string) string
- func ReadToml(inFile string, destination interface{}) error
- func SetExpectedVersion(version string)
- func SetScrapeArgs(chain string, args map[string]string)
- type ConfigFile
- type OldScrape
- type ScrapeSettings
Constants ¶
This section is empty.
Variables ¶
var SpecTags = map[string]string{
"trueblocks-core@v0.40.0": "QmUou7zX2g2tY58LP1A2GyP5RF9nbJsoxKTp299ah3svgb",
"trueblocks-core@v2.0.0-release": "QmUyyU8wKW57c3CuwphhMdZb2QA5bsjt9vVfTE6LcBKmE9",
}
SpecTags allows us to go from a version string to an IPFS hash pointing to the spec
var VersionTags = map[string]string{
"0x81ae14ba68e372bc9bd4a295b844abd8e72b1de10fcd706e624647701d911da1": "trueblocks-core@v0.40.0",
"0x6fc0c6dd027719f456c1e50a329f6157767325aa937411fa6e7be9359d9e0046": "trueblocks-core@v2.0.0-release",
}
VersionTags allows us to go from the version bytes found in the chunks to a version string
Functions ¶
func EstablishCachePaths ¶
func EstablishCachePaths(cachePath string)
EstablishCachePaths sets up the cache folders and subfolders. It only returns if it succeeds.
func EstablishIndexPaths ¶
func EstablishIndexPaths(indexPath string)
EstablishIndexPaths sets up the index path and subfolders. It only returns if it succeeds.
func ExpectedVersion ¶
func ExpectedVersion() string
func GetChains ¶
func GetChains() []chainGroup
GetChains returns a list of all chains configured in the config file. Note, there is no "official" list. Users may add their own chains.
func GetPinning ¶
func GetPinning() pinningGroup
func GetPublisher ¶
func GetSettings ¶
func GetSettings() settingsGroup
func GetUnchained ¶
func GetUnchained() unchainedGroup
func GetVersion ¶
func GetVersion() versionGroup
func HeaderHash ¶
func IpfsRunning ¶
func IpfsRunning() bool
func IsChainConfigured ¶
IsChainConfigured returns true if the chain is configured in the config file.
func KnownVersionTag ¶
func MergeScrapeConfig ¶
func MergeScrapeConfig(fn string, scrape *ScrapeSettings) error
func MustGetPathToChainConfig ¶
MustGetPathToChainConfig returns the chain-specific config folder ignoring errors
func PathToCache ¶
PathToCache returns the one and only cachePath
func PathToChainConfig ¶
PathToChainConfig returns the chain-specific config folder
func PathToConfigFile ¶
func PathToConfigFile() string
PathToConfigFile returns the path where to find the configuration file
func PathToIndex ¶
PathToIndex returns the one and only indexPath
func PathToManifest ¶
PathToManifest returns the path to the manifest database per chain
func PathToRootConfig ¶
func PathToRootConfig() string
PathToRootConfig returns the path where to find configuration files
func PathToTimestamps ¶
PathToTimestamps returns the path to the timestamps database per chain
func SetExpectedVersion ¶
func SetExpectedVersion(version string)
func SetScrapeArgs ¶
Types ¶
type ConfigFile ¶
type ConfigFile struct { Version versionGroup `toml:"version"` Settings settingsGroup `toml:"settings"` Keys map[string]keyGroup `toml:"keys"` Pinning pinningGroup `toml:"pinning"` Unchained unchainedGroup `toml:"unchained,omitempty" comment:"Do not edit these values unless instructed to do so."` Chains map[string]chainGroup `toml:"chains"` }
func GetRootConfig ¶
func GetRootConfig() *ConfigFile
GetRootConfig reads and the configuration located in trueBlocks.toml file. Note that this routine is local to the package
type ScrapeSettings ¶
type ScrapeSettings struct { AppsPerChunk uint64 `toml:"appsPerChunk" json:"appsPerChunk"` SnapToGrid uint64 `toml:"snapToGrid" json:"snapToGrid"` FirstSnap uint64 `toml:"firstSnap" json:"firstSnap"` UnripeDist uint64 `toml:"unripeDist" json:"unripeDist"` AllowMissing bool `toml:"allowMissing" json:"allowMissing,omitempty"` ChannelCount uint64 `toml:"channelCount" json:"channelCount,omitempty"` }
ScrapeSettings carries config information for the scraper
func GetScrape ¶
func GetScrape(chain string) ScrapeSettings
GetScrape returns the scraper settings per chain
func (*ScrapeSettings) TestLog ¶
func (s *ScrapeSettings) TestLog(chain string, test bool)