config

package
v0.0.0-...-041d6b2 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CacheTypeInMemory = "memory"
	CacheTypeRedis    = "redis"

	BlockchainDatabaseInMemory = "memory"
	BlockChainDatabaseLMDB     = "lmdb"
)

Variables

View Source
var DrandChainGenesisTime = uint64(1603603302)
View Source
var ExpectedLeadersPerEpoch = big.NewInt(2)

Functions

This section is empty.

Types

type BlockchainConfig

type BlockchainConfig struct {
	DatabaseType string `mapstructure:"database_type"`
	LMDB         struct {
		DatabasePath string `mapstructure:"database_path"`
	} `mapstructure:"lmdb"`
}

type Config

type Config struct {
	ListenPort            int              `mapstructure:"listen_port"`
	ListenAddr            string           `mapstructure:"listen_addr"`
	IsBootstrap           bool             `mapstructure:"is_bootstrap"`
	BootstrapNodes        []string         `mapstructure:"bootstrap_node_multiaddr"`
	Rendezvous            string           `mapstructure:"rendezvous"`
	Ethereum              EthereumConfig   `mapstructure:"ethereum"`
	Filecoin              FilecoinConfig   `mapstructure:"filecoin"`
	PubSub                PubSubConfig     `mapstructure:"pubsub"`
	ConsensusMinApprovals int              `mapstructure:"consensus_min_approvals"`
	Redis                 RedisConfig      `mapstructure:"redis"`
	CacheType             string           `mapstructure:"cache_type"`
	Blockchain            BlockchainConfig `mapstructure:"blockchain"`
	PrivateKeyPath        string           `mapstructure:"private_key_path"`
}

func NewConfig

func NewConfig(configPath string) (*Config, error)

NewConfig creates a new config based on default values or provided .env file

type DrandConfig

type DrandConfig struct {
	Servers      []string
	GossipRelays []string
	ChainInfo    string
}

func NewDrandConfig

func NewDrandConfig() *DrandConfig

type EthereumConfig

type EthereumConfig struct {
	GatewayAddress              string `mapstructure:"gateway_address"`
	ChainID                     int    `mapstructure:"chain_id"`
	PrivateKey                  string `mapstructure:"private_key"`
	MnemonicPhrase              string `mapstructure:"mnemonic_phrase"`
	HDDerivationPath            string `mapstructure:"hd_derivation_path"`
	DioneOracleContractAddress  string `mapstructure:"oracle_contract_address"`
	DioneStakingContractAddress string `mapstructure:"staking_contract_address"`
	DisputeContractAddress      string `mapstructure:"dispute_contract_address"`
	DisputeVoteWindow           int    `mapstructure:"dispute_vote_window"` // in secs
}

type FilecoinConfig

type FilecoinConfig struct {
	LotusHost  string `mapstructure:"lotusHost"`
	LotusToken string `mapstructure:"lotusToken"`
}

type PubSubConfig

type PubSubConfig struct {
	ServiceTopicName string `mapstructure:"service_topic_name"`
}

type RedisConfig

type RedisConfig struct {
	Addr     string `mapstructure:"redis_addr"`
	Password string `mapstructure:"redis_password"`
	DB       int    `mapstructure:"redis_db"`
}

Jump to

Keyboard shortcuts

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