Back to

Package app

Latest Go to latest

The latest major version is .

Published: Dec 17, 2018 | License: MIT | Module:



const Flag = "deployment"

Flag is the cli flag of deployment.

const (

	//InfuraEndpoint is url for infura node
	InfuraEndpoint = ""

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.

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

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier