config

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultCacheTTL

func DefaultCacheTTL() time.Duration

DefaultCacheTTL Duration the default time an object is valid (this expects object to be requested with hash)

func MinCacheTTL

func MinCacheTTL() time.Duration

MinCacheTTL Duration the minimum time an object is valid

func TestCollatorAddress

func TestCollatorAddress() string

TestCollatorAddress returns string address of collator used for testing (Foundation 04)

Types

type ChainConfig

type ChainConfig struct {
	Endpoints []string
	// Snap point
	Snap SnapConfig
	// Timeouts
	DialTimeout      time.Duration
	SubscribeTimeout time.Duration
	// Json folders
	NetworkSpecs        string
	NetworkSpecsVersion uint32
}

func GetChainConfig

func GetChainConfig(
	endpoint string,
	block int64,
	round uint32,
) ChainConfig

GetChainConfig ChainConfig returns the default config for a given network or the default network

func GetDefaultChainConfig

func GetDefaultChainConfig() ChainConfig

GetDefaultChainConfig ChainConfig default values, main network

func (*ChainConfig) ReadSpecs

func (cg *ChainConfig) ReadSpecs() ([]byte, error)

ReadSpecs will read network specification from the embedded file

func (*ChainConfig) RpcUrl

func (cg *ChainConfig) RpcUrl() string

RpcUrl will return a random RPC address to connect to

type CollatorsPoolConfig

type CollatorsPoolConfig struct {
	Address       string
	HistoryRounds uint32
	Revokes       bool
}

func DefaultCollatorsPoolConfig

func DefaultCollatorsPoolConfig() CollatorsPoolConfig

type HttpConfig

type HttpConfig struct {
	Addr           string
	UpdateInterval time.Duration
	ChainConfig    ChainConfig
	DataPath       string
}

func GetDefaultHttpConfig

func GetDefaultHttpConfig() HttpConfig

type SnapConfig

type SnapConfig struct {
	TargetBlock int64
	TargetRound uint32
}

type TableOptions

type TableOptions struct {
	Compact      bool
	SortKey      string
	SortDesc     bool
	RevokeRounds uint32
}

func GetDefaultTableOptions

func GetDefaultTableOptions() TableOptions

func (*TableOptions) GetSortKey

func (to *TableOptions) GetSortKey() string

func (*TableOptions) GetSortMode

func (to *TableOptions) GetSortMode() table.SortMode

func (*TableOptions) GetTableWidth

func (to *TableOptions) GetTableWidth() int

Jump to

Keyboard shortcuts

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