Documentation ¶
Index ¶
- Constants
- Variables
- func AddressValidateAll(ipAddrs []string) (bool, error)
- func FileExist(fn string) bool
- func GetChainID() []byte
- func GetDelegateSignKey(pubkey string) ([]byte, error)
- func IPValidate(ip string) (bool, error)
- func InitConfig()
- func InitLogConfig(ctx *cli.Context) error
- func LoadConfig(ctx *cli.Context) error
- func LoadGenesisFile(fn string) error
- func MongoURLValidate(url string) (bool, error)
- func PortValidate(port int) (bool, error)
- func SetGenesisConfig(config *GenesisConfig)
- func SignKeyValidate(privateKey, publicKey string) (bool, error)
- type BottosConfig
- type DelegateConfig
- type GenesisConfig
- type LogRestConfig
- type MongoDBConfig
- type NodeConfig
- type P2PConfig
- type PluginConfig
- type RestConfig
- type Signature
- type WalletConfig
Constants ¶
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" )
const ( DefaultGenesisTime = "2018-08-01T12:00:00Z" DefaultGenesisKey = "" /* 130-byte string literal not displayed */ PUBKEY_LEN = 130 )
const BLOCKS_PER_ROUND uint32 = 29
BLOCKS_PER_ROUND define block num per round
const BOTTOS_CONTRACT_NAME string = "bottos"
BOTTOS_CONTRACT_NAME define system contract name
const BOTTOS_INIT_SUPPLY uint64 = 1000000000
BOTTOS_INIT_SUPPLY define bto total supply
const BOTTOS_SUPPLY_MUL uint64 = 100000000
BOTTOS_SUPPLY_MUL define dot num of bto
const CONSENSUS_BLOCKS_PERCENT uint32 = 70
CONSENSUS_BLOCKS_PERCENT define consensus rate
const DEFALT_SLOT_CHECK_INTERVAL = 500000
DEFALT_SLOT_CHECK_INTERVAL define default slot check interval
const DEFAULT_BLOCK_CONSENSUS_TIMEOUT uint32 = 18
DEFAULT_BLOCK_CONSENSUS_TIMEOUT define default block consensus timeout time 6 block 18s
const DEFAULT_BLOCK_INTERVAL uint32 = 3
DEFAULT_BLOCK_INTERVAL define defalut interval of block production
const DEFAULT_BLOCK_TIME_LIMIT uint64 = 1000
DEFAULT_BLOCK_TIME_LIMIT define default block time limit when producing block
const DEFAULT_MAX_LIFE_TIME uint64 = 10000 //unit: second
DEFAULT_MAX_LIFE_TIME define max life time for a transaction
const DEFAULT_MAX_PENDING_TRX_IN_POOL uint64 = 30000
DEFAULT_MAX_PENDING_TRX_IN_POOL define max pending transaction num in local transaction pool
const DEFAULT_MAX_SYNC_DISTANCE_PUT_TRX_IN_CACHE uint64 = 3
const DEFAULT_OPTIONDB_NAME string = "bottos"
DEFAULT_OPTIONDB_NAME define default option db name
const DEFAULT_OPTIONDB_TABLE_ACCOUNT_NAME string = "Accounts"
DEFAULT_OPTIONDB_TABLE_ACCOUNT_NAME define default option db table name of account
const DEFAULT_OPTIONDB_TABLE_BLOCK_NAME string = "Blocks"
DEFAULT_OPTIONDB_TABLE_BLOCK_NAME define default option db table name of block
const DEFAULT_OPTIONDB_TABLE_TRX_NAME string = "Transactions"
DEFAULT_OPTIONDB_TABLE_TRX_NAME define default option db table name of trx
const DEFAUL_MAX_CONTRACT_DEPTH uint32 = 10
DEFAUL_MAX_CONTRACT_DEPTH define max call contract depth
const DEFAUL_MAX_NOTICE_CONTRACT_NUM uint32 = 5
const DEFAUL_MAX_SUB_CONTRACT_NUM uint32 = 10
DEFAUL_MAX_SUB_CONTRACT_NUM define max sub contract num
const DELEGATE_PATICIPATION uint32 = 33
DELEGATE_PATICIPATION define delegate paticipation
const HASH_SHA256_LENGTH int = 32
HASH_SHA256_LENGTH define sha256 hash value length
const MAX_BLOCK_SIZE uint32 = 5242880 // Byte
MAX_BLOCK_SIZE define max block size
const MAX_DELEGATE_VOTES uint32 = 49
MAX_DELEGATE_VOTES define max delegate votes
const PRIMARY_TRX_SESSION string = "primary"
const PRIVATE_KEY_REGEXP string = "[0-9a-zA-Z]{64}"
PRIVATE_KEY_REGEXP define private key format
const PRODUCER_TIME_OUT uint32 = 50
PRODUCER_TIME_OUT for actor to set time out with millseconds
const PUBLIC_KEY_REGEXP string = "[0-9a-zA-Z]{130}"
PUBLIC_KEY_REGEXP define public key format
const SUB_TRX_SESSION string = "subsession"
const TOTAL_DELEGATE_REWARD uint64 = 64000000
TOTAL_DELEGATE_REWARD total delegate reward
const TRX_IN uint16 = 0
const TRX_IN_TTL uint16 = 1
const TRX_OUT uint16 = 1
const TRX_OUT_TTL uint16 = 16
const VOTED_DELEGATES_PER_ROUND uint32 = 28
VOTED_DELEGATES_PER_ROUND define voted delegates per round
Variables ¶
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 ¶
AddressValidateAll validate the IP:port is valid
func GetChainID ¶
func GetChainID() []byte
func GetDelegateSignKey ¶
func InitConfig ¶
func InitConfig()
func LoadGenesisFile ¶
func MongoURLValidate ¶
MongoURLValidate validate the mongoDB Url is valid
func PortValidate ¶
PortValidate validate the port is valid
func SetGenesisConfig ¶
func SetGenesisConfig(config *GenesisConfig)
func SignKeyValidate ¶
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 GenesisConfig ¶
GenesisConfig is definition of genesis config
type LogRestConfig ¶
type MongoDBConfig ¶
type MongoDBConfig struct {
URL string
}
type NodeConfig ¶
type NodeConfig struct {
DataDir string
}
type PluginConfig ¶
type PluginConfig struct { Wallet WalletConfig Log LogRestConfig MongoDB MongoDBConfig }