Documentation
¶
Index ¶
- Constants
- func GetApiGatewayTcpAddr(conf *viper.Viper) string
- func GetBlockProducerInterval(conf *viper.Viper) uint8
- func GetExpvarConf(conf *viper.Viper) monitor.ExpvarConfig
- func GetLogSetting(conf *viper.Viper) log.AppenderConfig
- func GetNodeAccount(conf *viper.Viper) account.Account
- func GetP2PConf(conf *viper.Viper) map[string]*p2pConf.P2PConfig
- func GetPrometheusConf(conf *viper.Viper) monitor.PrometheusConfig
- func LoadConfig() (config *viper.Viper)
- func NewBlockChainConf(conf *viper.Viper) blockchainc.BlockChainConfig
- func NewConsensusConf(conf *viper.Viper) consensusc.ConsensusConfig
- func NewParticipateConf(conf *viper.Viper) participatesc.ParticipateConfig
- func NewRoleConf(conf *viper.Viper) rolec.RoleConfig
- func NewTxPoolConf(conf *viper.Viper) txpool.TxPoolConfig
- type AlgorithmConfig
- type Config
- type NodeConfig
Constants ¶
View Source
const ( CONFIG_PREFIX = "justitia" // algorithm setting HASH_ALGORITHM = "general.hashAlgorithm" // txpool setting TXPOOL_SLOTS = "general.txpool.globalslots" MAX_TXS_BLOCK = "general.txpool.txsPerBlock" // consensus policy setting CONSENSUS_POLICY = "general.consensus.policy" CONSENSUS_TIMEOUT = "general.consensus.timeout" PARTICIPATES_POLICY = "general.participates.policy" PARTICIPATES_NUMBER = "general.participates.participates" ROLE_POLICY = "general.role.policy" // node info NODE_ADDRESS = "general.node.address" NODE_ID = "general.node.id" NODE_URL = "general.node.url" // block chain BLOCK_CHAIN_PLUGIN = "general.blockchain.plugin" BLOCK_CHAIN_STATE_PATH = "general.blockchain.statePath" BLOCK_CHAIN_DATA_PATH = "general.blockchain.dataPath" // api gateway API_GATEWAY_TCP_ADDR = "general.apigateway" // Default parameter for solo block producer SOLO_TEST_BLOCK_PRODUCER_INTERVAL = "general.soloModeBlockProducedInterval" //P2P Setting // block syncer p2p config BLOCK_SYNCER_P2P = "block_syncer_p2p" P2P_BLOCK_SYNCER_ADDR_BOOK = "general.p2p.blockSyncer.AddrBookFilePath" P2P_BLOCK_SYNCER_LISTEN_ADDR = "general.p2p.blockSyncer.ListenAddress" P2P_BLOCK_SYNCER_MAX_OUT = "general.p2p.blockSyncer.MaxConnOutBound" P2P_BLOCK_SYNCER_MAX_IN = "general.p2p.blockSyncer.MaxConnInBound" P2P_BLOCK_SYNCER_PERSISTENT_PEERS = "general.p2p.blockSyncer.PersistentPeers" // block p2p config BLOCK_P2P = "block_p2p" P2P_BLOCK_ADDR_BOOK = "general.p2p.block.AddrBookFilePath" P2P_BLOCK_LISTEN_ADDR = "general.p2p.block.ListenAddress" P2P_BLOCK_MAX_OUT = "general.p2p.block.MaxConnOutBound" P2P_BLOCK_MAX_IN = "general.p2p.block.MaxConnInBound" P2P_BLOCK_PERSISTENT_PEERS = "general.p2p.block.PersistentPeers" // tx p2p config TX_P2P = "tx_p2p" P2P_TX_ADDR_BOOK = "general.p2p.tx.AddrBookFilePath" P2P_TX_LISTEN_ADDR = "general.p2p.tx.ListenAddress" P2P_TX_MAX_OUT = "general.p2p.tx.MaxConnOutBound" P2P_TX_MAX_IN = "general.p2p.tx.MaxConnInBound" P2P_TX_PERSISTENT_PEERS = "general.p2p.tx.PersistentPeers" // prometheus PROMETHEUS_ENABLED = "monitor.prometheus.enabled" PROMETHEUS_PORT = "monitor.prometheus.port" PROMETHEUS_MAX_CONN = "monitor.prometheus.maxOpenConnections" // Expvar EXPVAR_ENABLED = "monitor.expvar.enabled" EXPVAR_PORT = "monitor.expvar.port" EXPVAR_PATH = "monitor.expvar.path" // Log Setting LOG_PATH = "logging.path" LOG_LEVEL = "logging.level" LOG_FORMAT = "logging.format" LOG_CALLER = "logging.caller" LOG_HOSTNAME = "logging.hostname" LOG_TIMEFIELDFORMAT = "logging.timeFieldFormat" )
Variables ¶
This section is empty.
Functions ¶
func GetApiGatewayTcpAddr ¶
func GetExpvarConf ¶
func GetExpvarConf(conf *viper.Viper) monitor.ExpvarConfig
func GetLogSetting ¶
func GetLogSetting(conf *viper.Viper) log.AppenderConfig
func GetPrometheusConf ¶
func GetPrometheusConf(conf *viper.Viper) monitor.PrometheusConfig
func LoadConfig ¶
func NewBlockChainConf ¶
func NewBlockChainConf(conf *viper.Viper) blockchainc.BlockChainConfig
func NewConsensusConf ¶
func NewConsensusConf(conf *viper.Viper) consensusc.ConsensusConfig
func NewParticipateConf ¶
func NewParticipateConf(conf *viper.Viper) participatesc.ParticipateConfig
func NewRoleConf ¶
func NewRoleConf(conf *viper.Viper) rolec.RoleConfig
func NewTxPoolConf ¶
func NewTxPoolConf(conf *viper.Viper) txpool.TxPoolConfig
Types ¶
type AlgorithmConfig ¶
type AlgorithmConfig struct {
//hash algorithm
HashAlgorithm string
//signature algorithm
SignAlgorithm string
}
func GetAlgorithmConf ¶
func GetAlgorithmConf(config *viper.Viper) AlgorithmConfig
type NodeConfig ¶
type NodeConfig struct {
// default
Account account.Account
// api gateway
ApiGatewayAddr string
// txpool
TxPoolConf txpool.TxPoolConfig
// participates
ParticipatesConf participatesc.ParticipateConfig
// role
RoleConf rolec.RoleConfig
// consensus
ConsensusConf consensusc.ConsensusConfig
// BlockChainConfig
BlockChainConf blockchainc.BlockChainConfig
// Block Produce Interval
BlockInterval uint8
//algorithm config
AlgorithmConf AlgorithmConfig
// prometheus
PrometheusConf monitor.PrometheusConfig
// expvar
ExpvarConf monitor.ExpvarConfig
// log setting
Logger log.AppenderConfig
//P2P config
P2PConf map[string]*p2pConf.P2PConfig
}
func NewNodeConfig ¶
func NewNodeConfig() NodeConfig
Click to show internal directories.
Click to hide internal directories.