Documentation
¶
Index ¶
Constants ¶
const ( MinerBuildTag = "M" BlockProducerBuildTag = "B" ClientBuildTag = "C" UnknownBuildTag = "U" )
these const specify the role of this app, which can be "miner", "blockProducer".
const ( // MaxPendingTxsPerAccount defines the limit of pending transactions of one account. MaxPendingTxsPerAccount = 1000 // MaxTransactionsPerBlock defines the limit of transactions per block. MaxTransactionsPerBlock = 10000 // MaxRPCPoolPhysicalConnection defines max physical connection for one node pair. MaxRPCPoolPhysicalConnection = 1024 // MaxRPCMuxPoolPhysicalConnection defines max underlying physical connection of mux component // for one node pair. MaxRPCMuxPoolPhysicalConnection = 2 )
const ( // MaxTxBroadcastTTL defines the TTL limit of a AddTx request broadcasting within the // block producers. MaxTxBroadcastTTL = 1 MaxCachedBlock = 1000 TCPDialTimeout = 10 * time.Second )
These limits will not cause inconsistency within certain range.
const (
BPHeightCIPFixProvideService = 675550 // inclusive, in 2019-5-15 16:11:40 +08:00
)
Block producer chain improvements proposal heights.
const (
BPStartupRequiredReachableCount = 2 // NOTE: this includes myself
)
These parameters will not cause inconsistency within certain range.
const (
DefaultConfirmThreshold = float64(2) / 3.0
)
This parameters should be kept consistent in all BPs.
const StartSucceedMessage = "CQL Started Successfully"
StartSucceedMessage is printed when CQL started successfully.
Variables ¶
var RoleTag = UnknownBuildTag
RoleTag indicate which role the daemon is playing.
Functions ¶
This section is empty.
Types ¶
type BPGenesisInfo ¶
type BPGenesisInfo struct {
// Version defines the block version
Version int32 `yaml:"Version"`
// Timestamp defines the initial time of chain
Timestamp time.Time `yaml:"Timestamp"`
// BaseAccounts defines the base accounts for testnet
BaseAccounts []BaseAccountInfo `yaml:"BaseAccounts"`
}
BPGenesisInfo hold all genesis info fields.
type BPInfo ¶
type BPInfo struct {
// PublicKey point to BlockProducer public key
PublicKey *asymmetric.PublicKey `yaml:"PublicKey"`
// NodeID is the node id of Block Producer
NodeID proto.NodeID `yaml:"NodeID"`
// RawNodeID
RawNodeID proto.RawNodeID `yaml:"-"`
// Nonce is the nonce, SEE: cmd/cql for more
Nonce cpuminer.Uint256 `yaml:"Nonce"`
// ChainFileName is the chain db's name
ChainFileName string `yaml:"ChainFileName"`
// BPGenesis is the genesis block filed
BPGenesis BPGenesisInfo `yaml:"BPGenesisInfo,omitempty"`
}
BPInfo hold all BP info fields.
type BaseAccountInfo ¶
type BaseAccountInfo struct {
Address hash.Hash `yaml:"Address"`
StableCoinBalance uint64 `yaml:"StableCoinBalance"`
CovenantCoinBalance uint64 `yaml:"CovenantCoinBalance"`
}
BaseAccountInfo defines base info to build a BaseAccount.
type Config ¶
type Config struct {
UseTestMasterKey bool `yaml:"UseTestMasterKey,omitempty"` // when UseTestMasterKey use default empty masterKey
// StartupSyncHoles indicates synchronizing hole blocks from other peers on BP
// startup/reloading.
StartupSyncHoles bool `yaml:"StartupSyncHoles,omitempty"`
GenerateKeyPair bool `yaml:"-"`
//TODO(auxten): set yaml key for config
WorkingRoot string `yaml:"WorkingRoot"`
PubKeyStoreFile string `yaml:"PubKeyStoreFile"`
PrivateKeyFile string `yaml:"PrivateKeyFile"`
WalletAddress string `yaml:"WalletAddress"`
DHTFileName string `yaml:"DHTFileName"`
ListenAddr string `yaml:"ListenAddr"`
ListenDirectAddr string `yaml:"ListenDirectAddr,omitempty"`
ExternalListenAddr string `yaml:"-"` // for metric purpose
ThisNodeID proto.NodeID `yaml:"ThisNodeID"`
ValidDNSKeys map[string]string `yaml:"ValidDNSKeys"` // map[DNSKEY]domain
// Check By BP DHT.Ping
MinNodeIDDifficulty int `yaml:"MinNodeIDDifficulty"`
DNSSeed DNSSeed `yaml:"DNSSeed"`
BP *BPInfo `yaml:"BlockProducer"`
Miner *MinerInfo `yaml:"Miner,omitempty"`
KnownNodes []proto.Node `yaml:"KnownNodes"`
SeedBPNodes []proto.Node `yaml:"-"`
QPS uint32 `yaml:"QPS"`
ChainBusPeriod time.Duration `yaml:"ChainBusPeriod"`
BillingBlockCount uint64 `yaml:"BillingBlockCount"` // BillingBlockCount is for sql chain miners syncing billing with main chain
BPPeriod time.Duration `yaml:"BPPeriod"`
BPTick time.Duration `yaml:"BPTick"`
SQLChainPeriod time.Duration `yaml:"SQLChainPeriod"`
SQLChainTick time.Duration `yaml:"SQLChainTick"`
SQLChainTTL int32 `yaml:"SQLChainTTL"`
MinProviderDeposit uint64 `yaml:"MinProviderDeposit"`
}
Config holds all the config read from yaml config file.
var GConf *Config
GConf is the global config pointer.
func LoadConfig ¶
LoadConfig loads config from configPath.
type DNSSeed ¶
type DNSSeed struct {
EnforcedDNSSEC bool `yaml:"EnforcedDNSSEC"`
DNSServers []string `yaml:"DNSServers"`
Domain string `yaml:"Domain"`
BPCount int `yaml:"BPCount"`
}
DNSSeed defines seed DNS info.
type MinerDatabaseFixture ¶
type MinerDatabaseFixture struct {
DatabaseID proto.DatabaseID `yaml:"DatabaseID"`
Term uint64 `yaml:"Term"`
Leader proto.NodeID `yaml:"Leader"`
Servers []proto.NodeID `yaml:"Servers"`
GenesisBlockFile string `yaml:"GenesisBlockFile"`
AutoGenerateGenesisBlock bool `yaml:"AutoGenerateGenesisBlock,omitempty"`
}
MinerDatabaseFixture config.
type MinerInfo ¶
type MinerInfo struct {
// node basic config.
RootDir string `yaml:"RootDir"`
MaxReqTimeGap time.Duration `yaml:"MaxReqTimeGap,omitempty"`
ProvideServiceInterval time.Duration `yaml:"ProvideServiceInterval,omitempty"`
DiskUsageInterval time.Duration `yaml:"DiskUsageInterval,omitempty"`
TargetUsers []proto.AccountAddress `yaml:"TargetUsers,omitempty"`
}
MinerInfo for miner config.