deploy

package
v0.0.0-...-0908cd3 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BmErc721Bin string = `` /* 18298-byte string literal not displayed */
	BmErc721ABI string = `` /* 9666-byte string literal not displayed */
)

Variables

View Source
var Command = &cli.Command{
	Name: "deploy",
	Flags: []cli.Flag{
		flags.ConfigFlag,
		flags.ChainFlag,
		flags.KeyStoreDirFlag,
		flags.AccountFlag,
		flags.PasswordFileFlag,
	},
	Action: func(ctx *cli.Context) error {
		cfg, err := GetConfig(ctx)
		if err != nil {
			return err
		}

		client, err := ethclient.DialContext(ctx.Context, cfg.Chain.URI)
		if err != nil {
			return err
		}

		owner, lock, err := cfg.GetAccount(ctx.Context, client)
		if err != nil {
			return err
		}
		defer lock()

		return Deploy(ctx.Context, client, owner)
	},
}

Functions

func Deploy

func Deploy(ctx context.Context, client bmsutils.Backend, owner *bind.TransactOpts) error

Types

type Config

type Config struct {
	Chain struct {
		URI string `toml:"uri"`
	} `toml:"chain"`
	Account struct {
		Keystore string         `toml:"keystore"`
		Address  common.Address `toml:"address"`
		Password string         `toml:"password"`
	} `toml:"account"`
}

func GetConfig

func GetConfig(ctx *cli.Context) (*Config, error)

func (*Config) GetAccount

func (cfg *Config) GetAccount(c context.Context, client *ethclient.Client) (*bind.TransactOpts, func() error, error)

Jump to

Keyboard shortcuts

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