config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

The config package manages the node configuration, which comes from environment variables. The sub-package generate specifies these environment variables.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAuthAwsKmsKeyId

func GetAuthAwsKmsKeyId() string

func GetAuthAwsKmsRegion

func GetAuthAwsKmsRegion() string

func GetAuthMnemonic

func GetAuthMnemonic() string

func GetAuthMnemonicAccountIndex

func GetAuthMnemonicAccountIndex() int

func GetAuthMnemonicFile

func GetAuthMnemonicFile() string

func GetAuthPrivateKey

func GetAuthPrivateKey() string

func GetAuthPrivateKeyFile

func GetAuthPrivateKeyFile() string

func GetBaseUrl

func GetBaseUrl() string

func GetBlockchainBlockTimeout

func GetBlockchainBlockTimeout() int

func GetBlockchainHttpEndpoint

func GetBlockchainHttpEndpoint() string

func GetBlockchainId

func GetBlockchainId() uint64

func GetBlockchainWsEndpoint

func GetBlockchainWsEndpoint() string

func GetContractsInputBoxAddress

func GetContractsInputBoxAddress() string

func GetContractsInputBoxDeploymentBlockNumber

func GetContractsInputBoxDeploymentBlockNumber() int64

func GetEvmReaderRetryPolicyMaxRetries

func GetEvmReaderRetryPolicyMaxRetries() uint64

func GetFeatureClaimSubmissionEnabled

func GetFeatureClaimSubmissionEnabled() bool

func GetFeatureMachineHashCheckEnabled

func GetFeatureMachineHashCheckEnabled() bool

func GetHttpAddress

func GetHttpAddress() string

func GetHttpPort

func GetHttpPort() int

func GetLegacyBlockchainEnabled

func GetLegacyBlockchainEnabled() bool

func GetLogPrettyEnabled

func GetLogPrettyEnabled() bool

func GetMachineServerVerbosity

func GetMachineServerVerbosity() string

func GetNamespace

func GetNamespace() uint64

func GetPostgresEndpoint

func GetPostgresEndpoint() string

func GetServiceEndpoint

func GetServiceEndpoint() string

func GetSnapshotDir

func GetSnapshotDir() string

func GetStartingBlock

func GetStartingBlock() uint64

func ToDurationFromSeconds

func ToDurationFromSeconds(s string) (time.Duration, error)

func ToInt64FromString

func ToInt64FromString(s string) (int64, error)

func ToStringFromString

func ToStringFromString(s string) (string, error)

func ToUint64FromString

func ToUint64FromString(s string) (uint64, error)

Types

type Auth

type Auth any

Auth is used to sign transactions.

func AuthFromEnv

func AuthFromEnv() Auth

type AuthAWS

type AuthAWS struct {
	KeyID  Redacted[string]
	Region Redacted[string]
}

AuthAWS allows signing through AWS services.

type AuthKind

type AuthKind uint8
const (
	AuthKindPrivateKeyVar AuthKind = iota
	AuthKindPrivateKeyFile
	AuthKindMnemonicVar
	AuthKindMnemonicFile
	AuthKindAWS
)

func GetAuthKind

func GetAuthKind() AuthKind

func ToAuthKindFromString

func ToAuthKindFromString(s string) (AuthKind, error)

type AuthMnemonic

type AuthMnemonic struct {
	Mnemonic     Redacted[string]
	AccountIndex Redacted[int]
}

AuthMnemonic allows signing through mnemonics.

type AuthPrivateKey

type AuthPrivateKey struct {
	PrivateKey Redacted[string]
}

AuthPrivateKey allows signing through private keys.

type DefaultBlock

type DefaultBlock = model.DefaultBlock

func GetEvmReaderDefaultBlock

func GetEvmReaderDefaultBlock() DefaultBlock

func ToDefaultBlockFromString

func ToDefaultBlockFromString(s string) (DefaultBlock, error)

type Duration

type Duration = time.Duration

func GetAdvancerPollingInterval

func GetAdvancerPollingInterval() Duration

func GetClaimerPollingInterval

func GetClaimerPollingInterval() Duration

func GetEvmReaderRetryPolicyMaxDelay

func GetEvmReaderRetryPolicyMaxDelay() Duration

func GetValidatorPollingInterval

func GetValidatorPollingInterval() Duration

type LogLevel

type LogLevel = slog.Level

func GetLogLevel

func GetLogLevel() LogLevel

func ToLogLevelFromString

func ToLogLevelFromString(s string) (LogLevel, error)

type NodeConfig

type NodeConfig struct {
	LogLevel                               LogLevel
	LogPrettyEnabled                       bool
	BlockchainID                           uint64
	BlockchainHttpEndpoint                 Redacted[string]
	BlockchainWsEndpoint                   Redacted[string]
	LegacyBlockchainEnabled                bool
	EvmReaderDefaultBlock                  DefaultBlock
	EvmReaderRetryPolicyMaxRetries         uint64
	EvmReaderRetryPolicyMaxDelay           Duration
	BlockchainBlockTimeout                 int
	ContractsInputBoxAddress               string
	ContractsInputBoxDeploymentBlockNumber int64
	SnapshotDir                            string
	PostgresEndpoint                       Redacted[string]
	HttpAddress                            string
	HttpPort                               int
	FeatureClaimSubmissionEnabled          bool
	FeatureMachineHashCheckEnabled         bool
	Auth                                   Auth
	AdvancerPollingInterval                Duration
	ValidatorPollingInterval               Duration
	ClaimerPollingInterval                 Duration
	EspressoBaseUrl                        string
	EspressoStartingBlock                  uint64
	EspressoNamespace                      uint64
	EspressoServiceEndpoint                string
}

NodeConfig contains all the Node variables. See the corresponding environment variable for the variable documentation.

func FromEnv

func FromEnv() NodeConfig

FromEnv loads the config from environment variables.

type Redacted

type Redacted[T any] struct {
	Value T
}

Redacted is a wrapper that redacts a given field from the logs.

func (Redacted[T]) String

func (r Redacted[T]) String() string

Directories

Path Synopsis
This script will read the Config.toml file and create: - a formatted get.go file, with get functions for each environment variable; - a config.md file with documentation for the environment variables.
This script will read the Config.toml file and create: - a formatted get.go file, with get functions for each environment variable; - a config.md file with documentation for the environment variables.

Jump to

Keyboard shortcuts

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