config

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: Apache-2.0 Imports: 5 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

This section is empty.

Types

type Auth

type Auth any

Auth is used to sign transactions.

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
)

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 Duration

type Duration = time.Duration

type LogLevel

type LogLevel = slog.Level

type NodeConfig

type NodeConfig struct {
	LogLevel                                 LogLevel
	LogPretty                                bool
	RollupsEpochLength                       uint64
	BlockchainID                             uint64
	BlockchainHttpEndpoint                   Redacted[string]
	BlockchainWsEndpoint                     Redacted[string]
	BlockchainIsLegacy                       bool
	BlockchainFinalityOffset                 int
	BlockchainBlockTimeout                   int
	ContractsApplicationAddress              string
	ContractsHistoryAddress                  string
	ContractsAuthorityAddress                string
	ContractsInputBoxAddress                 string
	ContractsInputBoxDeploymentBlockNumber   int64
	SnapshotDir                              string
	PostgresEndpoint                         Redacted[string]
	HttpAddress                              string
	HttpPort                                 int
	FeatureHostMode                          bool
	FeatureReaderModeEnabled                 bool
	FeatureDisableClaimer                    bool
	FeatureDisableMachineHashCheck           bool
	ExperimentalServerManagerBypassLog       bool
	ExperimentalSunodoValidatorEnabled       bool
	ExperimentalSunodoValidatorRedisEndpoint Redacted[string]
	Auth                                     Auth
}

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