Documentation
¶
Index ¶
- Constants
- type NamadaChain
- func (c *NamadaChain) Acknowledgements(ctx context.Context, height int64) ([]ibc.PacketAcknowledgement, error)
- func (c *NamadaChain) BuildRelayerWallet(ctx context.Context, keyName string) (ibc.Wallet, error)
- func (c *NamadaChain) BuildWallet(ctx context.Context, keyName string, mnemonic string) (ibc.Wallet, error)
- func (c *NamadaChain) Config() ibc.ChainConfig
- func (c *NamadaChain) CreateKey(ctx context.Context, keyName string) error
- func (c *NamadaChain) Exec(ctx context.Context, cmd []string, env []string) (stdout, stderr []byte, err error)
- func (c *NamadaChain) ExportState(ctx context.Context, height int64) (string, error)
- func (c *NamadaChain) GenIbcShieldingTransfer(ctx context.Context, channelID string, amount ibc.WalletAmount, ...) (string, error)
- func (c *NamadaChain) GetAddress(ctx context.Context, keyName string) ([]byte, error)
- func (c *NamadaChain) GetBalance(ctx context.Context, keyName string, denom string) (math.Int, error)
- func (c *NamadaChain) GetGRPCAddress() string
- func (c *NamadaChain) GetGasFeesInNativeDenom(gasPaid int64) int64
- func (c *NamadaChain) GetHostGRPCAddress() string
- func (c *NamadaChain) GetHostPeerAddress() string
- func (c *NamadaChain) GetHostRPCAddress() string
- func (c *NamadaChain) GetRPCAddress() string
- func (c *NamadaChain) Height(ctx context.Context) (int64, error)
- func (c *NamadaChain) HomeDir() string
- func (c *NamadaChain) Initialize(ctx context.Context, testName string, cli *client.Client, networkID string) error
- func (c *NamadaChain) RecoverKey(ctx context.Context, keyName, mnemonic string) error
- func (c *NamadaChain) SendFunds(ctx context.Context, keyName string, amount ibc.WalletAmount) error
- func (c *NamadaChain) SendFundsWithNote(ctx context.Context, keyName string, amount ibc.WalletAmount, note string) (string, error)
- func (c *NamadaChain) SendIBCTransfer(ctx context.Context, channelID, keyName string, amount ibc.WalletAmount, ...) (ibc.Tx, error)
- func (c *NamadaChain) ShieldedTransfer(ctx context.Context, keyName string, amount ibc.WalletAmount) error
- func (c *NamadaChain) Start(testName string, ctx context.Context, ...) error
- func (c *NamadaChain) Timeouts(ctx context.Context, height int64) ([]ibc.PacketTimeout, error)
- type NamadaNode
- func (n *NamadaNode) Bind() []string
- func (n *NamadaNode) CreateContainer(ctx context.Context) error
- func (n *NamadaNode) Exec(ctx context.Context, cmd []string, env []string) ([]byte, []byte, error)
- func (n *NamadaNode) Height(ctx context.Context) (int64, error)
- func (n *NamadaNode) HomeDir() string
- func (n *NamadaNode) HostName() string
- func (n *NamadaNode) Name() string
- func (n *NamadaNode) NewRPCClient(addr string) error
- func (n *NamadaNode) NodeType() string
- func (n *NamadaNode) ReadFile(ctx context.Context, relPath string) ([]byte, error)
- func (n *NamadaNode) StartContainer(ctx context.Context) error
- func (n *NamadaNode) WaitMaspFileDownload(ctx context.Context) error
- type NamadaNodes
- type NamadaWallet
Constants ¶
const ( NamAddress = "tnam1qxgfw7myv4dh0qna4hq0xdg6lx77fzl7dcem8h7e" NamTokenDenom = int64(6) MaspAddress = "tnam1pcqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzmefah" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NamadaChain ¶
type NamadaChain struct { NumValidators int Validators NamadaNodes FullNodes NamadaNodes // contains filtered or unexported fields }
func NewNamadaChain ¶
func NewNamadaChain(testName string, chainConfig ibc.ChainConfig, numValidators int, numFullNodes int, log *zap.Logger) *NamadaChain
New instance of NamadaChain.
func (*NamadaChain) Acknowledgements ¶
func (c *NamadaChain) Acknowledgements(ctx context.Context, height int64) ([]ibc.PacketAcknowledgement, error)
All acks at the height.
func (*NamadaChain) BuildRelayerWallet ¶
Build a Namada wallet for a relayer.
func (*NamadaChain) BuildWallet ¶
func (c *NamadaChain) BuildWallet(ctx context.Context, keyName string, mnemonic string) (ibc.Wallet, error)
Build a Namada wallet. Generates a spending key when the keyName prefixed with "shielded".
func (*NamadaChain) CreateKey ¶
func (c *NamadaChain) CreateKey(ctx context.Context, keyName string) error
Create a test key.
func (*NamadaChain) Exec ¶
func (c *NamadaChain) Exec(ctx context.Context, cmd []string, env []string) (stdout, stderr []byte, err error)
Execute a command.
func (*NamadaChain) ExportState ¶
Exports the chain state at the specific height.
func (*NamadaChain) GenIbcShieldingTransfer ¶
func (c *NamadaChain) GenIbcShieldingTransfer(ctx context.Context, channelID string, amount ibc.WalletAmount, options ibc.TransferOptions) (string, error)
Generate an IBC shielding transfer for the following shielding transfer via IBC.
func (*NamadaChain) GetAddress ¶
Get the Namada address.
func (*NamadaChain) GetBalance ¶
func (c *NamadaChain) GetBalance(ctx context.Context, keyName string, denom string) (math.Int, error)
Get the balance with the key alias, not the address.
func (*NamadaChain) GetGRPCAddress ¶
func (c *NamadaChain) GetGRPCAddress() string
Get the gRPC address. This isn't used for Namada.
func (*NamadaChain) GetGasFeesInNativeDenom ¶
func (c *NamadaChain) GetGasFeesInNativeDenom(gasPaid int64) int64
Get the gas fees.
func (*NamadaChain) GetHostGRPCAddress ¶
func (c *NamadaChain) GetHostGRPCAddress() string
Get the host gRPC address.
func (*NamadaChain) GetHostPeerAddress ¶
func (c *NamadaChain) GetHostPeerAddress() string
Get the host peer address.
func (*NamadaChain) GetHostRPCAddress ¶
func (c *NamadaChain) GetHostRPCAddress() string
Get the host RPC address.
func (*NamadaChain) GetRPCAddress ¶
func (c *NamadaChain) GetRPCAddress() string
Get the RPC address.
func (*NamadaChain) Height ¶
func (c *NamadaChain) Height(ctx context.Context) (int64, error)
Get the current block height.
func (*NamadaChain) Initialize ¶
func (c *NamadaChain) Initialize(ctx context.Context, testName string, cli *client.Client, networkID string) error
Initialize the chain.
func (*NamadaChain) RecoverKey ¶
func (c *NamadaChain) RecoverKey(ctx context.Context, keyName, mnemonic string) error
Recovery a test key.
func (*NamadaChain) SendFunds ¶
func (c *NamadaChain) SendFunds(ctx context.Context, keyName string, amount ibc.WalletAmount) error
Send funds to a wallet from a user account.
func (*NamadaChain) SendFundsWithNote ¶
func (c *NamadaChain) SendFundsWithNote(ctx context.Context, keyName string, amount ibc.WalletAmount, note string) (string, error)
Send funds to a wallet from a user account with a memo.
func (*NamadaChain) SendIBCTransfer ¶
func (c *NamadaChain) SendIBCTransfer(ctx context.Context, channelID, keyName string, amount ibc.WalletAmount, options ibc.TransferOptions) (ibc.Tx, error)
Send on IBC transfer.
func (*NamadaChain) ShieldedTransfer ¶
func (c *NamadaChain) ShieldedTransfer(ctx context.Context, keyName string, amount ibc.WalletAmount) error
Shielded transfer (shielded account to shielded account) on Namada.
func (*NamadaChain) Start ¶
func (c *NamadaChain) Start(testName string, ctx context.Context, additionalGenesisWallets ...ibc.WalletAmount) error
Start to set up.
func (*NamadaChain) Timeouts ¶
func (c *NamadaChain) Timeouts(ctx context.Context, height int64) ([]ibc.PacketTimeout, error)
All timeouts at the height.
type NamadaNode ¶
type NamadaNode struct { Index int Validator bool TestName string Chain ibc.Chain DockerClient *dockerclient.Client Client rpcclient.Client Image ibc.DockerImage VolumeName string NetworkID string // contains filtered or unexported fields }
func NewNamadaNode ¶
func NewNamadaNode( ctx context.Context, log *zap.Logger, chain *NamadaChain, index int, validator bool, testName string, dockerClient *dockerclient.Client, networkID string, image ibc.DockerImage, ) (*NamadaNode, error)
func (*NamadaNode) Bind ¶
func (n *NamadaNode) Bind() []string
func (*NamadaNode) CreateContainer ¶
func (n *NamadaNode) CreateContainer(ctx context.Context) error
func (*NamadaNode) HomeDir ¶
func (n *NamadaNode) HomeDir() string
Home directory in the Docker filesystem.
func (*NamadaNode) HostName ¶
func (n *NamadaNode) HostName() string
func (*NamadaNode) NewRPCClient ¶
func (n *NamadaNode) NewRPCClient(addr string) error
func (*NamadaNode) NodeType ¶
func (n *NamadaNode) NodeType() string
func (*NamadaNode) StartContainer ¶
func (n *NamadaNode) StartContainer(ctx context.Context) error
func (*NamadaNode) WaitMaspFileDownload ¶
func (n *NamadaNode) WaitMaspFileDownload(ctx context.Context) error
type NamadaWallet ¶
type NamadaWallet struct {
// contains filtered or unexported fields
}
NamadaWallet represents a wallet for the Namada application.
func NewWallet ¶
func NewWallet(keyname string, address []byte, mnemonic string, chainCfg ibc.ChainConfig) *NamadaWallet
NewWallet creates a new instance of NamadaWallet with the provided parameters.
func (*NamadaWallet) Address ¶
func (w *NamadaWallet) Address() []byte
Address returns the slice of bytes representing this NamadaWallet instance's address.
func (*NamadaWallet) FormattedAddress ¶
func (w *NamadaWallet) FormattedAddress() string
FormattedAddress returns the formatted address associated with a NamadaWallet instance. If the account is shielded, it returns the payment address.
func (*NamadaWallet) FormattedAddressWithPrefix ¶
func (w *NamadaWallet) FormattedAddressWithPrefix(prefix string) string
FormattedAddressWithPrefix returns the formatted address string with a given prefix. The prefix is a string that will be appended to the beginning of the address. It takes the address stored in the NamadaWallet instance and converts it to a string.
func (*NamadaWallet) KeyName ¶
func (w *NamadaWallet) KeyName() string
KeyName returns the key name associated with a NamadaWallet instance.
func (*NamadaWallet) Mnemonic ¶
func (w *NamadaWallet) Mnemonic() string
Mnemonic returns the mnemonic associated with a NamadaWallet instance.
func (*NamadaWallet) PaymentAddressKeyName ¶
func (w *NamadaWallet) PaymentAddressKeyName() string