configuration

package
v0.0.0-...-2276d10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Online is when the implementation is permitted
	// to make outbound connections.
	Online Mode = "ONLINE"

	// Offline is when the implementation is not permitted
	// to make outbound connections.
	Offline Mode = "OFFLINE"

	// Mainnet is the Whive Mainnet.
	Mainnet string = "MAINNET"

	// Testnet is Whive Testnet.
	Testnet string = "TESTNET"

	// DataDirectory is the default location for all
	// persistent data.
	DataDirectory = "/data"

	// ModeEnv is the environment variable read
	// to determine mode.
	ModeEnv = "MODE"

	// NetworkEnv is the environment variable
	// read to determine network.
	NetworkEnv = "NETWORK"

	// PortEnv is the environment variable
	// read to determine the port for the Rosetta
	// implementation.
	PortEnv = "PORT"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Mode                   Mode
	Network                *types.NetworkIdentifier
	Params                 *chaincfg.Params
	Currency               *types.Currency
	GenesisBlockIdentifier *types.BlockIdentifier
	Port                   int
	RPCPort                int
	ConfigPath             string
	Pruning                *PruningConfiguration
	IndexerPath            string
	WhivedPath             string
	Compressors            []*encoder.CompressorEntry
}

Configuration determines how

func LoadConfiguration

func LoadConfiguration(baseDirectory string) (*Configuration, error)

LoadConfiguration attempts to create a new Configuration using the ENVs in the environment.

type Mode

type Mode string

Mode is the setting that determines if the implementation is "online" or "offline".

type PruningConfiguration

type PruningConfiguration struct {
	Frequency time.Duration
	Depth     int64
	MinHeight int64
}

PruningConfiguration is the configuration to use for pruning in the indexer.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL