intelchain

package
v1.10.2 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: LGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlsConfig

type BlsConfig struct {
	KeyDir   string
	KeyFiles []string
	MaxKeys  int

	PassEnabled    bool
	PassSrcType    string
	PassFile       string
	SavePassphrase bool

	KMSEnabled       bool
	KMSConfigSrcType string
	KMSConfigFile    string
}

type CacheConfig

type CacheConfig struct {
	Disabled        bool          // Whether to disable trie write caching (archive node)
	TrieNodeLimit   int           // Memory limit (MB) at which to flush the current in-memory trie to disk
	TrieTimeLimit   time.Duration // Time limit after which to flush the current in-memory trie to disk
	TriesInMemory   uint64        // Block number from the head stored in disk before exiting
	Preimages       bool          // Whether to store preimage of trie key to the disk
	SnapshotLimit   int           // Memory allowance (MB) to use for caching snapshot entries in memory
	SnapshotNoBuild bool          // Whether the background generation is allowed
	SnapshotWait    bool          // Wait for snapshot construction on startup
}

type ConsensusConfig

type ConsensusConfig struct {
	MinPeers     int
	AggregateSig bool
}

type DevnetConfig

type DevnetConfig struct {
	NumShards   int
	ShardSize   int
	ItcNodeSize int
	SlotsLimit  int // HIP-16: The absolute number of maximum effective slots per shard limit for each validator. 0 means no limit.
}

type DnsSync

type DnsSync struct {
	Port       int    // replaces: Network.DNSSyncPort
	Zone       string // replaces: Network.DNSZone
	Client     bool   // replaces: Sync.LegacyClient
	Server     bool   // replaces: Sync.LegacyServer
	ServerPort int
}

type GasPriceOracleConfig

type GasPriceOracleConfig struct {
	// the number of blocks to sample
	Blocks int
	// the number of transactions to sample, per block
	Transactions int
	// the percentile to pick from there
	Percentile int
	// the default gas price, if the above data is not available
	DefaultPrice int64
	// the maximum suggested gas price
	MaxPrice int64
	// when block usage (gas) for last `Blocks` blocks is below `LowUsageThreshold`,
	// we return the Default price
	LowUsageThreshold int
	// hack: our block header reports an 80m gas limit, but it is actually 30M.
	// if set to non-zero, this is applied UNCHECKED
	BlockGasLimit int
}

type GeneralConfig

type GeneralConfig struct {
	NodeType               string
	NoStaking              bool
	ShardID                int
	IsArchival             bool
	IsBackup               bool
	IsBeaconArchival       bool
	IsOffline              bool
	DataDir                string
	TraceEnable            bool
	EnablePruneBeaconChain bool
	RunElasticMode         bool
}

type HttpConfig

type HttpConfig struct {
	Enabled        bool
	IP             string
	Port           int
	AuthPort       int
	RosettaEnabled bool
	RosettaPort    int
	ReadTimeout    string
	WriteTimeout   string
	IdleTimeout    string
}

type IntelchainConfig

type IntelchainConfig struct {
	Version    string
	General    GeneralConfig
	Network    NetworkConfig
	P2P        P2pConfig
	HTTP       HttpConfig
	WS         WsConfig
	RPCOpt     RpcOptConfig
	BLSKeys    BlsConfig
	TxPool     TxPoolConfig
	Pprof      PprofConfig
	Log        LogConfig
	Sync       SyncConfig
	Sys        *SysConfig        `toml:",omitempty"`
	Consensus  *ConsensusConfig  `toml:",omitempty"`
	Devnet     *DevnetConfig     `toml:",omitempty"`
	Revert     *RevertConfig     `toml:",omitempty"`
	Legacy     *LegacyConfig     `toml:",omitempty"`
	Prometheus *PrometheusConfig `toml:",omitempty"`
	TiKV       *TiKVConfig       `toml:",omitempty"`
	DNSSync    DnsSync
	ShardData  ShardDataConfig
	GPO        GasPriceOracleConfig
	Preimage   *PreimageConfig
	Cache      CacheConfig
}

IntelchainConfig contains all the configs user can set for running Intelchain binary. Served as the bridge from user set flags to internal node configs. Also user can persist this structure to a toml file to avoid inputting all arguments.

func (IntelchainConfig) ToRPCServerConfig

func (hc IntelchainConfig) ToRPCServerConfig() nodeconfig.RPCServerConfig

type LegacyConfig

type LegacyConfig struct {
	WebHookConfig         *string `toml:",omitempty"`
	TPBroadcastInvalidTxn *bool   `toml:",omitempty"`
}

type LogConfig

type LogConfig struct {
	Console       bool
	Folder        string
	FileName      string
	RotateSize    int
	RotateCount   int
	RotateMaxAge  int
	Verbosity     int
	VerbosePrints LogVerbosePrints
	Context       *LogContext `toml:",omitempty"`
}

type LogContext

type LogContext struct {
	IP   string
	Port int
}

type LogVerbosePrints

type LogVerbosePrints struct {
	Config bool
}

func FlagSliceToLogVerbosePrints

func FlagSliceToLogVerbosePrints(verbosePrintsFlagSlice []string) LogVerbosePrints

type NetworkConfig

type NetworkConfig struct {
	NetworkType string
	BootNodes   []string
}

type P2pConfig

type P2pConfig struct {
	Port                 int
	IP                   string
	KeyFile              string
	DHTDataStore         *string `toml:",omitempty"`
	DiscConcurrency      int     // Discovery Concurrency value
	MaxConnsPerIP        int
	DisablePrivateIPScan bool
	MaxPeers             int64
	// In order to disable Connection Manager, it only needs to
	// set both the high and low watermarks to zero. In this way,
	// using Connection Manager will be an optional feature.
	ConnManagerLowWatermark  int
	ConnManagerHighWatermark int
	WaitForEachPeerToConnect bool
}

type PprofConfig

type PprofConfig struct {
	Enabled            bool
	ListenAddr         string
	Folder             string
	ProfileNames       []string
	ProfileIntervals   []int
	ProfileDebugValues []int
}

type PreimageConfig

type PreimageConfig struct {
	ImportFrom    string
	ExportTo      string
	GenerateStart uint64
	GenerateEnd   uint64
}

type PriceLimit

type PriceLimit int64

func (PriceLimit) MarshalTOML

func (s PriceLimit) MarshalTOML() ([]byte, error)

func (*PriceLimit) UnmarshalTOML

func (s *PriceLimit) UnmarshalTOML(data interface{}) error

type PrometheusConfig

type PrometheusConfig struct {
	Enabled    bool
	IP         string
	Port       int
	EnablePush bool
	Gateway    string
}

type RevertConfig

type RevertConfig struct {
	RevertBeacon bool
	RevertTo     int
	RevertBefore int
}

TODO: make `revert` to a separate command

type RpcOptConfig

type RpcOptConfig struct {
	DebugEnabled       bool   // Enables PrivateDebugService APIs, including the EVM tracer
	EthRPCsEnabled     bool   // Expose Eth RPCs
	StakingRPCsEnabled bool   // Expose Staking RPCs
	LegacyRPCsEnabled  bool   // Expose Legacy RPCs
	RpcFilterFile      string // Define filters to enable/disable RPC exposure
	RateLimterEnabled  bool   // Enable Rate limiter for RPC
	RequestsPerSecond  int    // for RPC rate limiter
	EvmCallTimeout     string // Timeout for eth_call
	PreimagesEnabled   bool   // Expose preimage API
}

type ShardDataConfig

type ShardDataConfig struct {
	EnableShardData bool
	DiskCount       int
	ShardCount      int
	CacheTime       int
	CacheSize       int
}

type StagedSyncConfig

type StagedSyncConfig struct {
	TurboMode              bool   // turn on turbo mode
	DoubleCheckBlockHashes bool   // double check all block hashes before download blocks
	MaxBlocksPerSyncCycle  uint64 // max number of blocks per each sync cycle, if set to zero, all blocks will be synced in one full cycle
	MaxBackgroundBlocks    uint64 // max number of background blocks in turbo mode
	InsertChainBatchSize   int    // number of blocks to build a batch and insert to chain in staged sync
	MaxMemSyncCycleSize    uint64 // max number of blocks to use a single transaction for staged sync
	VerifyAllSig           bool   // verify signatures for all blocks regardless of height and batch size
	VerifyHeaderBatchSize  uint64 // batch size to verify header before insert to chain
	UseMemDB               bool   // it uses memory by default. set it to false to use disk
	LogProgress            bool   // log the full sync progress in console
	DebugMode              bool   // log every single process and error to help to debug syncing issues (DebugMode is not accessible to the end user and is only an aid for development)
}

type SyncConfig

type SyncConfig struct {
	// TODO: Remove this bool after stream sync is fully up.
	Enabled              bool             // enable the stream sync protocol
	SyncMode             uint32           // sync mode (default:Full sync, 1: Fast Sync, 2: Snap Sync(not implemented yet))
	Downloader           bool             // start the sync downloader client
	StagedSync           bool             // use staged sync
	StagedSyncCfg        StagedSyncConfig // staged sync configurations
	Concurrency          int              // concurrency used for stream sync protocol
	MinPeers             int              // minimum streams to start a sync task.
	InitStreams          int              // minimum streams in bootstrap to start sync loop.
	MaxAdvertiseWaitTime int              // maximum time duration between advertisements
	DiscSoftLowCap       int              // when number of streams is below this value, spin discover during check
	DiscHardLowCap       int              // when removing stream, num is below this value, spin discovery immediately
	DiscHighCap          int              // upper limit of streams in one sync protocol
	DiscBatch            int              // size of each discovery
}

type SysConfig

type SysConfig struct {
	NtpServer string
}

type TiKVConfig

type TiKVConfig struct {
	Debug bool

	PDAddr                      []string
	Role                        string
	StateDBCacheSizeInMB        uint32
	StateDBCachePersistencePath string
	StateDBRedisServerAddr      []string
	StateDBRedisLRUTimeInDay    uint32
}

type TxPoolConfig

type TxPoolConfig struct {
	BlacklistFile     string
	AllowedTxsFile    string
	RosettaFixFile    string
	AccountSlots      uint64
	AccountQueue      uint64
	GlobalQueue       uint64
	LocalAccountsFile string
	GlobalSlots       uint64
	Lifetime          time.Duration
	PriceLimit        PriceLimit
	PriceBump         uint64
}

type WsConfig

type WsConfig struct {
	Enabled  bool
	IP       string
	Port     int
	AuthPort int
}

Jump to

Keyboard shortcuts

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