config

package
v0.0.0-...-00b5140 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Enabled bool   `config:"api_enabled"`
	Port    int    `config:"api_port"`
	Host    string `config:"api_host" yaml:"api_host"`
}

type Config

type Config struct {
	Name    string
	Version string
	Address string
	Threads int `json:"threads"`
	//reward is the amnount of tokens given to someone that "mines" a new block
	Gas          Gas
	Wallet       wallet.Config
	Metrics      Metrics
	Transactions Transactions
	Database     persistencefactory.Config
	API          API
	Log          Log
	P2P          p2pfactory.Config
	XCache       p2padapter.XCache
	GRPC         GRPC
	Trace        trace.Config
}

func New

func New() (*Config, error)

New Load the config

func (*Config) DeepStructFields

func (c *Config) DeepStructFields(s *string, parentKey string, iface interface{})

func (*Config) String

func (c *Config) String() string

type GRPC

type GRPC struct {
	Enabled bool   `config:"grpc_enabled"`
	Port    int    `config:"grpc_port" yaml:"grpc_port"`
	Host    string `config:"grpc_host" yaml:"grpc_host"`
}

type Gas

type Gas struct {
	// Minimum amount of Wei per GAS to be paid for a transaction to be accepted for mining. Note: gasprice is listed in wei. Note 2: --gasprice is a “Legacy Option”
	Price int `config:"gas-price"`
	// Les mineurs sur le réseau décident de la limite de gaz du bloc.
	// Il faut réintroduire une fonction de limite de gaz adaptative
	Limit int `config:"gas-limit"`
	// il existe une stratégie d'exploitation minière par défaut
	// d'une limite de gaz de bloc minimale de 4 712 388 pour la plupart des clients
	TargetMinLimit int `config:"targetgasMinlimit"`
	TargetMaxLimit int `config:"targetgaslimit"`
	// Amount of gas per block to target when sealing a new block
	FloorTarget int `config:"gas-floor-target"`
	// A cap on how large we will raise the gas limit per block due to transaction volume
	Cap int `config:"gas-cap"`
}

type Log

type Log struct {
	Path     string `config:"log_path"`
	WithFile bool   `config:"log_with_file"`
	CLILevel string `config:"log_cli_level" yaml:"log_cli_level"`
}

type Metrics

type Metrics struct {
	Namespace string
	Name      string
	Port      int
}

type Miner

type Miner struct {
	PubKey     string `config:"miner_pub_key"`
	PrivateKey string `config:"miner_private_key"`
	Address    string `config:"miner_address"`
}

type Transactions

type Transactions struct {
	Reward *big.Int
	Miner
}

Jump to

Keyboard shortcuts

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