Documentation ¶
Index ¶
- Constants
- type DbConfig
- type StorageConfig
- func (config *StorageConfig) GetActiveDBCount() int
- func (config *StorageConfig) GetBlockDbConfig() *DbConfig
- func (config *StorageConfig) GetContractEventDbConfig() *DbConfig
- func (config *StorageConfig) GetDefaultDBConfig() *DbConfig
- func (config *StorageConfig) GetHistoryDbConfig() *DbConfig
- func (config *StorageConfig) GetResultDbConfig() *DbConfig
- func (config *StorageConfig) GetStateDbConfig() *DbConfig
Constants ¶
View Source
const ( DbconfigProviderSql = "sql" DbconfigProviderSqlKV = "sqlkv" //虽然是用SQL数据库,但是当KV数据库使 DbconfigProviderLeveldb = "leveldb" DbconfigProviderBadgerdb = "badgerdb" DbconfigProviderTikvdb = "tikvdb" )
View Source
const SqldbconfigSqldbtypeMysql = "mysql"
View Source
const SqldbconfigSqldbtypeSqlite = "sqlite"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DbConfig ¶
type DbConfig struct { //leveldb,badgerdb,tikvdb,sql Provider string `mapstructure:"provider"` LevelDbConfig map[string]interface{} `mapstructure:"leveldb_config"` BadgerDbConfig map[string]interface{} `mapstructure:"badgerdb_config"` TikvDbConfig map[string]interface{} `mapstructure:"tikvdb_config"` SqlDbConfig map[string]interface{} `mapstructure:"sqldb_config"` }
type StorageConfig ¶
type StorageConfig struct { //默认的Leveldb配置,如果每个DB有不同的设置,可以在自己的DB中进行设置 StorePath string `mapstructure:"store_path"` DbPrefix string `mapstructure:"db_prefix"` WriteBufferSize int `mapstructure:"write_buffer_size"` BloomFilterBits int `mapstructure:"bloom_filter_bits"` BlockWriteBufferSize int `mapstructure:"block_write_buffer_size"` //数据库模式:light只存区块头,normal存储区块头和交易以及生成的State,full存储了区块头、交易、状态和交易收据(读写集、日志等) //Mode string `mapstructure:"mode"` DisableWAL bool `mapstructure:"disable_wal"` DisableHistoryDB bool `mapstructure:"disable_historydb"` DisableResultDB bool `mapstructure:"disable_resultdb"` DisableContractEventDB bool `mapstructure:"disable_contract_eventdb"` LogDBWriteAsync bool `mapstructure:"logdb_write_async"` LogDBSegmentSize int `mapstructure:"logdb_segment_size"` BlockDbConfig *DbConfig `mapstructure:"blockdb_config"` StateDbConfig *DbConfig `mapstructure:"statedb_config"` HistoryDbConfig *DbConfig `mapstructure:"historydb_config"` ResultDbConfig *DbConfig `mapstructure:"resultdb_config"` ContractEventDbConfig *DbConfig `mapstructure:"contract_eventdb_config"` UnArchiveBlockHeight uint64 `mapstructure:"unarchive_block_height"` Async bool `mapstructure:"is_async"` Encryptor string `mapstructure:"encryptor"` //SM4 AES EncryptKey string `mapstructure:"encrypt_key"` }
func (*StorageConfig) GetActiveDBCount ¶
func (config *StorageConfig) GetActiveDBCount() int
GetActiveDBCount 根据配置的DisableDB的情况,确定当前配置活跃的数据库数量
func (*StorageConfig) GetBlockDbConfig ¶
func (config *StorageConfig) GetBlockDbConfig() *DbConfig
func (*StorageConfig) GetContractEventDbConfig ¶
func (config *StorageConfig) GetContractEventDbConfig() *DbConfig
func (*StorageConfig) GetDefaultDBConfig ¶
func (config *StorageConfig) GetDefaultDBConfig() *DbConfig
func (*StorageConfig) GetHistoryDbConfig ¶
func (config *StorageConfig) GetHistoryDbConfig() *DbConfig
func (*StorageConfig) GetResultDbConfig ¶
func (config *StorageConfig) GetResultDbConfig() *DbConfig
func (*StorageConfig) GetStateDbConfig ¶
func (config *StorageConfig) GetStateDbConfig() *DbConfig
Click to show internal directories.
Click to hide internal directories.