config

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Environment            = "environment"
	EnvironmentDevelopment = "development"
	EnvironmentProduction  = "production"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ActiveScores added in v0.6.20

type ActiveScores struct {
	GiniCoefficient float64 `yaml:"gini_coefficient" validate:"required"`
	StakerFactor    float64 `yaml:"staker_factor" validate:"required"`
	EpochLimit      int     `yaml:"epoch_limit" validate:"required"`
}

type Database

type Database struct {
	Driver database.Driver `mapstructure:"driver" validate:"required" default:"cockroachdb"`
	URI    string          `mapstructure:"uri" validate:"required" default:"postgres://root@localhost:26257/defaultdb"`
}

type Distributor added in v0.6.1

type Distributor struct {
	// The number of demotions that triggers a slashing.
	MaxDemotionCount int `yaml:"max_demotion_count" default:"4"`
	// The number of nodes required to meet the criteria during distribution.
	QualifiedNodeCount int `yaml:"qualified_node_count" default:"3"`
	// The number of verification activities selected during the second verification.
	VerificationCount int `yaml:"verification_count" default:"3"`
	ToleranceSeconds  int `yaml:"tolerance_seconds" default:"1200"`
}

type File

type File struct {
	Environment   string         `yaml:"environment" validate:"required" default:"development"`
	Database      *Database      `yaml:"database"`
	Redis         *Redis         `yaml:"redis"`
	RSS3Chain     *RSS3Chain     `yaml:"rss3_chain"`
	Settler       *Settler       `yaml:"settler"`
	Distributor   *Distributor   `yaml:"distributor"`
	Rewards       *Rewards       `yaml:"rewards"`
	ActiveScores  *ActiveScores  `yaml:"active_scores"`
	GeoIP         *GeoIP         `yaml:"geo_ip"`
	RPC           *RPC           `yaml:"rpc"`
	Telemetry     *Telemetry     `json:"telemetry"`
	TokenPriceAPI *TokenPriceAPI `yaml:"token_price_api"`
}

func Setup

func Setup(configFilePath string) (*File, error)

type GeoIP

type GeoIP struct {
	Account    int    `yaml:"account"`
	LicenseKey string `yaml:"license_key"`
	File       string `yaml:"file" validate:"required" default:"./common/geolite2/mmdb/GeoLite2-City.mmdb"`
}

type RPC

type RPC struct {
	RPCNetwork *RPCNetwork `yaml:"network"`
}

type RPCEndpoint

type RPCEndpoint struct {
	Endpoint string `yaml:"endpoint" validate:"required"`
	APIkey   string `yaml:"api_key"`
}

type RPCNetwork

type RPCNetwork struct {
	Ethereum  *RPCEndpoint `yaml:"ethereum"`
	Crossbell *RPCEndpoint `yaml:"crossbell"`
	Polygon   *RPCEndpoint `yaml:"polygon"`
	Farcaster *RPCEndpoint `yaml:"farcaster"`
}

type RSS3Chain

type RSS3Chain struct {
	EndpointL1     string `yaml:"endpoint_l1" validate:"required"`
	EndpointL2     string `yaml:"endpoint_l2" validate:"required"`
	BlockThreadsL1 uint64 `yaml:"block_threads_l1" default:"1"`
	BlockThreadsL2 uint64 `yaml:"block_threads_l2" default:"1"`
}

type Redis

type Redis struct {
	URI string `mapstructure:"uri" validate:"required" default:"redis://localhost:6379/0"`
}

type Rewards added in v0.6.18

type Rewards struct {
	OperationRewards float64 `yaml:"operation_rewards" validate:"required"`
}

type Settler

type Settler struct {
	PrivateKey     string `yaml:"private_key"`
	WalletAddress  string `yaml:"wallet_address"`
	SignerEndpoint string `yaml:"signer_endpoint"`
	// EpochIntervalInHours
	EpochIntervalInHours int    `yaml:"epoch_interval_in_hours" default:"18"`
	GasLimit             uint64 `yaml:"gas_limit" default:"2500000"`
	// BatchSize is the number of Nodes to process in each batch.
	// This is to prevent the contract call from running out of gas.
	BatchSize            int `yaml:"batch_size" default:"200"`
	ProductionStartEpoch int `yaml:"production_start_epoch" default:"227"`
	GracePeriodEpochs    int `yaml:"grace_period_epochs" default:"28"`
}

type Telemetry

type Telemetry struct {
	Endpoint string `yaml:"endpoint" validate:"required"`
	Insecure bool   `yaml:"insecure"`
}

type TokenPriceAPI added in v0.7.0

type TokenPriceAPI struct {
	Endpoint  string `yaml:"endpoint" validate:"required"`
	AuthToken string `yaml:"auth_token"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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