Documentation ¶
Index ¶
- Constants
- func AllGenesisBlocks() []types.StateBlock
- func ChainToken() types.Hash
- func DefaultDataDir() string
- func ErrToString(err error) string
- func GasAddress() types.Address
- func GasBlock() types.StateBlock
- func GasBlockHash() types.Hash
- func GasMintageBlock() types.StateBlock
- func GasToken() types.Hash
- func GenesisAddress() types.Address
- func GenesisBlock() types.StateBlock
- func GenesisBlockHash() types.Hash
- func GenesisMintageBlock() types.StateBlock
- func GenesisMintageHash() types.Hash
- func IsGenesisBlock(block *types.StateBlock) bool
- func IsGenesisToken(hash types.Hash) bool
- func QlcTestDataDir() string
- type CfgManager
- func (cm *CfgManager) Commit() error
- func (cm *CfgManager) CommitAndSave() error
- func (cm *CfgManager) Config() (*Config, error)
- func (cm *CfgManager) ConfigDir() string
- func (cm *CfgManager) Diff() (string, error)
- func (cm *CfgManager) DiffOther(cfg *Config) (string, error)
- func (cm *CfgManager) Discard()
- func (cm *CfgManager) Load(migrations ...CfgMigrate) (*Config, error)
- func (cm *CfgManager) ParseDataDir() (string, error)
- func (cm *CfgManager) PatchParams(params []string, cfg *Config) (*Config, error)
- func (cm *CfgManager) Save(data ...interface{}) error
- func (cm *CfgManager) UpdateParams(params []string) (*Config, error)
- type CfgMigrate
- type ChainParams
- type Config
- type ConfigV1
- type ConfigV10
- type ConfigV2
- type ConfigV3
- type ConfigV4
- type ConfigV5
- type ConfigV6
- type ConfigV7
- type ConfigV8
- type DBConfig
- type DBOptimize
- type DiscoveryConfigV1
- type DiscoveryConfigV2
- type GRPCConfig
- type Genesis
- type GenesisInfo
- type IdentityConfigV1
- type IdentityConfigV2
- type Influx
- type MDNSV1
- type Manager
- type MetricsConfig
- type MigrationV1ToV2
- type MigrationV2ToV3
- type MigrationV3ToV4
- type MigrationV4ToV5
- type MigrationV5ToV6
- type MigrationV6ToV7
- type MigrationV7ToV8
- type MigrationV8ToV10
- type P2PConfigV1
- type P2PConfigV2
- type PerformanceTestConfigV1
- type PoVConfig
- type Privacy
- type RPCConfigV1
- type RPCConfigV2
- type WhiteList
- type WhiteListInfo
Constants ¶
View Source
const (
QlcConfigFile = "qlc.json"
)
Variables ¶
This section is empty.
Functions ¶
func AllGenesisBlocks ¶ added in v1.4.0
func AllGenesisBlocks() []types.StateBlock
func ChainToken ¶ added in v1.4.0
func DefaultDataDir ¶
func DefaultDataDir() string
DefaultDataDir is the default data directory to use for the databases and other persistence requirements.
func ErrToString ¶ added in v1.3.0
func GasAddress ¶ added in v1.4.0
func GasBlock ¶ added in v1.4.0
func GasBlock() types.StateBlock
func GasBlockHash ¶ added in v1.4.0
func GasMintageBlock ¶ added in v1.4.0
func GasMintageBlock() types.StateBlock
func GenesisAddress ¶ added in v1.4.0
func GenesisBlock ¶ added in v1.4.0
func GenesisBlock() types.StateBlock
func GenesisBlockHash ¶ added in v1.4.0
func GenesisMintageBlock ¶ added in v1.4.0
func GenesisMintageBlock() types.StateBlock
func GenesisMintageHash ¶ added in v1.4.0
func IsGenesisBlock ¶ added in v1.4.0
func IsGenesisBlock(block *types.StateBlock) bool
IsGenesis check block is chain token genesis
func IsGenesisToken ¶ added in v1.4.0
IsGenesis check token is chain token genesis
func QlcTestDataDir ¶
func QlcTestDataDir() string
Types ¶
type CfgManager ¶ added in v1.0.1
type CfgManager struct { ConfigFile string // contains filtered or unexported fields }
func NewCfgManager ¶
func NewCfgManager(path string) *CfgManager
func NewCfgManagerWithConfig ¶ added in v1.3.0
func NewCfgManagerWithConfig(cfgFile string, cfg *Config) *CfgManager
func NewCfgManagerWithFile ¶ added in v1.3.0
func NewCfgManagerWithFile(cfgFile string) *CfgManager
func NewCfgManagerWithName ¶ added in v1.1.1
func NewCfgManagerWithName(path string, name string) *CfgManager
func (*CfgManager) Commit ¶ added in v1.3.0
func (cm *CfgManager) Commit() error
Commit changed cfg to runtime
func (*CfgManager) CommitAndSave ¶ added in v1.3.0
func (cm *CfgManager) CommitAndSave() error
CommitAndSave commit changed cfg to runtime and save to config file
func (*CfgManager) Config ¶ added in v1.3.0
func (cm *CfgManager) Config() (*Config, error)
Config get current used config
func (*CfgManager) ConfigDir ¶ added in v1.3.0
func (cm *CfgManager) ConfigDir() string
func (*CfgManager) Diff ¶ added in v1.3.0
func (cm *CfgManager) Diff() (string, error)
Diff the changed config
func (*CfgManager) DiffOther ¶ added in v1.3.0
func (cm *CfgManager) DiffOther(cfg *Config) (string, error)
DiffOther diff runtime cfg with other `cfg`
func (*CfgManager) Discard ¶ added in v1.3.0
func (cm *CfgManager) Discard()
func (*CfgManager) Load ¶ added in v1.0.1
func (cm *CfgManager) Load(migrations ...CfgMigrate) (*Config, error)
Load the config file and will create default if config file no exist
func (*CfgManager) ParseDataDir ¶ added in v1.3.0
func (cm *CfgManager) ParseDataDir() (string, error)
ParseDataDir parse dataDir from config file
func (*CfgManager) PatchParams ¶ added in v1.3.0
func (cm *CfgManager) PatchParams(params []string, cfg *Config) (*Config, error)
func (*CfgManager) Save ¶ added in v1.3.0
func (cm *CfgManager) Save(data ...interface{}) error
Save write config to file
func (*CfgManager) UpdateParams ¶ added in v1.3.0
func (cm *CfgManager) UpdateParams(params []string) (*Config, error)
type CfgMigrate ¶
type ChainParams ¶ added in v1.4.0
type Config ¶
type Config ConfigV10
func DefaultConfig ¶
func (*Config) DecodePrivateKey ¶
DecodePrivateKey is a helper to decode the users PrivateKey
type ConfigV1 ¶ added in v1.0.1
type ConfigV1 struct { Version int `json:"version"` DataDir string `json:"DataDir"` StorageMax string `json:"StorageMax"` Mode string `json:"mode"` // runtime mode: Test,Normal AutoGenerateReceive bool `json:"AutoGenerateReceive"` LogConfig *logConfig `json:"log"` //log config RPC *RPCConfigV1 `json:"rpc"` P2P *P2PConfigV1 `json:"p2p"` Discovery *DiscoveryConfigV1 `json:"Discovery"` ID *IdentityConfigV1 `json:"Identity"` PerformanceTest *PerformanceTestConfigV1 }
func DefaultConfigV1 ¶ added in v1.0.1
type ConfigV10 ¶ added in v1.4.2
type ConfigV10 struct { ConfigV8 `mapstructure:",squash"` DBOptimize *DBOptimize `json:"dbOptimize"` }
func DefaultConfigV10 ¶ added in v1.4.2
type ConfigV2 ¶ added in v1.0.1
type ConfigV2 struct { Version int `json:"version"` DataDir string `json:"dataDir"` StorageMax string `json:"storageMax"` AutoGenerateReceive bool `json:"autoGenerateReceive"` LogLevel string `json:"logLevel"` //info,warn,debug PerformanceEnabled bool `json:"performanceEnabled"` RPC *RPCConfigV2 `json:"rpc"` P2P *P2PConfigV2 `json:"p2p"` }
func DefaultConfigV2 ¶ added in v1.0.1
type ConfigV3 ¶ added in v1.1.0
func DefaultConfigV3 ¶ added in v1.1.0
type ConfigV4 ¶ added in v1.2.3
func DefaultConfigV4 ¶ added in v1.2.3
type ConfigV5 ¶ added in v1.3.0
type ConfigV5 struct { ConfigV4 `mapstructure:",squash"` Metrics *MetricsConfig `json:"metrics"` Manager *Manager `json:"manager"` }
func DefaultConfigV5 ¶ added in v1.3.0
type ConfigV6 ¶ added in v1.4.0
func DefaultConfigV6 ¶ added in v1.4.0
type ConfigV7 ¶ added in v1.4.0
type ConfigV7 struct { ConfigV6 `mapstructure:",squash"` Privacy *Privacy `json:"privacy"` WhiteList *WhiteList `json:"whiteList"` }
func DefaultConfigV7 ¶ added in v1.4.0
type ConfigV8 ¶ added in v1.4.0
type ConfigV8 struct {
ConfigV7 `mapstructure:",squash"`
}
func DefaultConfigV8 ¶ added in v1.4.0
type DBOptimize ¶ added in v1.4.2
type DBOptimize struct { Enable bool `json:"enable"` PeriodDay int `json:"periodDay"` HeightInterval uint64 `json:"heightInterval"` // pov height interval to delete data SyncWriteHeight uint64 `json:"syncWriteHeight"` // min pov height to write trie data when sync MaxUsage int `json:"maxUsage"` FlushInterval int `json:"flushInterval"` }
type DiscoveryConfigV1 ¶ added in v1.0.1
type DiscoveryConfigV2 ¶ added in v1.0.1
type DiscoveryConfigV2 struct { // Time in seconds between remote discovery rounds DiscoveryInterval int `json:"discoveryInterval"` //The maximum number of discovered nodes at a time Limit int `json:"limit"` MDNSEnabled bool `json:"mDNSEnabled"` // Time in seconds between local discovery rounds MDNSInterval int `json:"mDNSInterval"` }
type GRPCConfig ¶ added in v1.4.0
type GRPCConfig struct { Enable bool `json:"enabled"` // TCP or UNIX socket address for the gRPC server to listen on ListenAddress string `json:"listenAddress"` HTTPEnable bool `json:"httpEnabled"` // TCP or UNIX socket address for the Restful server to listen on HTTPListenAddress string `json:"httpListenAddress"` MaxSubscriptionClients int `json:"maxSubClients"` }
type Genesis ¶ added in v1.4.0
type Genesis struct {
GenesisBlocks []*GenesisInfo `json:"genesisBlocks"`
}
type GenesisInfo ¶ added in v1.4.0
type GenesisInfo struct { ChainToken bool `json:"chainToken"` GasToken bool `json:"gasToken"` Mintage types.StateBlock `mapstructure:",squash" json:"mintage"` Genesis types.StateBlock `mapstructure:",squash" json:"genesis"` }
func GenesisInfos ¶ added in v1.4.0
func GenesisInfos() []*GenesisInfo
type IdentityConfigV1 ¶ added in v1.0.1
Identity tracks the configuration of the local node's identity.
type IdentityConfigV2 ¶ added in v1.0.1
type MetricsConfig ¶ added in v1.3.0
type MigrationV1ToV2 ¶ added in v1.0.1
type MigrationV1ToV2 struct {
// contains filtered or unexported fields
}
func NewMigrationV1ToV2 ¶ added in v1.0.1
func NewMigrationV1ToV2() *MigrationV1ToV2
func (*MigrationV1ToV2) EndVersion ¶ added in v1.0.1
func (m *MigrationV1ToV2) EndVersion() int
func (*MigrationV1ToV2) StartVersion ¶ added in v1.0.1
func (m *MigrationV1ToV2) StartVersion() int
type MigrationV2ToV3 ¶ added in v1.1.0
type MigrationV2ToV3 struct {
// contains filtered or unexported fields
}
func NewMigrationV2ToV3 ¶ added in v1.1.0
func NewMigrationV2ToV3() *MigrationV2ToV3
func (*MigrationV2ToV3) EndVersion ¶ added in v1.1.0
func (m *MigrationV2ToV3) EndVersion() int
func (*MigrationV2ToV3) StartVersion ¶ added in v1.1.0
func (m *MigrationV2ToV3) StartVersion() int
type MigrationV3ToV4 ¶ added in v1.2.3
type MigrationV3ToV4 struct {
// contains filtered or unexported fields
}
func NewMigrationV3ToV4 ¶ added in v1.2.3
func NewMigrationV3ToV4() *MigrationV3ToV4
func (*MigrationV3ToV4) EndVersion ¶ added in v1.2.3
func (m *MigrationV3ToV4) EndVersion() int
func (*MigrationV3ToV4) StartVersion ¶ added in v1.2.3
func (m *MigrationV3ToV4) StartVersion() int
type MigrationV4ToV5 ¶ added in v1.3.0
type MigrationV4ToV5 struct {
// contains filtered or unexported fields
}
func NewMigrationV4ToV5 ¶ added in v1.3.0
func NewMigrationV4ToV5() *MigrationV4ToV5
func (*MigrationV4ToV5) EndVersion ¶ added in v1.3.0
func (m *MigrationV4ToV5) EndVersion() int
func (*MigrationV4ToV5) StartVersion ¶ added in v1.3.0
func (m *MigrationV4ToV5) StartVersion() int
type MigrationV5ToV6 ¶ added in v1.4.0
type MigrationV5ToV6 struct {
// contains filtered or unexported fields
}
func NewMigrationV5ToV6 ¶ added in v1.4.0
func NewMigrationV5ToV6() *MigrationV5ToV6
func (*MigrationV5ToV6) EndVersion ¶ added in v1.4.0
func (m *MigrationV5ToV6) EndVersion() int
func (*MigrationV5ToV6) StartVersion ¶ added in v1.4.0
func (m *MigrationV5ToV6) StartVersion() int
type MigrationV6ToV7 ¶ added in v1.4.0
type MigrationV6ToV7 struct {
// contains filtered or unexported fields
}
func NewMigrationV6ToV7 ¶ added in v1.4.0
func NewMigrationV6ToV7() *MigrationV6ToV7
func (*MigrationV6ToV7) EndVersion ¶ added in v1.4.0
func (m *MigrationV6ToV7) EndVersion() int
func (*MigrationV6ToV7) StartVersion ¶ added in v1.4.0
func (m *MigrationV6ToV7) StartVersion() int
type MigrationV7ToV8 ¶ added in v1.4.0
type MigrationV7ToV8 struct {
// contains filtered or unexported fields
}
func NewMigrationV7ToV8 ¶ added in v1.4.0
func NewMigrationV7ToV8() *MigrationV7ToV8
func (*MigrationV7ToV8) EndVersion ¶ added in v1.4.0
func (m *MigrationV7ToV8) EndVersion() int
func (*MigrationV7ToV8) StartVersion ¶ added in v1.4.0
func (m *MigrationV7ToV8) StartVersion() int
type MigrationV8ToV10 ¶ added in v1.4.2
type MigrationV8ToV10 struct {
// contains filtered or unexported fields
}
func NewMigrationV8ToV10 ¶ added in v1.4.2
func NewMigrationV8ToV10() *MigrationV8ToV10
func (*MigrationV8ToV10) EndVersion ¶ added in v1.4.2
func (m *MigrationV8ToV10) EndVersion() int
func (*MigrationV8ToV10) StartVersion ¶ added in v1.4.2
func (m *MigrationV8ToV10) StartVersion() int
type P2PConfigV1 ¶ added in v1.0.1
type P2PConfigV2 ¶ added in v1.0.1
type P2PConfigV2 struct { BootNodes []string `json:"bootNode" mapstructure:"bootNode"` IsBootNode bool `json:"isBootNode"` BootNodeHttpServer string `json:"bootNodeHttpServer"` Listen string `json:"listen"` // if you are bootNode,should fill in the listening ip ListeningIp string `json:"listeningIp"` //Time in seconds between sync block interval SyncInterval int `json:"syncInterval"` Discovery *DiscoveryConfigV2 `json:"discovery"` ID *IdentityConfigV2 `json:"identity" mapstructure:"identity"` }
type PerformanceTestConfigV1 ¶ added in v1.0.1
type PerformanceTestConfigV1 struct {
Enabled bool
}
type PoVConfig ¶ added in v1.2.3
type PoVConfig struct { PovEnabled bool `json:"povEnabled"` MinerEnabled bool `json:"minerEnabled"` Coinbase string `json:"coinbase" validate:"address"` AlgoName string `json:"algoName"` ChainParams *ChainParams `json:"chainParams"` }
type RPCConfigV1 ¶ added in v1.0.1
type RPCConfigV1 struct { Enable bool `json:"enable"` //Listen string `json:"Listen"` HTTPEndpoint string `json:"hTTPEndpoint"` HTTPEnabled bool `json:"hTTPEnabled"` HTTPCors []string `json:"hTTPCors"` HttpVirtualHosts []string `json:"httpVirtualHosts"` WSEnabled bool `json:"wSEnabled"` WSEndpoint string `json:"wSEndpoint"` IPCEndpoint string `json:"iPCEndpoint"` IPCEnabled bool `json:"iPCEnabled"` }
type RPCConfigV2 ¶ added in v1.0.1
type RPCConfigV2 struct { Enable bool `json:"rpcEnabled" mapstructure:"rpcEnabled"` //Listen string `json:"Listen"` HTTPEndpoint string `json:"httpEndpoint"` HTTPEnabled bool `json:"httpEnabled"` HTTPCors []string `json:"httpCors"` HttpVirtualHosts []string `json:"httpVirtualHosts"` WSEnabled bool `json:"webSocketEnabled" mapstructure:"webSocketEnabled"` WSEndpoint string `json:"webSocketEndpoint" mapstructure:"webSocketEndpoint"` IPCEndpoint string `json:"ipcEndpoint"` IPCEnabled bool `json:"ipcEnabled"` PublicModules []string `json:"publicModules"` GRPCConfig *GRPCConfig `json:"gRPCConfig"` }
type WhiteList ¶ added in v1.4.0
type WhiteList struct { Enable bool `json:"enable"` WhiteListInfos []*WhiteListInfo `json:"whiteListInfo"` }
type WhiteListInfo ¶ added in v1.4.0
Source Files ¶
- config.go
- config_manager.go
- config_v1.go
- config_v10.go
- config_v1_default.go
- config_v2.go
- config_v2_default.go
- config_v3.go
- config_v4.go
- config_v5.go
- config_v6.go
- config_v7.go
- config_v8.go
- defaults.go
- defaults_net.go
- genesis.go
- migrate.go
- migration_v1_v2.go
- migration_v2_v3.go
- migration_v3_v4.go
- migration_v4_v5.go
- migration_v5_v6.go
- migration_v6_v7.go
- migration_v7_v8.go
- migration_v8_v10.go
- verifier.go
Click to show internal directories.
Click to hide internal directories.