Documentation
¶
Overview ¶
Package config contains all the config functions that is used by the bsp-agent node
Index ¶
- func LookupEnvOrInt(key string, defaultVal int) int
- func LookupEnvOrInt64(key string, defaultVal int64) int64
- func LookupEnvOrString(key string, defaultVal string) string
- type AgentConfig
- type ChainConfig
- type CodecConfig
- type EnvConfig
- type EthEnvConfig
- type IpfsEnvConfig
- type MetricsConfig
- type ProofchainConfig
- type RedisConfig
- type RedisEnvConfig
- type StorageConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LookupEnvOrInt ¶ added in v1.1.6
LookupEnvOrInt looks up a flag env that is an integer
func LookupEnvOrInt64 ¶ added in v1.2.3
LookupEnvOrInt64 looks up a flag env that is an integer
func LookupEnvOrString ¶ added in v1.1.6
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 // for elrond WebsocketURLs 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
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
StorageConfig contains all configs needed by different stores