Documentation ¶
Overview ¶
Package conf contains the logic to read and initialize system configuration
Index ¶
Constants ¶
View Source
const ( ChainMakerSPV = "chainmaker_spv" ChainMakerLight = "chainmaker_light" FabricSPV = "fabric_spv" )
Variables ¶
View Source
var ( Filepath = "../config/spv_config.yml" // default config file path SPVConfig = &Config{} // global config containing all chains' spv config RemoteChainConfigs = make(map[string]*protogo.RemoteConfig) // all remote chains' config got by sdk )
Functions ¶
func InitSPVConfig ¶
InitSPVConfig inits SPVConfig when deployed independently
Types ¶
type ChainConfig ¶
type ChainConfig struct { ChainType string `mapstructure:"chain_type"` ChainId string `mapstructure:"chain_id"` SyncChainInfoIntervalMills int32 `mapstructure:"sync_chainInfo_interval"` SDKConfigPath string `mapstructure:"sdk_config_path"` FabricConfig *FabricExtraConfig `mapstructure:"fabric_extra_config"` }
ChainConfig is the config of one chain's spv config
type Config ¶
type Config struct { Chains []*ChainConfig `mapstructure:"chains"` GRPCConfig *GRPCConfig `mapstructure:"grpc"` WebConfig *WebConfig `mapstructure:"web"` StorageConfig *StoreConfig `mapstructure:"storage"` LogConfig *logger.LogConfig `mapstructure:"log"` }
Config is the config containing all chains' spv config
type FabricExtraConfig ¶
type FabricExtraConfig struct { User string `mapstructure:"user"` Peers []*Peer `mapstructure:"peers"` }
FabricExtraConfig is the extra config of fabric, containing user and peers
type GRPCConfig ¶
GRPCConfig is the config of gRPC module
func (*GRPCConfig) ToUrl ¶
func (gRPCConfig *GRPCConfig) ToUrl() string
ToUrl return url of grpc config
type LevelDBConfig ¶
type LevelDBConfig struct { StorePath string `mapstructure:"store_path"` WriteBufferSize int `mapstructure:"write_buffer_size"` BloomFilterBits int `mapstructure:"bloom_filter_bits"` }
LevelDBConfig is the config of leveldb module
type Peer ¶
type Peer struct {
PeerName string `mapstructure:"peer"`
}
Peer contains the peer name of fabric
type StoreConfig ¶
type StoreConfig struct { Provider string `mapstructure:"provider"` LevelDB *LevelDBConfig `mapstructure:"leveldb"` }
StoreConfig is the config of storage module
Click to show internal directories.
Click to hide internal directories.