nodewallets

package
v0.71.3 Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 License: MIT Imports: 22 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEthereumWalletAlreadyExists   = errors.New("the Ethereum node wallet already exists")
	ErrVegaWalletAlreadyExists       = errors.New("the Vega node wallet already exists")
	ErrTendermintPubkeyAlreadyExists = errors.New("the Tendermint pubkey already exists")
)
View Source
var (
	ErrVegaWalletIsMissing       = errors.New("the Vega 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(
	vegaPaths paths.Paths,
	registryPassphrase,
	walletPassphrase string,
	clefAddress string,
	overwrite bool,
) (map[string]string, error)

func GenerateVegaWallet

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

func GetEthereumWallet

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

func GetEthereumWalletWithRegistry added in v0.56.0

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

func GetVegaWallet

func GetVegaWallet(vegaPaths paths.Paths, registryPassphrase string) (*vega.Wallet, error)

func ImportEthereumWallet

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

func ImportTendermintPubkey

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

func ImportVegaWallet

func ImportVegaWallet(vegaPaths 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 *vega.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 {
	Vega       *vega.Wallet
	Ethereum   *eth.Wallet
	Tendermint *TendermintPubkey
}

func GetNodeWallets

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

func (*NodeWallets) SetEthereumWallet added in v0.56.0

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