config

package
v0.0.0-...-fdc2919 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2020 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Service  `yaml:"server"`
	Monero   `yaml:"monero"`
	Ethereum `yaml:"ethereum"`
	Database `yaml:"database"`
	Logger   `yaml:"logger"`
}

Config object wrapper

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns an example default configuration suitable for use with the test environment

func (*Config) DB

func (c *Config) DB() (*db.Database, error)

DB returns a database client

func (*Config) EthAuth

func (c *Config) EthAuth() (*bind.TransactOpts, error)

EthAuth returns a transactopts suitable for signing transactions

func (*Config) EthRPC

func (c *Config) EthRPC() (*ethclient.Client, error)

EthRPC returns an ethereum RPC client

func (*Config) XmrRPC

func (c *Config) XmrRPC() (*rpc.Client, error)

XmrRPC returns a monero RPC client

func (*Config) ZapLogger

func (c *Config) ZapLogger() (*zap.Logger, error)

ZapLogger returns a zap logger

type Database

type Database struct {
	Path string `yaml:"path"`
}

Database configures a connection to our database only supports sqlite3 for now

type Ethereum

type Ethereum struct {
	RPCAddr string `yaml:"rpc_addr"`
	// as generated by geth account new
	KeyData                string `yaml:"key_data"`
	KeyPassword            string `yaml:"key_password"`
	ReserveContractAddress string `yaml:"reserve_contract_address"`
}

Ethereum configures our connection to the ethereum blockchain

type Logger

type Logger struct {
	DevMode   bool   `yaml:"dev_mode"`
	DebugMode bool   `yaml:"debug_mode"`
	FilePath  string `yaml:"file_path"`
}

Logger configures the zap logger

type Monero

type Monero struct {
	RPCAddr    string `yamnl:"rpc_addr"`
	WalletName string `yaml:"wallet_name"`
}

Monero configures our connection to the monero blockchain

type Service

type Service struct {
	ListenAddr string `yaml:"listen_addr"`
}

Service provides configuration over the api server

Jump to

Keyboard shortcuts

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