config

package
v3.8.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 14, 2020 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultDataDir         = "./datadir/"
	DefaultConfigToml      = "./config.toml"
	DefaultGenesisToml     = "./genesis.toml"
	DefaultRESTPort        = 8689
	DefaultWalletRESTPort  = 6869
	DefaultLogRESTPort     = 6870
	DefaultRESTHost        = "localhost"
	DefaultP2PPort         = 9868
	DefaultP2PAuthRequried = false
	DefaultMaxPeer         = 500
	DefaultRPCServiceName  = "bottos"
	DefaultRPCServiceVer   = "3.2.0"
)
View Source
const (
	DefaultGenesisTime = "2018-08-01T12:00:00Z"
	DefaultGenesisKey  = "" /* 130-byte string literal not displayed */
	PUBKEY_LEN         = 130
)
View Source
const BLOCKS_PER_ROUND uint32 = 29

BLOCKS_PER_ROUND define block num per round

View Source
const BOTTOS_CONTRACT_NAME string = "bottos"

BOTTOS_CONTRACT_NAME define system contract name

View Source
const BOTTOS_INIT_SUPPLY uint64 = 1000000000

BOTTOS_INIT_SUPPLY define bto total supply

View Source
const BOTTOS_SUPPLY_MUL uint64 = 100000000

BOTTOS_SUPPLY_MUL define dot num of bto

View Source
const CONSENSUS_BLOCKS_PERCENT uint32 = 70

CONSENSUS_BLOCKS_PERCENT define consensus rate

View Source
const DEFALT_SLOT_CHECK_INTERVAL = 500000

DEFALT_SLOT_CHECK_INTERVAL define default slot check interval

View Source
const DEFAULT_BLOCK_CONSENSUS_TIMEOUT uint32 = 18

DEFAULT_BLOCK_CONSENSUS_TIMEOUT define default block consensus timeout time 6 block 18s

View Source
const DEFAULT_BLOCK_INTERVAL uint32 = 3

DEFAULT_BLOCK_INTERVAL define defalut interval of block production

View Source
const DEFAULT_BLOCK_TIME_LIMIT uint64 = 1000

DEFAULT_BLOCK_TIME_LIMIT define default block time limit when producing block

View Source
const DEFAULT_MAX_LIFE_TIME uint64 = 10000 //unit: second

DEFAULT_MAX_LIFE_TIME define max life time for a transaction

View Source
const DEFAULT_MAX_PENDING_TRX_IN_POOL uint64 = 30000

DEFAULT_MAX_PENDING_TRX_IN_POOL define max pending transaction num in local transaction pool

View Source
const DEFAULT_MAX_SYNC_DISTANCE_PUT_TRX_IN_CACHE uint64 = 3
View Source
const DEFAULT_OPTIONDB_NAME string = "bottos"

DEFAULT_OPTIONDB_NAME define default option db name

View Source
const DEFAULT_OPTIONDB_TABLE_ACCOUNT_NAME string = "Accounts"

DEFAULT_OPTIONDB_TABLE_ACCOUNT_NAME define default option db table name of account

View Source
const DEFAULT_OPTIONDB_TABLE_BLOCK_NAME string = "Blocks"

DEFAULT_OPTIONDB_TABLE_BLOCK_NAME define default option db table name of block

View Source
const DEFAULT_OPTIONDB_TABLE_TRX_NAME string = "Transactions"

DEFAULT_OPTIONDB_TABLE_TRX_NAME define default option db table name of trx

View Source
const DEFAUL_MAX_CONTRACT_DEPTH uint32 = 10

DEFAUL_MAX_CONTRACT_DEPTH define max call contract depth

View Source
const DEFAUL_MAX_NOTICE_CONTRACT_NUM uint32 = 5
View Source
const DEFAUL_MAX_SUB_CONTRACT_NUM uint32 = 10

DEFAUL_MAX_SUB_CONTRACT_NUM define max sub contract num

View Source
const DELEGATE_PATICIPATION uint32 = 33

DELEGATE_PATICIPATION define delegate paticipation

View Source
const HASH_SHA256_LENGTH int = 32

HASH_SHA256_LENGTH define sha256 hash value length

View Source
const MAX_BLOCK_SIZE uint32 = 5242880 // Byte

