config

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Datadir                              = "DATADIR"
	WalletAddr                           = "WALLET_ADDR"
	SignerAddr                           = "SIGNER_ADDR"
	SessionDuration                      = "SESSION_DURATION"
	BanDuration                          = "BAN_DURATION"
	BanThreshold                         = "BAN_THRESHOLD"
	Port                                 = "PORT"
	AdminPort                            = "ADMIN_PORT"
	EventDbType                          = "EVENT_DB_TYPE"
	DbType                               = "DB_TYPE"
	DbUrl                                = "PG_DB_URL"
	PostgresAutoCreateDB                 = "PG_DB_AUTOCREATE"
	PostgresMaxOpenConn                  = "PG_DB_MAX_OPEN_CONN"
	PostgresMaxIdleConn                  = "PG_DB_MAX_IDLE_CONN"
	PostgresConnMaxIdleMins              = "PG_DB_CONN_MAX_IDLE_MINS"
	PostgresConnMaxLifeMins              = "PG_DB_CONN_MAX_LIFE_MINS"
	EventDbUrl                           = "PG_EVENT_DB_URL"
	TxBuilderType                        = "TX_BUILDER_TYPE"
	LiveStoreType                        = "LIVE_STORE_TYPE"
	RedisUrl                             = "REDIS_URL"
	RedisTxNumOfRetries                  = "REDIS_NUM_OF_RETRIES"
	LogLevel                             = "LOG_LEVEL"
	VtxoTreeExpiry                       = "VTXO_TREE_EXPIRY"
	UnilateralExitDelay                  = "UNILATERAL_EXIT_DELAY"
	PublicUnilateralExitDelay            = "PUBLIC_UNILATERAL_EXIT_DELAY"
	CheckpointExitDelay                  = "CHECKPOINT_EXIT_DELAY"
	BoardingExitDelay                    = "BOARDING_EXIT_DELAY"
	EsploraURL                           = "ESPLORA_URL"
	AlertManagerURL                      = "ALERT_MANAGER_URL"
	ArkadeExplorerURL                    = "ARKADE_EXPLORER_URL"
	NoMacaroons                          = "NO_MACAROONS"
	NoTLS                                = "NO_TLS"
	TLSExtraIP                           = "TLS_EXTRA_IP"
	TLSExtraDomain                       = "TLS_EXTRA_DOMAIN"
	UnlockerType                         = "UNLOCKER_TYPE"
	UnlockerFilePath                     = "UNLOCKER_FILE_PATH"
	UnlockerPassword                     = "UNLOCKER_PASSWORD"
	NoteUriPrefix                        = "NOTE_URI_PREFIX"
	ScheduledSessionStartTime            = "SCHEDULED_SESSION_START_TIME"
	ScheduledSessionEndTime              = "SCHEDULED_SESSION_END_TIME"
	ScheduledSessionPeriod               = "SCHEDULED_SESSION_PERIOD"
	ScheduledSessionDuration             = "SCHEDULED_SESSION_DURATION"
	ScheduledSessionMinRoundParticipants = "SCHEDULED_SESSION_MIN_ROUND_PARTICIPANTS_COUNT"
	ScheduledSessionMaxRoundParticipants = "SCHEDULED_SESSION_MAX_ROUND_PARTICIPANTS_COUNT"
	OtelCollectorEndpoint                = "OTEL_COLLECTOR_ENDPOINT"
	OtelPushInterval                     = "OTEL_PUSH_INTERVAL"
	PyroscopeServerURL                   = "PYROSCOPE_SERVER_URL"
	RoundMaxParticipantsCount            = "ROUND_MAX_PARTICIPANTS_COUNT"
	RoundMinParticipantsCount            = "ROUND_MIN_PARTICIPANTS_COUNT"
	UtxoMaxAmount                        = "UTXO_MAX_AMOUNT"
	VtxoMaxAmount                        = "VTXO_MAX_AMOUNT"
	UtxoMinAmount                        = "UTXO_MIN_AMOUNT"
	VtxoMinAmount                        = "VTXO_MIN_AMOUNT"
	HeartbeatInterval                    = "HEARTBEAT_INTERVAL"
	RoundReportServiceEnabled            = "ROUND_REPORT_ENABLED"
	SettlementMinExpiryGap               = "SETTLEMENT_MIN_EXPIRY_GAP"
	// Minimum remaining CSV time (in seconds) for an unrolled VTXO to be accepted into a batch.
	// 0 means fallback to session duration.
	UnrolledVtxoMinExpiryMargin = "UNROLLED_VTXO_MIN_EXPIRY_MARGIN"
	MaxOpReturnOutputs          = "MAX_OP_RETURN_OUTS"
	// Max transaction weight accepted by the ark server
	MaxTxWeight = "MAX_TX_WEIGHT"
	// Fraction of MaxTxWeight reserved for the asset packet when spending a VTXO
	AssetTxMaxWeightRatio = "ASSET_TX_MAX_WEIGHT_RATIO"
	// Skip CSV validation for vtxos created before this date
	VtxoNoCsvValidationCutoffDate = "VTXO_NO_CSV_VALIDATION_CUTOFF_DATE"
	EnablePprof                   = "ENABLE_PPROF"
	IndexerExposure               = "INDEXER_EXPOSURE"
	IndexerAuthTokenExpiry        = "INDEXER_AUTH_TOKEN_EXPIRY" // #nosec G101
	// IndexerSigningKey is a hex-encoded private key. SENSITIVE: never log this value.
	IndexerSigningKey    = "INDEXER_SIGNING_PRIVKEY" // #nosec G101
	MaxConcurrentStreams = "MAX_CONCURRENT_STREAMS"

	DefaultPort      = 7070
	DefaultAdminPort = 7071
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Datadir         string
	Port            uint32
	AdminPort       uint32
	DbMigrationPath string
	NoTLS           bool
	NoMacaroons     bool
	LogLevel        int
	TLSExtraIPs     []string
	TLSExtraDomains []string

	DbType                    string
	EventDbType               string
	DbDir                     string
	DbUrl                     string
	EventDbUrl                string
	EventDbDir                string
	PostgresAutoCreateDB      bool
	PostgresMaxOpenConn       int
	PostgresMaxIdleConn       int
	PostgresConnMaxIdleMins   int64
	PostgresConnMaxLifeMins   int64
	SessionDuration           int64
	BanDuration               int64
	BanThreshold              int64 // number of crimes to trigger a ban
	TxBuilderType             string
	LiveStoreType             string
	RedisUrl                  string
	RedisTxNumOfRetries       int
	WalletAddr                string
	SignerAddr                string
	VtxoTreeExpiry            arklib.RelativeLocktime
	UnilateralExitDelay       arklib.RelativeLocktime
	PublicUnilateralExitDelay arklib.RelativeLocktime
	CheckpointExitDelay       arklib.RelativeLocktime
	BoardingExitDelay         arklib.RelativeLocktime
	NoteUriPrefix             string
	HeartbeatInterval         int64

	VtxoNoCsvValidationCutoffDate int64

	ScheduledSessionStartTime                 int64
	ScheduledSessionEndTime                   int64
	ScheduledSessionPeriod                    int64
	ScheduledSessionDuration                  int64
	ScheduledSessionMinRoundParticipantsCount int64
	ScheduledSessionMaxRoundParticipantsCount int64
	OtelCollectorEndpoint                     string
	OtelPushInterval                          int64
	PyroscopeServerURL                        string
	RoundReportServiceEnabled                 bool

	EsploraURL        string
	AlertManagerURL   string
	ArkadeExplorerURL string

	UnlockerType     string
	UnlockerFilePath string // file unlocker
	UnlockerPassword string // env unlocker

	RoundMinParticipantsCount   int64
	RoundMaxParticipantsCount   int64
	UtxoMaxAmount               int64
	UtxoMinAmount               int64
	VtxoMaxAmount               int64
	VtxoMinAmount               int64
	SettlementMinExpiryGap      int64
	UnrolledVtxoMinExpiryMargin int64
	MaxTxWeight                 uint64
	AssetTxMaxWeightRatio       float64
	MaxOpReturnOutputs          uint32

	EnablePprof            bool
	IndexerExposure        string
	IndexerAuthTokenExpiry int64
	// IndexerSigningKey is a hex-encoded private key used by the indexer to sign
	// auth tokens. This is separate from the server's main signing key.
	// Rotating this key invalidates all outstanding auth tokens.
	// SENSITIVE: must never be logged.
	IndexerSigningKey    string
	MaxConcurrentStreams uint32
	// contains filtered or unexported fields
}

func LoadConfig

func LoadConfig() (*Config, error)

func (*Config) AdminService

func (c *Config) AdminService() application.AdminService

func (*Config) AppService

func (c *Config) AppService() (application.Service, error)

func (*Config) IndexerService

func (c *Config) IndexerService() (application.IndexerService, error)

func (*Config) RoundReportService added in v0.8.0

func (c *Config) RoundReportService() (application.RoundReportService, error)

func (*Config) SignerService added in v0.7.1

func (c *Config) SignerService() (ports.SignerService, error)

func (*Config) String

func (c *Config) String() string

func (*Config) UnlockerService

func (c *Config) UnlockerService() ports.Unlocker

func (*Config) Validate

func (c *Config) Validate() error

func (*Config) WalletService

func (c *Config) WalletService() ports.WalletService

Jump to

Keyboard shortcuts

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