nodewallets

package
v0.0.0-...-f6bc33c Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2023 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEthereumWalletAlreadyExists   = errors.New("the Ethereum node wallet already exists")
	ErrZetaWalletAlreadyExists       = errors.New("the Zeta node wallet already exists")
	ErrTendermintPubkeyAlreadyExists = errors.New("the Tendermint pubkey already exists")
)
View Source
var (
	ErrZetaWalletIsMissing       = errors.New("the Zeta node wallet is missing")
	ErrEthereumWalletIsMissing   = errors.New("the Ethereum node wallet is missing")
	ErrTendermintPubkeyIsMissing = errors.New("the Tendermint pubkey is missing")
)

Functions

func GenerateEthereumWallet

func GenerateEthereumWallet(
	zetaPaths paths.Paths,
	registryPassphrase,
	walletPassphrase string,
	clefAddress string,
	overwrite bool,
) (map[string]string, error)

func GenerateZetaWallet

func GenerateZetaWallet(zetaPaths paths.Paths, registryPassphrase, walletPassphrase string, overwrite bool) (map[string]string, error)

func GetEthereumWallet

func GetEthereumWallet(zetaPaths paths.Paths, registryPassphrase string) (*eth.Wallet, error)

func GetEthereumWalletWithRegistry

func GetEthereumWalletWithRegistry(zetaPaths paths.Paths, reg *registry.Registry) (*eth.Wallet, error)

func GetZetaWallet

func GetZetaWallet(zetaPaths paths.Paths, registryPassphrase string) (*zeta.Wallet, error)

func ImportEthereumWallet

func ImportEthereumWallet(
	zetaPaths paths.Paths,
	registryPassphrase,
	walletPassphrase,
	clefAccount,
	clefAddress,
	sourceFilePath string,
	overwrite bool,
) (map[string]string, error)

func ImportTendermintPubkey

func ImportTendermintPubkey(
	zetaPaths paths.Paths,
	registryPassphrase, pubkey string,
	overwrite bool,
) (map[string]string, error)

func ImportZetaWallet

func ImportZetaWallet(zetaPaths paths.Paths, registryPassphrase, walletPassphrase, sourceFilePath string, overwrite bool) (map[string]string, error)

Types

type BlockchainStats

type BlockchainStats interface {
	Height() uint64
}

type Chain

type Chain interface {
	SubmitTransactionSync(ctx context.Context, tx *commandspb.Transaction) (*tmctypes.ResultBroadcastTx, error)
	SubmitTransactionAsync(ctx context.Context, tx *commandspb.Transaction) (*tmctypes.ResultBroadcastTx, error)
	GetChainID(ctx context.Context) (string, error)
}

type Commander

type Commander struct {
	// contains filtered or unexported fields
}

func NewCommander

func NewCommander(cfg Config, log *logging.Logger, bc Chain, w *zeta.Wallet, bstats BlockchainStats) (*Commander, error)

NewCommander - used to sign and send transaction from core e.g. NodeRegistration, NodeVote chain argument can't be passed in cmd package, but is used for tests.

func (*Commander) Command

func (c *Commander) Command(ctx context.Context, cmd txn.Command, payload proto.Message, done func(string, error), bo *backoff.ExponentialBackOff)

Command - send command to chain. Note: beware when passing in an exponential back off since the done function may be called many times.

func (*Commander) CommandSync

func (c *Commander) CommandSync(ctx context.Context, cmd txn.Command, payload proto.Message, done func(string, error), bo *backoff.ExponentialBackOff)

func (*Commander) CommandWithPoW

func (c *Commander) CommandWithPoW(ctx context.Context, cmd txn.Command, payload proto.Message, done func(string, error), bo *backoff.ExponentialBackOff, pow *commandspb.ProofOfWork)

type Config

type Config struct {
	Level encoding.LogLevel `long:"log-level"`
}

func NewDefaultConfig

func NewDefaultConfig() Config

NewDefaultConfig creates an instance of the package specific configuration, given a pointer to a logger instance to be used for logging within the package.

type NodeWallets

type NodeWallets struct {
	Zeta       *zeta.Wallet
	Ethereum   *eth.Wallet
	Tendermint *TendermintPubkey
}

func GetNodeWallets

func GetNodeWallets(config Config, zetaPaths paths.Paths, registryPassphrase string) (*NodeWallets, error)

func (*NodeWallets) SetEthereumWallet

func (w *NodeWallets) SetEthereumWallet(ethWallet *eth.Wallet)

func (*NodeWallets) Verify

func (w *NodeWallets) Verify() error

type TendermintPubkey

type TendermintPubkey struct {
	Pubkey string
}

Directories

Path Synopsis
eth
clef/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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