config

package
v0.4.16 Latest Latest
Warning

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

Go to latest
Published: May 11, 2024 License: MIT Imports: 6 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 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 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"`
	SpecialRewards *SpecialRewards `yaml:"special_rewards"`
	GeoIP          *GeoIP          `yaml:"geo_ip"`
	RPC            *RPC            `yaml:"rpc"`
	Telemetry      *Telemetry      `json:"telemetry"`
}

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 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"`
}

type SpecialRewards

type SpecialRewards struct {
	GiniCoefficient       float64 `yaml:"gini_coefficient" validate:"required"`
	StakerFactor          float64 `yaml:"staker_factor" validate:"required"`
	NodeThreshold         float64 `yaml:"node_threshold" validate:"required"`
	EpochLimit            int     `yaml:"epoch_limit" validate:"required"`
	Rewards               float64 `yaml:"rewards" validate:"required"`
	RewardsCeiling        float64 `yaml:"rewards_ceiling" validate:"required"`
	RewardsRatioActive    float64 `yaml:"rewards_ratio_active" validate:"required"`
	RewardsRatioOperation float64 `yaml:"rewards_ratio_operation" validate:"required"`
}

type Telemetry

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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