MAX_BLOCK_SIZE define max block size

View Source
const MAX_DELEGATE_VOTES uint32 = 49

MAX_DELEGATE_VOTES define max delegate votes

View Source
const PRIMARY_TRX_SESSION string = "primary"
View Source
const PRIVATE_KEY_REGEXP string = "[0-9a-zA-Z]{64}"

PRIVATE_KEY_REGEXP define private key format

View Source
const PRODUCER_TIME_OUT uint32 = 50

PRODUCER_TIME_OUT for actor to set time out with millseconds

View Source
const PUBLIC_KEY_REGEXP string = "[0-9a-zA-Z]{130}"

PUBLIC_KEY_REGEXP define public key format

View Source
const SUB_TRX_SESSION string = "subsession"
View Source
const TOTAL_DELEGATE_REWARD uint64 = 64000000

TOTAL_DELEGATE_REWARD total delegate reward

View Source
const TRX_IN uint16 = 0
View Source
const TRX_IN_TTL uint16 = 1
View Source
const TRX_OUT uint16 = 1
View Source
const TRX_OUT_TTL uint16 = 16
View Source
const VOTED_DELEGATES_PER_ROUND uint32 = 28

VOTED_DELEGATES_PER_ROUND define voted delegates per round

Variables

View Source
var (
	// BtoConfig general config parameter
	BtoConfig BottosConfig
	// Genesis genesis config
	Genesis GenesisConfig
	// ChainID chain id generated by genesis config
	ChainID common.Hash
)

Functions

func AddressValidateAll

func AddressValidateAll(ipAddrs []string) (bool, error)

AddressValidateAll validate the IP:port is valid

func FileExist

func FileExist(fn string) bool

func GetChainID

func GetChainID() []byte

func GetDelegateSignKey

func GetDelegateSignKey(pubkey string) ([]byte, error)

func IPValidate

func IPValidate(ip string) (bool, error)

IPValidate validate the IP is valid

func InitConfig

func InitConfig()

func InitLogConfig

func InitLogConfig(ctx *cli.Context) error

InitLogConfig initialize log config

func LoadConfig

func LoadConfig(ctx *cli.Context) error

LoadConfig is to load config file

func LoadGenesisFile

func LoadGenesisFile(fn string) error

func MongoURLValidate

func MongoURLValidate(url string) (bool, error)

MongoURLValidate validate the mongoDB Url is valid

func PortValidate

func PortValidate(port int) (bool, error)

PortValidate validate the port is valid

func SetGenesisConfig

func SetGenesisConfig(config *GenesisConfig)

func SignKeyValidate

func SignKeyValidate(privateKey, publicKey string) (bool, error)

SignKeyValidate validate the keypair is valid

Types

type BottosConfig

type BottosConfig struct {
	Node     NodeConfig
	Rest     RestConfig
	P2P      P2PConfig
	Delegate DelegateConfig
	Plugin   PluginConfig
}

type DelegateConfig

type DelegateConfig struct {
	Account   string
	Solo      bool
	Signature Signature
}

type GenesisConfig

type GenesisConfig struct {
	GenesisTime uint64
	GenesisKey  []byte
}

GenesisConfig is definition of genesis config

type LogRestConfig

type LogRestConfig struct {
	LogRESTPort int
	LogRESTHost string
}

type MongoDBConfig

type MongoDBConfig struct {
	URL string
}

type NodeConfig

type NodeConfig struct {
	DataDir string
}

type P2PConfig

type P2PConfig struct {
	P2PPort         int
	P2PServAddr     string
	PeerList        []string
	P2PAuthRequried bool
	P2PAuthKeyList  []string
	MaxPeer         int
}

type PluginConfig

type PluginConfig struct {
	Wallet  WalletConfig
	Log     LogRestConfig
	MongoDB MongoDBConfig
}

type RestConfig

type RestConfig struct {
	RESTPort int
	RESTHost string
}

type Signature

type Signature struct {
	Type       string
	PrivateKey string
	PublicKey  string
	URL        string
}

KeyPair is definition of key pair

type WalletConfig

type WalletConfig struct {
	WalletDir      string
	WalletRESTPort int
	WalletRESTHost string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL