config

package
v0.0.1-alpha-8 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfig

func GetConfig(config *Config, path string) error

func GetLoggerFor

func GetLoggerFor(ctx string) *log.Entry

GetLoggerFor returns a logger defined with a context

func InitLogger

func InitLogger(level string)

InitLogger sets the initial configuration of the used logger

Types

type Client

type Client struct {
	NetworkType     string   `yaml:"network_type" env:"HEDERA_ETH_BRIDGE_CLIENT_NETWORK_TYPE"`
	Operator        Operator `yaml:"operator"`
	BaseGasUsage    uint64   `yaml:"base_gas_usage"`
	GasPerValidator uint64   `yaml:"gas_per_validator"`
}

type Config

type Config struct {
	Hedera Hedera `yaml:"hedera"`
}

func LoadConfig

func LoadConfig() Config

type ConsensusMessage

type ConsensusMessage struct {
	Topic ID `yaml:"topic" env:"HEDERA_ETH_BRIDGE_WATCHER_CONSENSUS_MESSAGE"`
}

type ConsensusMessageHandler

type ConsensusMessageHandler struct {
	TopicId      string `yaml:"topic_id"`
	SendDeadline int64  `yaml:"send_deadline"`
}

type CryptoTransfer

type CryptoTransfer struct {
	Account ID `yaml:"account" env:"HEDERA_ETH_BRIDGE_WATCHER_CRYPTO_TRANSFER"`
}

type CryptoTransferHandler

type CryptoTransferHandler struct {
	TopicId         string        `yaml:"topic_id"`
	PollingInterval time.Duration `yaml:"polling_interval"`
}

type Db

type Db struct {
	Host     string `yaml:"host" env:"HEDERA_ETH_BRIDGE_VALIDATOR_DB_HOST"`
	Name     string `yaml:"name" env:"HEDERA_ETH_BRIDGE_VALIDATOR_DB_NAME"`
	Password string `yaml:"password" env:"HEDERA_ETH_BRIDGE_VALIDATOR_DB_PASSWORD"`
	Port     string `yaml:"port" env:"HEDERA_ETH_BRIDGE_VALIDATOR_DB_PORT"`
	Username string `yaml:"username" env:"HEDERA_ETH_BRIDGE_VALIDATOR_DB_USERNAME"`
}

type Ethereum

type Ethereum struct {
	NodeUrl               string `yaml:"node_url" env:"HEDERA_ETH_BRIDGE_ETH_NODE_URL"`
	RouterContractAddress string `yaml:"router_contract_address" env:"HEDERA_ETH_BRIDGE_ETH_ROUTER_CONTRACT_ADDRESS"`
	BlockConfirmations    uint64 `yaml:"block_confirmations" env:"HEDERA_ETH_BLOCK_CONFIRMATIONS"`
}

type Handler

type Handler struct {
	CryptoTransfer   CryptoTransferHandler   `yaml:"crypto-transfer"`
	ConsensusMessage ConsensusMessageHandler `yaml:"consensus-message"`
}

type Hedera

type Hedera struct {
	LogLevel    string     `yaml:"log_level"`
	Validator   Validator  `yaml:"validator"`
	Eth         Ethereum   `yaml:"eth"`
	MirrorNode  MirrorNode `yaml:"mirror_node"`
	Client      Client     `yaml:"client"`
	Watcher     Watcher    `yaml:"watcher"`
	Handler     Handler    `yaml:"handler"`
	Recovery    Recovery   `yaml:"recovery"`
	RestApiOnly bool       `yaml:"rest_api_only"`
}

type ID

type ID struct {
	Id         string `yaml:"id"`
	MaxRetries int    `yaml:"max_retries"`
}

type MirrorNode

type MirrorNode struct {
	ClientAddress   string        `yaml:"client_address" env:"HEDERA_ETH_BRIDGE_MIRROR_NODE_CLIENT_ADDRESS"`
	ApiAddress      string        `yaml:"api_address" env:"HEDERA_ETH_BRIDGE_MIRROR_NODE_API_ADDRESS"`
	PollingInterval time.Duration `yaml:"polling_interval" env:"HEDERA_ETH_BRIDGE_MIRROR_NODE_POLLING_INTERVAL"`
}

type Operator

type Operator struct {
	AccountId     string `yaml:"account_id" env:"HEDERA_ETH_BRIDGE_CLIENT_OPERATOR_ACCOUNT_ID"`
	EthPrivateKey string `yaml:"eth_private_key" env:"HEDERA_ETH_BRIDGE_CLIENT_OPERATOR_ETH_PRIVATE_KEY"`
	PrivateKey    string `yaml:"private_key" env:"HEDERA_ETH_BRIDGE_CLIENT_OPERATOR_PRIVATE_KEY"`
}

type Recovery

type Recovery struct {
	Timestamp int64 `yaml:"timestamp" env:"HEDERA_ETH_BRIDGE_VALIDATOR_RECOVERY_TIMESTAMP"`
}

type Validator

type Validator struct {
	Db   Db     `yaml:"db"`
	Port string `yaml:"port" env:"HEDERA_ETH_BRIDGE_VALIDATOR_PORT"`
}

type Watcher

type Watcher struct {
	CryptoTransfer   CryptoTransfer   `yaml:"crypto-transfer"`
	ConsensusMessage ConsensusMessage `yaml:"consensus-message"`
}

Jump to

Keyboard shortcuts

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