CovenantSQL: Index | Files | Directories

package conf

import ""


Package Files

config.go limits.go parameters.go


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 = "CovenantSQL Started Successfully"

StartSucceedMessage is printed when CovenantSQL started successfully.


var RoleTag = UnknownBuildTag

RoleTag indicate which role the daemon is playing.

type BPGenesisInfo Uses

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 Uses

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 Uses

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 Uses

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 Uses

func LoadConfig(configPath string) (config *Config, err error)

LoadConfig loads config from configPath.

type DNSSeed Uses

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 Uses

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 Uses

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.


testnetPackage testnet contains the paraemters of the CovenantSQL TestNet.

Package conf imports 10 packages (graph) and is imported by 28 packages. Updated 2019-08-13. Refresh now. Tools for package owners.