config

package
v0.0.1-alpha-5 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2021 License: Apache-2.0 Imports: 7 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(debugMode *bool) *log.Level

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"`
	ServiceFeePercent uint64   `yaml:"service_fee_percent"`
	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 {
	Topics []ID `yaml:"topics" env:"HEDERA_ETH_BRIDGE_WATCHER_CONSENSUS_MESSAGE"`
}

type ConsensusMessageHandler

type ConsensusMessageHandler struct {
	TopicId      string   `yaml:"topic_id"`
	Addresses    []string `yaml:"addresses"`
	SendDeadline int64    `yaml:"send_deadline"`
}

type CryptoTransfer

type CryptoTransfer struct {
	Accounts []ID `yaml:"accounts" 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"`
	BridgeContractAddress string `yaml:"bridge_contract_address" env:"HEDERA_ETH_BRIDGE_ETH_BRIDGE_CONTRACT_ADDRESS"`
	WhbarContractAddress  string `yaml:"whbar_contract_address" env:"HEDERA_ETH_BRIDGE_ETH_WHBAR_CONTRACT_ADDRESS"`
	CustodialAccount      string `yaml:"custodial_account" env:"HEDERA_ETH_BRIDGE_ETH_CUSTODIAL_ACCOUNT"`
}

type Handler

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

type Hedera

type Hedera struct {
	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"`
}

type ID

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

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 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