Documentation
¶
Index ¶
- Constants
- Variables
- func GetChannel(channel string, nid int) string
- func IsNodeCacheOption(s string) bool
- func NewChain(wallet module.Wallet, transport module.NetworkTransport, srv *server.Manager, ...) *singleChain
- func NewRegulator(logger log.Logger) *regulator
- type BackupInfo
- type Config
- type State
Constants ¶
View Source
const ( DefaultDBDir = "db" DefaultWALDir = "wal" DefaultContractDir = "contract" DefaultCacheDir = "cache" DefaultTmpDBDir = "tmp" )
View Source
const ( ConfigDefaultNormalTxPoolSize = 5000 ConfigDefaultPatchTxPoolSize = 1000 ConfigDefaultMaxBlockTxBytes = 1024 * 1024 )
View Source
const ( NodeCacheNone = "none" NodeCacheSmall = "small" NodeCacheLarge = "large" NodeCacheDefault = NodeCacheNone )
View Source
const ( ConfigDefaultTransactions = 1000 ConfigDefaultCommitTimeout = time.Second ConfigDefaultBlockInterval = time.Second ConfigDefaultMinCommitTimeout = 200 * time.Millisecond )
View Source
const TemporalBackupFile = ".backup"
Variables ¶
View Source
var NodeCacheOptions = [...]string{ NodeCacheNone, NodeCacheSmall, NodeCacheLarge, }
Functions ¶
func GetChannel ¶
func IsNodeCacheOption ¶
func NewRegulator ¶
Types ¶
type BackupInfo ¶
type BackupInfo struct {
NID common.HexInt32 `json:"nid"`
CID common.HexInt32 `json:"cid"`
Channel string `json:"channel"`
Height int64 `json:"height"`
Codec string `json:"codec"`
}
func GetBackupInfoOf ¶
func GetBackupInfoOf(f string) (*BackupInfo, error)
func ReadBackupInfo ¶
func ReadBackupInfo(zr *zip.Reader) (*BackupInfo, error)
type Config ¶
type Config struct {
// fixed
NID int `json:"nid"`
DBType string `json:"db_type"`
// static
SeedAddr string `json:"seed_addr"`
Role uint `json:"role"`
ConcurrencyLevel int `json:"concurrency_level,omitempty"`
NormalTxPoolSize int `json:"normal_tx_pool,omitempty"`
PatchTxPoolSize int `json:"patch_tx_pool,omitempty"`
MaxBlockTxBytes int `json:"max_block_tx_bytes,omitempty"`
NodeCache string `json:"node_cache,omitempty"`
AutoStart bool `json:"auto_start,omitempty"`
// runtime
Channel string `json:"channel"`
SecureSuites string `json:"secureSuites"`
SecureAeads string `json:"secureAeads"`
DefWaitTimeout int64 `json:"waitTimeout"`
MaxWaitTimeout int64 `json:"maxTimeout"`
GenesisStorage module.GenesisStorage `json:"-"`
Genesis json.RawMessage `json:"genesis"`
BaseDir string `json:"chain_dir"`
FilePath string `json:"-"` // absolute path
NIDForP2P bool `json:"-"`
}
func (*Config) AbsBaseDir ¶
func (*Config) GetChannel ¶
func (*Config) ResolveAbsolute ¶
func (*Config) ResolveRelative ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.