config

package
v0.0.0-...-dd56834 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultBlockTime minimum block generation time in seconds
	DefaultBlockTime uint64 = 2

	// BlockTimeMultiplierForTimeout Multiplier to get IBFT timeout from block time
	// timeout is calculated when IBFT timeout is not specified
	BlockTimeMultiplierForTimeout uint64 = 5

	// DefaultJSONRPCBatchRequestLimit maximum length allowed for json_rpc batch requests
	DefaultJSONRPCBatchRequestLimit uint64 = 20

	// DefaultJSONRPCBlockRangeLimit maximum block range allowed for json_rpc
	// requests with fromBlock/toBlock values (e.g. eth_getLogs)
	DefaultJSONRPCBlockRangeLimit uint64 = 1000

	// DefaultNumBlockConfirmations minimal number of child blocks required for the parent block to be considered final
	// on ethereum epoch lasts for 32 blocks. more details: https://www.alchemy.com/overviews/ethereum-commitment-levels
	DefaultNumBlockConfirmations uint64 = 64
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	GenesisPath              string     `json:"chain_config" yaml:"chain_config"`
	SecretsConfigPath        string     `json:"secrets_config" yaml:"secrets_config"`
	DataDir                  string     `json:"data_dir" yaml:"data_dir"`
	BlockGasTarget           string     `json:"block_gas_target" yaml:"block_gas_target"`
	GRPCAddr                 string     `json:"grpc_addr" yaml:"grpc_addr"`
	JSONRPCAddr              string     `json:"jsonrpc_addr" yaml:"jsonrpc_addr"`
	Telemetry                *Telemetry `json:"telemetry" yaml:"telemetry"`
	Network                  *Network   `json:"network" yaml:"network"`
	ShouldSeal               bool       `json:"seal" yaml:"seal"`
	TxPool                   *TxPool    `json:"tx_pool" yaml:"tx_pool"`
	LogLevel                 string     `json:"log_level" yaml:"log_level"`
	RestoreFile              string     `json:"restore_file" yaml:"restore_file"`
	BlockTime                uint64     `json:"block_time_s" yaml:"block_time_s"`
	Headers                  *Headers   `json:"headers" yaml:"headers"`
	LogFilePath              string     `json:"log_to" yaml:"log_to"`
	JSONRPCBatchRequestLimit uint64     `json:"json_rpc_batch_request_limit" yaml:"json_rpc_batch_request_limit"`
	JSONRPCBlockRangeLimit   uint64     `json:"json_rpc_block_range_limit" yaml:"json_rpc_block_range_limit"`
	JSONLogFormat            bool       `json:"json_log_format" yaml:"json_log_format"`

	Relayer               bool   `json:"relayer" yaml:"relayer"`
	NumBlockConfirmations uint64 `json:"num_block_confirmations" yaml:"num_block_confirmations"`
}

Config defines the server configuration params

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns the default server configuration

func ReadConfigFile

func ReadConfigFile(path string) (*Config, error)

ReadConfigFile reads the config file from the specified path, builds a Config object and returns it.

Supported file types: .json, .hcl, .yaml, .yml

type Headers

type Headers struct {
	AccessControlAllowOrigins []string `json:"access_control_allow_origins" yaml:"access_control_allow_origins"`
}

Headers defines the HTTP response headers required to enable CORS.

type Network

type Network struct {
	NoDiscover       bool   `json:"no_discover" yaml:"no_discover"`
	Libp2pAddr       string `json:"libp2p_addr" yaml:"libp2p_addr"`
	NatAddr          string `json:"nat_addr" yaml:"nat_addr"`
	DNSAddr          string `json:"dns_addr" yaml:"dns_addr"`
	MaxPeers         int64  `json:"max_peers,omitempty" yaml:"max_peers,omitempty"`
	MaxOutboundPeers int64  `json:"max_outbound_peers,omitempty" yaml:"max_outbound_peers,omitempty"`
	MaxInboundPeers  int64  `json:"max_inbound_peers,omitempty" yaml:"max_inbound_peers,omitempty"`
}

Network defines the network configuration params

type Telemetry

type Telemetry struct {
	PrometheusAddr string `json:"prometheus_addr" yaml:"prometheus_addr"`
}

Telemetry holds the config details for metric services.

type TxPool

type TxPool struct {
	PriceLimit         uint64 `json:"price_limit" yaml:"price_limit"`
	MaxSlots           uint64 `json:"max_slots" yaml:"max_slots"`
	MaxAccountEnqueued uint64 `json:"max_account_enqueued" yaml:"max_account_enqueued"`
}

TxPool defines the TxPool configuration params

Jump to

Keyboard shortcuts

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