parser

package
v1.2.2-alpha-1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bridge

type Bridge struct {
	UseLocalConfig    bool                `yaml:"use_local_config,omitempty" json:"useLocalConfig,omitempty"`
	ConfigTopicId     string              `yaml:"config_topic_id,omitempty" json:"configTopicId,omitempty"`
	PollingInterval   time.Duration       `yaml:"polling_interval,omitempty" json:"pollingInterval,omitempty"`
	TopicId           string              `yaml:"topic_id,omitempty" json:"topicId,omitempty"`
	Networks          map[uint64]*Network `yaml:"networks,omitempty" json:"networks,omitempty"`
	MonitoredAccounts map[string]string   `yaml:"monitored_accounts,omitempty" json:"monitoredAccounts,omitempty"`
}

Structs used to parse the bridge YAML configuration

func (*Bridge) Update

func (b *Bridge) Update(from *Bridge)

type Clients

type Clients struct {
	Evm           map[uint64]Evm `yaml:"evm"`
	Hedera        Hedera         `yaml:"hedera"`
	MirrorNode    MirrorNode     `yaml:"mirror_node"`
	CoinGecko     CoinGecko      `yaml:"coingecko"`
	CoinMarketCap CoinMarketCap  `yaml:"coin_market_cap"`
}

type CoinGecko

type CoinGecko struct {
	ApiAddress string `yaml:"api_address" json:"apiAddress,omitempty"`
}

type CoinMarketCap

type CoinMarketCap struct {
	ApiKey     string `yaml:"api_key" json:"apiKey,omitempty"`
	ApiAddress string `yaml:"api_address" json:"apiAddress,omitempty"`
}

type Config

type Config struct {
	Node   Node   `yaml:"node"`
	Bridge Bridge `yaml:"bridge"`
}

type Database

type Database struct {
	Host     string `yaml:"host" env:"VALIDATOR_DATABASE_HOST"`
	Name     string `yaml:"name"`
	Password string `yaml:"password"`
	Port     string `yaml:"port"`
	Username string `yaml:"username"`
}

type Evm

type Evm struct {
	BlockConfirmations uint64        `yaml:"block_confirmations"`
	NodeUrl            string        `yaml:"node_url"`
	PrivateKey         string        `yaml:"private_key"`
	StartBlock         int64         `yaml:"start_block"`
	PollingInterval    time.Duration `yaml:"polling_interval"`
	MaxLogsBlocks      int64         `yaml:"max_logs_blocks"`
}

type Hedera

type Hedera struct {
	Operator       Operator          `yaml:"operator"`
	Network        string            `yaml:"network"`
	Rpc            map[string]string `yaml:"rpc"`
	StartTimestamp int64             `yaml:"start_timestamp"`
	MaxRetry       int               `yaml:"max_retry" default:"20"`
}

type MirrorNode

type MirrorNode struct {
	ClientAddress     string        `yaml:"client_address"`
	ApiAddress        string        `yaml:"api_address"`
	PollingInterval   time.Duration `yaml:"polling_interval"`
	QueryMaxLimit     int64         `yaml:"query_max_limit"`
	QueryDefaultLimit int64         `yaml:"query_default_limit"`
	RetryPolicy       RetryPolicy   `yaml:"retry_policy"`
	RequestTimeout    int           `yaml:"request_timeout" default:"15"`
}

type Monitoring

type Monitoring struct {
	Enable           bool          `yaml:"enable"`
	DashboardPolling time.Duration `yaml:"dashboard_polling"`
}

type Network

type Network struct {
	Name                  string   `yaml:"name,omitempty" json:"name,omitempty"`
	BridgeAccount         string   `yaml:"bridge_account,omitempty" json:"bridgeAccount,omitempty"`
	PayerAccount          string   `yaml:"payer_account,omitempty" json:"payerAccount,omitempty"`
	RouterContractAddress string   `yaml:"router_contract_address,omitempty" json:"routerContractAddress,omitempty"`
	Members               []string `yaml:"members,omitempty" json:"members,omitempty"`
	Tokens                Tokens   `yaml:"tokens,omitempty" json:"tokens,omitempty"`
}

type Node

type Node struct {
	Database            Database   `yaml:"database"`
	Clients             Clients    `yaml:"clients"`
	LogLevel            string     `yaml:"log_level"`
	LogFormat           string     `yaml:"log_format"`
	Port                string     `yaml:"port"`
	Validator           bool       `yaml:"validator"`
	Monitoring          Monitoring `yaml:"monitoring"`
	BridgeConfigTopicId Monitoring `yaml:"bridge_config_topic_id"`
}

Structs used to parse the node YAML configuration

type Operator

type Operator struct {
	AccountId  string `yaml:"account_id"`
	PrivateKey string `yaml:"private_key"`
}

type RetryPolicy

type RetryPolicy struct {
	MaxRetry  int `yaml:"max_retry"`
	MinWait   int `yaml:"min_wait"`
	MaxWait   int `yaml:"max_wait"`
	MaxJitter int `yaml:"max_jitter"`
}

type Token

type Token struct {
	Fee               int64             `yaml:"fee,omitempty" json:"fee,omitempty"`                                 // Represent a constant fee for Non-Fungible tokens. Applies only for Hedera Native Tokens
	FeeAmountInUsd    string            `yaml:"fee_amount_in_usd,omitempty" json:"feeAmountInUsd,omitempty"`        // Represent a dynamic fee amount in $USD for Non-Fungible tokens. Applies only for Hedera Native Tokens
	FeePercentage     int64             `yaml:"fee_percentage,omitempty" json:"feePercentage,omitempty"`            // Represents a constant fee for Fungible Tokens. Applies only for Hedera Native Tokens
	MinFeeAmountInUsd string            `yaml:"min_fee_amount_in_usd,omitempty" json:"minFeeAmountInUsd,omitempty"` // Represents a constant minimum fee amount in USD which is needed for the validator not to be on a loss
	MinAmount         *big.Int          `yaml:"min_amount,omitempty" json:"minAmount,omitempty"`                    // Represents a constant for minimum amount which is used when there is no 'coin_gecko_id' or 'coin_market_cap_id' supplied in the config.
	Networks          map[uint64]string `yaml:"networks,omitempty" json:"networks,omitempty"`
	CoinGeckoId       string            `yaml:"coin_gecko_id,omitempty" json:"coinGeckoId,omitempty"`
	CoinMarketCapId   string            `yaml:"coin_market_cap_id,omitempty" json:"coinMarketCapId,omitempty"`
	ReleaseTimestamp  uint64            `yaml:"release_timestamp,omitempty" json:"releaseTimestamp,omitempty"`
}

type Tokens

type Tokens struct {
	Fungible map[string]Token `yaml:"fungible,omitempty" json:"fungible,omitempty"`
	Nft      map[string]Token `yaml:"nft,omitempty" json:"nft,omitempty"`
}

Jump to

Keyboard shortcuts

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