config

package
v0.5.1-rc3 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultLogLevels = "error;accumulate=info" // main=info;state=info;statesync=info;accumulate=debug;executor=info;disk-monitor=info;init=info

Variables

This section is empty.

Functions

func MakeAbsolute added in v0.5.1

func MakeAbsolute(root, path string) string

func OffsetPort

func OffsetPort(addr string, offset int) (*url.URL, error)

func Store

func Store(config *Config) error

Types

type API

type API struct {
	TxMaxWaitTime      time.Duration `toml:"tx-max-wait-time" mapstructure:"tx-max-wait-time"`
	PrometheusServer   string        `toml:"prometheus-server" mapstructure:"prometheus-server"`
	ListenAddress      string        `toml:"listen-address" mapstructure:"listen-address"`
	DebugJSONRPC       bool          `toml:"debug-jsonrpc" mapstructure:"debug-jsonrpc"`
	EnableDebugMethods bool          `toml:"enable-debug-methods" mapstructure:"enable-debug-methods"`
}

type Accumulate

type Accumulate struct {
	SentryDSN string `toml:"sentry-dsn" mapstructure:"sentry-dsn"`

	Network Network `toml:"network" mapstructure:"network"`
	Storage Storage `toml:"storage" mapstructure:"storage"`
	API     API     `toml:"api" mapstructure:"api"`
	Website Website `toml:"website" mapstructure:"website"`
}

type Config

type Config struct {
	tm.Config
	Accumulate Accumulate
}

func Default

func Default(net NetworkType, node NodeType, netId string) *Config

func Load

func Load(dir string) (*Config, error)

type Network

type Network struct {
	Type          NetworkType `toml:"type" mapstructure:"type"`
	LocalSubnetID string      `toml:"local-subnet" mapstructure:"local-subnet"`
	LocalAddress  string      `toml:"local-address" mapstructure:"local-address"`
	Subnets       []Subnet    `toml:"subnets" mapstructure:"subnets"`
}

func (*Network) GetBvnNames

func (n *Network) GetBvnNames() []string

func (*Network) GetSubnetByID

func (n *Network) GetSubnetByID(subnetID string) Subnet

func (*Network) NodeUrl

func (n *Network) NodeUrl(path ...string) *accurl.URL

type NetworkType

type NetworkType string
const (
	BlockValidator NetworkType = "block-validator"
	Directory      NetworkType = "directory"
)

type Node

type Node struct {
	Address string
	Type    NodeType `toml:"type" mapstructure:"type"`
}

type NodeType

type NodeType string
const (
	Validator NodeType = "validator"
	Follower  NodeType = "follower"
)

type Storage added in v0.5.1

type Storage struct {
	Type StorageType  `toml:"type" mapstructure:"type"`
	Path string       `toml:"path" mapstructure:"path"`
	Etcd *etcd.Config `toml:"etcd" mapstructure:"etcd"`
}

type StorageType added in v0.5.1

type StorageType string
const (
	MemoryStorage StorageType = "memory"
	BadgerStorage StorageType = "badger"
	EtcdStorage   StorageType = "etcd"
)

type Subnet

type Subnet struct {
	ID    string      `toml:"id" mapstructure:"id"`
	Type  NetworkType `toml:"type" mapstructure:"type"`
	Nodes []Node      `toml:"nodes" mapstructure:"nodes"`
}

type Website

type Website struct {
	Enabled       bool   `toml:"website-enabled" mapstructure:"website-enabled"`
	ListenAddress string `toml:"website-listen-address" mapstructure:"website-listen-address"`
}

Jump to

Keyboard shortcuts

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