morphconfig

package
v0.38.9 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// DialTimeoutDefault is a default dial timeout of morph chain client connection.
	DialTimeoutDefault = 5 * time.Second

	// PriorityDefault is a default endpoint priority for the morph client.
	PriorityDefault = 1

	// CacheTTLDefault is a default value for cached values TTL.
	// It is 0, because actual default depends on block time.
	CacheTTLDefault = time.Duration(0)

	// SwitchIntervalDefault is a default Neo RPCs switch interval.
	SwitchIntervalDefault = 2 * time.Minute

	// APEChainCacheSizeDefault is a default value of APE chain cache.
	APEChainCacheSizeDefault = 10_000
)

Variables

This section is empty.

Functions

func APEChainCacheSize added in v0.38.1

func APEChainCacheSize(c *config.Config) uint32

APEChainCacheSize returns the value of "ape_chain_cache_size" config parameter from "morph" section.

Returns 0 if the value is not positive integer. Returns APEChainCacheSizeDefault if the value is missing.

func CacheTTL

func CacheTTL(c *config.Config) time.Duration

CacheTTL returns the value of "cache_ttl" config parameter from "morph" section.

Returns CacheTTLDefault if value is zero or invalid. Supports negative durations.

func DialTimeout

func DialTimeout(c *config.Config) time.Duration

DialTimeout returns the value of "dial_timeout" config parameter from "morph" section.

Returns DialTimeoutDefault if the value is not positive duration.

func RPCEndpoint

func RPCEndpoint(c *config.Config) []client.Endpoint

RPCEndpoint returns list of the values of "rpc_endpoint" config parameter from "morph" section.

Throws panic if list is empty.

func SwitchInterval

func SwitchInterval(c *config.Config) time.Duration

SwitchInterval returns the value of "switch_interval" config parameter from "morph" section.

Returns SwitchIntervalDefault if value is not positive duration.

Types

This section is empty.

Jump to

Keyboard shortcuts

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