config

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BridgeCommon            = "BridgeCommon"
	BridgeSwap              = "BridgeSwap"
	ChainIdentity           = "ChainIdentity"
	FungibleTransferEventId = "FungibleTransfer"
	AcknowledgeProposal     = "BridgeCommon.acknowledge_proposal"
)
View Source
const DefaultKeystorePath = "./keys"

Variables

View Source
var (
	ConfigFileFlag = &cli.StringFlag{
		Name:  "config",
		Usage: "TOML configuration file",
	}

	VerbosityFlag = &cli.StringFlag{
		Name:  "verbosity",
		Usage: "Supports levels crit (silent) to trce (trace)",
		Value: log.LvlInfo.String(),
	}

	KeystorePathFlag = &cli.StringFlag{
		Name:  "keystore",
		Usage: "Path to keystore directory",
		Value: "",
	}

	BlockstorePathFlag = &cli.StringFlag{
		Name:  "blockstore",
		Usage: "Specify path for blockstore",
		Value: "",
	}

	FreshStartFlag = &cli.BoolFlag{
		Name:  "fresh",
		Usage: "Disables loading from blockstore at start. Opts will still be used if specified.",
	}

	LatestBlockFlag = &cli.BoolFlag{
		Name:  "latest",
		Usage: "Overrides blockstore and start block, starts from latest block",
	}
)
View Source
var (
	MetricsFlag = &cli.BoolFlag{
		Name:  "metrics",
		Usage: "Enables metric server",
	}

	MetricsPort = &cli.IntFlag{
		Name:  "metricsPort",
		Usage: "Port to serve metrics on",
		Value: 8001,
	}
)

Metrics flags

Functions

This section is empty.

Types

type Config

type Config struct {
	Chains         []RawChainConfig `json:"chains"`
	KeystorePath   string           `json:"keystorePath,omitempty"`
	BlockStorePath string           `json:"blockstorePath,omitempty"`
}

func GetConfig

func GetConfig(ctx *cli.Context) (*Config, error)

func NewConfig

func NewConfig() *Config

func (*Config) ToJSON

func (c *Config) ToJSON(file string) *os.File

type RawChainConfig

type RawChainConfig struct {
	Name         string            `json:"name"`
	Type         string            `json:"type"`
	Id           string            `json:"id"`           // ChainID
	Endpoint     string            `json:"endpoint"`     // url for rpc endpoint
	EndpointList []string          `json:"endpointList"` // urlList for rpc endpoint
	From         string            `json:"from"`         // address of key to use
	Symbols      []interface{}     `json:"symbols"`
	Opts         map[string]string `json:"opts"`
}

RawChainConfig is parsed directly from the config file and should be using to construct the core.ChainConfig

Jump to

Keyboard shortcuts

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