config

package
v0.4.1-furyint-rc0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// DefaultListenAddress is a default listen address for P2P client.
	DefaultListenAddress = "/ip4/0.0.0.0/tcp/7676"
	// Version is a default furyint version for P2P client.
	Version = "0.2.2"
)

Variables

View Source
var (
	// DefaultDymintDir is the default directory for furyint
	DefaultDymintDir = ".furyint"
)
View Source
var DefaultNodeConfig = NodeConfig{
	P2P: P2PConfig{
		ListenAddress: DefaultListenAddress,
		Seeds:         "",
	},
	Aggregator: true,
	BlockManagerConfig: BlockManagerConfig{
		BlockTime:         200 * time.Millisecond,
		NamespaceID:       [8]byte{},
		BatchSyncInterval: time.Second * 30,
		BlockBatchSize:    500,
	},
	DALayer:         "mock",
	SettlementLayer: "mock",
	DAConfig:        "",
}

DefaultNodeConfig keeps default values of NodeConfig

Functions

func AddFlags

func AddFlags(cmd *cobra.Command)

AddFlags adds Dymint specific configuration options to cobra Command.

This function is called in cosmos-sdk.

Types

type BlockManagerConfig

type BlockManagerConfig struct {
	// BlockTime defines how often new blocks are produced
	BlockTime time.Duration `mapstructure:"block_time"`
	// DABlockTime informs about block time of underlying data availability layer
	DABlockTime time.Duration `mapstructure:"da_block_time"`
	// BatchSyncInterval defines how often block manager should sync with the settlement layer
	BatchSyncInterval time.Duration `mapstructure:"batch_sync_interval"`
	// DAStartHeight allows skipping first DAStartHeight-1 blocks when querying for blocks.
	DAStartHeight uint64  `mapstructure:"da_start_height"`
	NamespaceID   [8]byte `mapstructure:"namespace_id"`
	// The size of the batch in blocks. Every batch we'll write to the DA and the settlement layer.
	BlockBatchSize uint64 `mapstructure:"block_batch_size"`
}

BlockManagerConfig consists of all parameters required by BlockManagerConfig

type NodeConfig

type NodeConfig struct {
	// parameters below are translated from existing config
	RootDir string
	DBPath  string
	P2P     P2PConfig
	RPC     RPCConfig
	// parameters below are furyint specific and read from config
	Aggregator         bool `mapstructure:"aggregator"`
	BlockManagerConfig `mapstructure:",squash"`
	DALayer            string `mapstructure:"da_layer"`
	DAConfig           string `mapstructure:"da_config"`
	SettlementLayer    string `mapstructure:"settlement_layer"`
	SettlementConfig   string `mapstructure:"settlement_config"`
}

NodeConfig stores Dymint node configuration.

func (*NodeConfig) GetViperConfig

func (nc *NodeConfig) GetViperConfig(v *viper.Viper) error

GetViperConfig reads configuration parameters from Viper instance.

This method is called in cosmos-sdk.

type P2PConfig

type P2PConfig struct {
	ListenAddress string // Address to listen for incoming connections
	Seeds         string // Comma separated list of seed nodes to connect to
}

P2PConfig stores configuration related to peer-to-peer networking.

type RPCConfig

type RPCConfig struct {
	ListenAddress string

	// Cross Origin Resource Sharing settings
	CORSAllowedOrigins []string
	CORSAllowedMethods []string
	CORSAllowedHeaders []string

	// Maximum number of simultaneous connections (including WebSocket).
	// Does not include gRPC connections. See grpc-max-open-connections
	// If you want to accept a larger number than the default, make sure
	// you increase your OS limits.
	// 0 - unlimited.
	// Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files}
	// 1024 - 40 - 10 - 50 = 924 = ~900
	MaxOpenConnections int

	// The path to a file containing certificate that is used to create the HTTPS server.
	// Might be either absolute path or path related to Tendermint's config directory.
	//
	// If the certificate is signed by a certificate authority,
	// the certFile should be the concatenation of the server's certificate, any intermediates,
	// and the CA's certificate.
	//
	// NOTE: both tls-cert-file and tls-key-file must be present for Tendermint to create HTTPS server.
	// Otherwise, HTTP server is run.
	TLSCertFile string `mapstructure:"tls-cert-file"`

	// The path to a file containing matching private key that is used to create the HTTPS server.
	// Might be either absolute path or path related to tendermint's config directory.
	//
	// NOTE: both tls-cert-file and tls-key-file must be present for Tendermint to create HTTPS server.
	// Otherwise, HTTP server is run.
	TLSKeyFile string `mapstructure:"tls-key-file"`
}

RPCConfig holds RPC configuration params.

Jump to

Keyboard shortcuts

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