app

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const Flag = "deployment"

Flag is the cli flag of deployment.

View Source
const (

	//InfuraEndpoint is url for infura node
	InfuraEndpoint = "https://mainnet.infura.io"
)

Variables

This section is empty.

Functions

func NewApp

func NewApp() *cli.App

NewApp creates a new cli App instance with common flags pre-loaded.

func NewDBFromContext

func NewDBFromContext(c *cli.Context) (*sqlx.DB, error)

NewDBFromContext creates a DB instance from cli flags configuration.

func NewEthereumClientFromFlag

func NewEthereumClientFromFlag(c *cli.Context) (*ethclient.Client, error)

NewEthereumClientFromFlag returns Ethereum client from flag variable, or error if occurs

func NewEthereumNodeFlags

func NewEthereumNodeFlags() cli.Flag

NewEthereumNodeFlags returns cli flag for ethereum node url input

func NewLogger

func NewLogger(c *cli.Context) (*zap.Logger, error)

NewLogger creates a new logger instance. The type of logger instance will be different with different application running modes.

func NewPostgreSQLFlags

func NewPostgreSQLFlags(defaultDB string) []cli.Flag

NewPostgreSQLFlags creates new cli flags for PostgreSQL client.

func ParseBigIntFlag

func ParseBigIntFlag(c *cli.Context, flag string) (*big.Int, error)

ParseBigIntFlag get big.Int value from a flag

func Validate

func Validate(c *cli.Context) error

Validate validates common application configuration flags.

Types

type Address

type Address map[deployment.Deployment][]common.Address

Address is a wrapper of ethereum common Address that supports multiple deployments.

func NewAddress

func NewAddress(prodAddr, stagingAddr []common.Address) Address

NewAddress returns an Address instance. Address of all deployments should be present.

func NewCrossDeploymentAddress

func NewCrossDeploymentAddress(addr []common.Address) Address

NewCrossDeploymentAddress returns an Address with given same address for all deployments.

func (Address) MustGetFromContext

func (a Address) MustGetFromContext(c *cli.Context) []common.Address

MustGetFromContext returns the common address for given deployment from context.

func (Address) MustGetOneFromContext

func (a Address) MustGetOneFromContext(c *cli.Context) common.Address

MustGetOneFromContext returns one common address for given deployment from context

Jump to

Keyboard shortcuts

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