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) configtypes.ChainGroup
- func GetChains() []configtypes.ChainGroup
- func GetKey(set string) configtypes.KeyGroup
- func GetPinning() configtypes.PinningGroup
- func GetPublisher(value string) string
- func GetRootConfig() *configtypes.Config
- func GetScrape(chain string) configtypes.ScrapeSettings
- func GetSettings() configtypes.SettingsGroup
- func GetUnchained() configtypes.UnchainedGroup
- func GetVersion() configtypes.VersionGroup
- func HeaderHash(version string) []byte
- func IpfsRunning() bool
- func IsChainConfigured(needle string) bool
- func KnownVersionTag(tag string) bool
- func MergeScrapeConfig(fn string, scrape *configtypes.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 PathToManifestFile(chain string) string
- func PathToRootConfig() string
- func PathToTimestamps(chain string) string
- func ReadToml(inFile string, destination interface{}) error
- func ReloadConfig()
- func SetExpectedVersion(version string)
- func SetScrapeArgs(chain string, args map[string]string)
- type OldScrape
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 GetChain ¶
func GetChain(chain string) configtypes.ChainGroup
GetChain returns the chain for a given chain
func GetChains ¶
func GetChains() []configtypes.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 GetKey ¶
func GetKey(set string) configtypes.KeyGroup
func GetPinning ¶
func GetPinning() configtypes.PinningGroup
func GetPublisher ¶
func GetRootConfig ¶
func GetRootConfig() *configtypes.Config
GetRootConfig reads and the configuration located in trueBlocks.toml file. Note that this routine is local to the package
func GetScrape ¶
func GetScrape(chain string) configtypes.ScrapeSettings
GetScrape returns the scraper settings per chain
func GetSettings ¶
func GetSettings() configtypes.SettingsGroup
func GetUnchained ¶
func GetUnchained() configtypes.UnchainedGroup
func GetVersion ¶
func GetVersion() configtypes.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 *configtypes.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 PathToManifestFile ¶
PathToManifestFile 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 ReloadConfig ¶
func ReloadConfig()
ReloadConfig clears the config cache so that the next time ReadToml is called the config will reload
func SetExpectedVersion ¶
func SetExpectedVersion(version string)