config

package
v1.8.3 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package config contains all the config functions that is used by the bsp-agent node

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LookupEnvOrInt added in v1.1.6

func LookupEnvOrInt(key string, defaultVal int) int

LookupEnvOrInt looks up a flag env that is an integer and returns its value. If the environment variable is not set, it returns the default value.

func LookupEnvOrInt64 added in v1.2.3

func LookupEnvOrInt64(key string, defaultVal int64) int64

LookupEnvOrInt64 looks up a flag env that is an integer and returns its value as int64. If the environment variable is not set, it returns the default value.

func LookupEnvOrString added in v1.1.6

func LookupEnvOrString(key string, defaultVal string) string

LookupEnvOrString looks up a flag env that is a string

Types

type AgentConfig added in v1.1.6

type AgentConfig struct {
	RedisConfig      RedisConfig
	CodecConfig      CodecConfig
	StorageConfig    StorageConfig
	ProofchainConfig ProofchainConfig
	ChainConfig      ChainConfig
	MetricsConfig    MetricsConfig

	LogFolder string
}

AgentConfig composes all configs into a single full (env and flags) config for the bsp-agent node

func NewAgentConfig added in v1.1.6

func NewAgentConfig() *AgentConfig

NewAgentConfig creates a new empty config

func (*AgentConfig) LoadConfig added in v1.1.6

func (ac *AgentConfig) LoadConfig()

LoadConfig gets the config from env flags and cli arguments

func (*AgentConfig) SegmentLength added in v1.1.6

func (ac *AgentConfig) SegmentLength() int

SegmentLength get number of block-specimens encoded within a block-replica

type ChainConfig added in v1.1.6

type ChainConfig struct {
	RPCURL       string
	PrivateKey   string
	KeystorePath string
	KeyStorePwd  string
}

ChainConfig contains config for all supported blockchains

type CodecConfig added in v1.1.6

type CodecConfig struct {
	AvroCodecPath string
}

CodecConfig contains all AVRO codec related config

type EnvConfig added in v1.1.6

type EnvConfig struct {
	IpfsConfig  IpfsEnvConfig
	RedisConfig RedisEnvConfig
	EthConfig   EthEnvConfig
}

EnvConfig composes all configs into a single env config for the bsp-agent node

type EthEnvConfig added in v1.1.6

type EthEnvConfig struct {
	RPCURL       string `envconfig:"MB_RPC_URL"`
	PrivateKey   string `envconfig:"MB_PRIVATE_KEY"`
	KeystorePath string `envconfig:"MB_KEYSTORE_PATH"`
	KeyStorePwd  string `envconfig:"MB_KEYSTORE_PWD"`
}

EthEnvConfig contains all config for ethereum / ethereum like (EVM) networks

type IpfsEnvConfig added in v1.1.6

type IpfsEnvConfig struct {
	IpfsPinnerServer string `envconfig:"IFPS_PINNER_SERVER" default:"http://127.0.0.1:3000"`
}

IpfsEnvConfig contains all config for IPFS pinning services

type MetricsConfig added in v1.1.6

type MetricsConfig struct {
	Enabled        bool
	HTTPServerAddr string
	HTTPServerPort string
}

MetricsConfig contains config for collecting performance metrics

type ProofchainConfig added in v1.1.6

type ProofchainConfig struct {
	ProofChainAddr string
}

ProofchainConfig contains all proof-chain configs

type RedisConfig

type RedisConfig struct {
	RedisURL               string
	Password               string
	BlockDivisor           int // can be set to any divisor (decrease specimen production throughput)
	ConsumerPendingTimeout int // defaults to 1 min
}

RedisConfig contains all redis related config

type RedisEnvConfig added in v1.1.6

type RedisEnvConfig struct {
	Password string `envconfig:"REDIS_PWD" default:""`
}

RedisEnvConfig contains all config for redis

type StorageConfig added in v1.1.6

type StorageConfig struct {
	// local
	BinaryFilePath string

	// ipfs
	IpfsPinnerServer string
}

StorageConfig contains all configs needed by different stores

Jump to

Keyboard shortcuts

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