Documentation ¶
Index ¶
- Constants
- 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 NewPlatform(name string, base string, cid int) (base.Platform, error)
- func NewRegulator(logger log.Logger) *regulator
- func ParseNodeCacheOption(s string) (int, int, int, error)
- func RegisterPlatform(name string, factory PlatformFactory)
- type BackupInfo
- type Config
- type PlatformFactory
- type RevertHandler
- type Revertible
- type State
- type TaskFactory
Constants ¶
View Source
const ( DefaultDBDir = "db" DefaultWALDir = "wal" DefaultContractDir = "contract" DefaultCacheDir = "cache" DefaultTmpDBDir = "tmp" )
View Source
const ( ConfigDefaultNormalTxPoolSize = 5000 ConfigDefaultPatchTxPoolSize = 1000 ConfigDefaultMaxBlockTxBytes = 1024 * 1024 ConfigDefaultTxTimeout = 5000 * time.Millisecond ConfigDefaultChildrenLimit = 10 ConfigDefaultNephewLimit = 10 )
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 ( ImportICONTask = "import_icon" ImportICONName = "ImportICON" )
View Source
const BackupSuffix = ".bk"
View Source
const (
TempSuffix = ".tmp"
)
View Source
const TemporalBackupFile = ".backup"
Variables ¶
This section is empty.
Functions ¶
func GetChannel ¶
func IsNodeCacheOption ¶
func NewPlatform ¶ added in v0.9.1
func NewRegulator ¶
func ParseNodeCacheOption ¶ added in v0.9.10
func RegisterPlatform ¶ added in v0.9.1
func RegisterPlatform(name string, factory PlatformFactory)
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"` Platform string `json:"platform,omitempty"` // 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"` ChildrenLimit *int `json:"children_limit,omitempty"` NephewsLimit *int `json:"nephews_limit,omitempty"` ValidateTxOnSend bool `json:"validate_tx_on_send,omitempty"` // runtime Channel string `json:"channel"` SecureSuites string `json:"secureSuites"` SecureAeads string `json:"secureAeads"` DefWaitTimeout int64 `json:"waitTimeout"` MaxWaitTimeout int64 `json:"maxTimeout"` TxTimeout int64 `json:"txTimeout"` 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 ¶
type PlatformFactory ¶ added in v0.9.1
type RevertHandler ¶ added in v1.2.11
type RevertHandler func(revert bool)
type Revertible ¶ added in v1.2.11
type Revertible []RevertHandler
func (*Revertible) Append ¶ added in v1.2.11
func (h *Revertible) Append(handler RevertHandler) int
func (*Revertible) Delete ¶ added in v1.2.11
func (h *Revertible) Delete(p string) error
func (*Revertible) Rename ¶ added in v1.2.11
func (h *Revertible) Rename(p1, p2 string) error
func (*Revertible) RevertOrCommit ¶ added in v1.2.11
func (h *Revertible) RevertOrCommit(revert bool)
func (*Revertible) RevertOrCommitOne ¶ added in v1.2.11
func (h *Revertible) RevertOrCommitOne(index int, revert bool) bool
type TaskFactory ¶ added in v0.9.6
type TaskFactory func(c *singleChain, params json.RawMessage) (chainTask, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.