Documentation ¶
Overview ¶
Package penumbra provides an implementation of ibc.Chain for the Penumbra blockchain.
Index ¶
- type GenesisFile
- type GenesisValidatorPubKey
- type GenesisValidators
- type PenumbraAppNode
- func (p *PenumbraAppNode) AllocationsInputFileContainer() string
- func (p *PenumbraAppNode) Bind() []string
- func (p *PenumbraAppNode) CreateKey(ctx context.Context, keyName string) error
- func (p *PenumbraAppNode) CreateNodeContainer(ctx context.Context, tendermintAddress string) error
- func (p *PenumbraAppNode) Exec(ctx context.Context, cmd []string, env []string) ([]byte, []byte, error)
- func (p *PenumbraAppNode) FullViewingKey(ctx context.Context, keyName string) (string, error)
- func (p *PenumbraAppNode) GenerateGenesisFile(ctx context.Context, chainID string, validators []PenumbraValidatorDefinition, ...) error
- func (p *PenumbraAppNode) GetAddress(ctx context.Context, keyName string) ([]byte, error)
- func (p *PenumbraAppNode) GetAddressBech32m(ctx context.Context, keyName string) (string, error)
- func (p *PenumbraAppNode) GetBalance(ctx context.Context, keyName string) (int64, error)
- func (p *PenumbraAppNode) HomeDir() string
- func (p *PenumbraAppNode) HostName() string
- func (p *PenumbraAppNode) InitValidatorFile(ctx context.Context, valKeyName string) error
- func (p *PenumbraAppNode) Name() string
- func (p *PenumbraAppNode) RecoverKey(ctx context.Context, keyName, mnemonic string) error
- func (p *PenumbraAppNode) SendIBCTransfer(ctx context.Context, channelID string, keyName string, amount ibc.WalletAmount, ...) (ibc.Tx, error)
- func (p *PenumbraAppNode) StartContainer(ctx context.Context) error
- func (p *PenumbraAppNode) StopContainer(ctx context.Context) error
- func (p *PenumbraAppNode) ValidatorDefinitionTemplateFilePathContainer() string
- func (p *PenumbraAppNode) ValidatorsInputFileContainer() string
- type PenumbraChain
- func (c *PenumbraChain) Acknowledgements(ctx context.Context, height int64) ([]ibc.PacketAcknowledgement, error)
- func (c *PenumbraChain) BuildRelayerWallet(ctx context.Context, keyName string) (ibc.Wallet, error)
- func (c *PenumbraChain) BuildWallet(ctx context.Context, keyName string, mnemonic string) (ibc.Wallet, error)
- func (c *PenumbraChain) Config() ibc.ChainConfig
- func (c PenumbraChain) CreateClientNode(ctx context.Context, keyName string) error
- func (c *PenumbraChain) CreateKey(ctx context.Context, keyName string) error
- func (c *PenumbraChain) Exec(ctx context.Context, cmd []string, env []string) (stdout, stderr []byte, err error)
- func (c *PenumbraChain) ExportState(ctx context.Context, height int64) (string, error)
- func (c *PenumbraChain) GetAddress(ctx context.Context, keyName string) ([]byte, error)
- func (c *PenumbraChain) GetBalance(ctx context.Context, keyName string, denom string) (math.Int, error)
- func (c *PenumbraChain) GetGRPCAddress() string
- func (c *PenumbraChain) GetGasFeesInNativeDenom(gasPaid int64) int64
- func (c *PenumbraChain) GetHostGRPCAddress() string
- func (c *PenumbraChain) GetHostPeerAddress() string
- func (c *PenumbraChain) GetHostRPCAddress() string
- func (c *PenumbraChain) GetRPCAddress() string
- func (c *PenumbraChain) Height(ctx context.Context) (int64, error)
- func (c *PenumbraChain) HomeDir() string
- func (c *PenumbraChain) Initialize(ctx context.Context, testName string, cli *client.Client, networkID string) error
- func (c *PenumbraChain) RecoverKey(ctx context.Context, name, mnemonic string) error
- func (c *PenumbraChain) SendFunds(ctx context.Context, keyName string, amount ibc.WalletAmount) error
- func (c *PenumbraChain) SendIBCTransfer(ctx context.Context, channelID string, keyName string, amount ibc.WalletAmount, ...) (ibc.Tx, error)
- func (c *PenumbraChain) Start(testName string, ctx context.Context, ...) error
- func (c *PenumbraChain) Timeouts(ctx context.Context, height int64) ([]ibc.PacketTimeout, error)
- type PenumbraClientNode
- func (p *PenumbraClientNode) Bind() []string
- func (p *PenumbraClientNode) CreateNodeContainer(ctx context.Context, pdAddress string) error
- func (p *PenumbraClientNode) Exec(ctx context.Context, cmd []string, env []string) ([]byte, []byte, error)
- func (p *PenumbraClientNode) GetAddress(ctx context.Context) ([]byte, error)
- func (p *PenumbraClientNode) GetBalance(ctx context.Context, denom string) (math.Int, error)
- func (p *PenumbraClientNode) GetDenomMetadata(ctx context.Context, assetId *cryptov1alpha1.AssetId) (*cryptov1alpha1.DenomMetadata, error)
- func (p *PenumbraClientNode) HomeDir() string
- func (p *PenumbraClientNode) HostName() string
- func (p *PenumbraClientNode) Initialize(ctx context.Context, spendKey, fullViewingKey string) error
- func (p *PenumbraClientNode) Name() string
- func (p *PenumbraClientNode) SendFunds(ctx context.Context, amount ibc.WalletAmount) error
- func (p *PenumbraClientNode) SendIBCTransfer(ctx context.Context, channelID string, amount ibc.WalletAmount, ...) (ibc.Tx, error)
- func (p *PenumbraClientNode) StartContainer(ctx context.Context) error
- func (p *PenumbraClientNode) StopContainer(ctx context.Context) error
- func (p *PenumbraClientNode) WriteFile(ctx context.Context, content []byte, relPath string) error
- type PenumbraConsensusKey
- type PenumbraCustodyKey
- type PenumbraGenesisAppStateAllocation
- type PenumbraNode
- type PenumbraNodes
- type PenumbraValidatorDefinition
- type PenumbraValidatorFundingStream
- type PenumbraWallet
- type ValidatorWithIntPower
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GenesisFile ¶
type GenesisFile struct {
Validators []GenesisValidators `json:"validators"`
}
type GenesisValidatorPubKey ¶
type GenesisValidators ¶
type GenesisValidators struct { Address string `json:"address"` Name string `json:"name"` Power string `json:"power"` PubKey GenesisValidatorPubKey `json:"pub_key"` }
type PenumbraAppNode ¶
type PenumbraAppNode struct { Index int VolumeName string Chain *PenumbraChain TestName string NetworkID string DockerClient *client.Client Image ibc.DockerImage // contains filtered or unexported fields }
func NewPenumbraAppNode ¶
func NewPenumbraAppNode( ctx context.Context, log *zap.Logger, chain *PenumbraChain, index int, testName string, dockerClient *dockerclient.Client, networkID string, image ibc.DockerImage, ) (*PenumbraAppNode, error)
func (*PenumbraAppNode) AllocationsInputFileContainer ¶
func (p *PenumbraAppNode) AllocationsInputFileContainer() string
func (*PenumbraAppNode) Bind ¶
func (p *PenumbraAppNode) Bind() []string
Bind returns the home folder bind point for running the node
func (*PenumbraAppNode) CreateKey ¶
func (p *PenumbraAppNode) CreateKey(ctx context.Context, keyName string) error
func (*PenumbraAppNode) CreateNodeContainer ¶
func (p *PenumbraAppNode) CreateNodeContainer(ctx context.Context, tendermintAddress string) error
func (*PenumbraAppNode) Exec ¶
func (p *PenumbraAppNode) Exec(ctx context.Context, cmd []string, env []string) ([]byte, []byte, error)
Exec run a container for a specific job and block until the container exits
func (*PenumbraAppNode) FullViewingKey ¶
func (*PenumbraAppNode) GenerateGenesisFile ¶
func (p *PenumbraAppNode) GenerateGenesisFile( ctx context.Context, chainID string, validators []PenumbraValidatorDefinition, allocations []PenumbraGenesisAppStateAllocation, ) error
func (*PenumbraAppNode) GetAddress ¶
func (*PenumbraAppNode) GetAddressBech32m ¶
func (*PenumbraAppNode) GetBalance ¶
TODO we need to change the func sig to take a denom then filter out the target denom bal from stdout
func (*PenumbraAppNode) HomeDir ¶
func (p *PenumbraAppNode) HomeDir() string
func (*PenumbraAppNode) HostName ¶
func (p *PenumbraAppNode) HostName() string
the hostname of the test node container
func (*PenumbraAppNode) InitValidatorFile ¶
func (p *PenumbraAppNode) InitValidatorFile(ctx context.Context, valKeyName string) error
initializes validator definition template file wallet must be generated first
func (*PenumbraAppNode) Name ¶
func (p *PenumbraAppNode) Name() string
Name of the test node container
func (*PenumbraAppNode) RecoverKey ¶
func (p *PenumbraAppNode) RecoverKey(ctx context.Context, keyName, mnemonic string) error
RecoverKey restores a key from a given mnemonic.
func (*PenumbraAppNode) SendIBCTransfer ¶ added in v8.1.0
func (p *PenumbraAppNode) SendIBCTransfer( ctx context.Context, channelID string, keyName string, amount ibc.WalletAmount, options ibc.TransferOptions, ) (ibc.Tx, error)
func (*PenumbraAppNode) StartContainer ¶
func (p *PenumbraAppNode) StartContainer(ctx context.Context) error
func (*PenumbraAppNode) StopContainer ¶
func (p *PenumbraAppNode) StopContainer(ctx context.Context) error
func (*PenumbraAppNode) ValidatorDefinitionTemplateFilePathContainer ¶
func (p *PenumbraAppNode) ValidatorDefinitionTemplateFilePathContainer() string
func (*PenumbraAppNode) ValidatorsInputFileContainer ¶
func (p *PenumbraAppNode) ValidatorsInputFileContainer() string
type PenumbraChain ¶
type PenumbraChain struct { PenumbraNodes PenumbraNodes // contains filtered or unexported fields }
func NewPenumbraChain ¶
func NewPenumbraChain(log *zap.Logger, testName string, chainConfig ibc.ChainConfig, numValidators int, numFullNodes int) *PenumbraChain
func (*PenumbraChain) Acknowledgements ¶
func (c *PenumbraChain) Acknowledgements(ctx context.Context, height int64) ([]ibc.PacketAcknowledgement, error)
func (*PenumbraChain) BuildRelayerWallet ¶
BuildRelayerWallet will return a Penumbra wallet populated with the mnemonic so that the wallet can be restored in the relayer node using the mnemonic. After it is built, that address is included in genesis with some funds.
func (*PenumbraChain) BuildWallet ¶
func (c *PenumbraChain) BuildWallet(ctx context.Context, keyName string, mnemonic string) (ibc.Wallet, error)
BuildWallet will return a Penumbra wallet If mnemonic != "", it will restore using that mnemonic If mnemonic == "", it will create a new key
func (*PenumbraChain) Config ¶
func (c *PenumbraChain) Config() ibc.ChainConfig
Implements Chain interface
func (PenumbraChain) CreateClientNode ¶
func (c PenumbraChain) CreateClientNode( ctx context.Context, keyName string, ) error
func (*PenumbraChain) CreateKey ¶
func (c *PenumbraChain) CreateKey(ctx context.Context, keyName string) error
CreateKey derives a new key with the given keyName.
func (*PenumbraChain) Exec ¶
func (c *PenumbraChain) Exec(ctx context.Context, cmd []string, env []string) (stdout, stderr []byte, err error)
Exec implements chain interface.
func (*PenumbraChain) ExportState ¶
func (*PenumbraChain) GetAddress ¶
GetAddress returns the byte representation of an address for the specified keyName.
func (*PenumbraChain) GetBalance ¶
func (c *PenumbraChain) GetBalance(ctx context.Context, keyName string, denom string) (math.Int, error)
GetBalance attempts to make a balance request for the specified denom and the account associated with the specified keyName.
func (*PenumbraChain) GetGRPCAddress ¶
func (c *PenumbraChain) GetGRPCAddress() string
Implements Chain interface
func (*PenumbraChain) GetGasFeesInNativeDenom ¶
func (c *PenumbraChain) GetGasFeesInNativeDenom(gasPaid int64) int64
GetGasFeesInNativeDenom returns the fees used to pay for some compute with the local token denom, where fees = gasPaid * gasPrice.
func (*PenumbraChain) GetHostGRPCAddress ¶
func (c *PenumbraChain) GetHostGRPCAddress() string
GetHostGRPCAddress returns the address of the gRPC server accessible by the host. This will not return a valid address until the chain has been started.
func (*PenumbraChain) GetHostPeerAddress ¶ added in v8.1.0
func (c *PenumbraChain) GetHostPeerAddress() string
Implements Chain interface
func (*PenumbraChain) GetHostRPCAddress ¶
func (c *PenumbraChain) GetHostRPCAddress() string
GetHostRPCAddress returns the address of the RPC server accessible by the host. This will not return a valid address until the chain has been started.
func (*PenumbraChain) GetRPCAddress ¶
func (c *PenumbraChain) GetRPCAddress() string
Implements Chain interface
func (*PenumbraChain) Height ¶
func (c *PenumbraChain) Height(ctx context.Context) (int64, error)
Height returns the current chain block height.
func (*PenumbraChain) HomeDir ¶
func (c *PenumbraChain) HomeDir() string
func (*PenumbraChain) Initialize ¶
func (c *PenumbraChain) Initialize(ctx context.Context, testName string, cli *client.Client, networkID string) error
Implements Chain interface
func (*PenumbraChain) RecoverKey ¶
func (c *PenumbraChain) RecoverKey(ctx context.Context, name, mnemonic string) error
RecoverKey restores an existing key with the given mnemonic and associates it with the specified key name in the keyring.
func (*PenumbraChain) SendFunds ¶
func (c *PenumbraChain) SendFunds(ctx context.Context, keyName string, amount ibc.WalletAmount) error
SendFunds will initiate a local transfer from the account associated with the specified keyName, amount, token denom, and recipient are specified in the amount.
func (*PenumbraChain) SendIBCTransfer ¶
func (c *PenumbraChain) SendIBCTransfer( ctx context.Context, channelID string, keyName string, amount ibc.WalletAmount, options ibc.TransferOptions, ) (ibc.Tx, error)
SendIBCTransfer attempts to send a fungible token transfer via IBC from the specified account on the source chain to the specified account on the counterparty chain.
func (*PenumbraChain) Start ¶
func (c *PenumbraChain) Start(testName string, ctx context.Context, additionalGenesisWallets ...ibc.WalletAmount) error
func (*PenumbraChain) Timeouts ¶
func (c *PenumbraChain) Timeouts(ctx context.Context, height int64) ([]ibc.PacketTimeout, error)
type PenumbraClientNode ¶
type PenumbraClientNode struct { KeyName string Index int VolumeName string Chain ibc.Chain TestName string NetworkID string DockerClient *client.Client Image ibc.DockerImage // contains filtered or unexported fields }
func NewClientNode ¶
func (*PenumbraClientNode) Bind ¶
func (p *PenumbraClientNode) Bind() []string
Bind returns the home folder bind point for running the node
func (*PenumbraClientNode) CreateNodeContainer ¶
func (p *PenumbraClientNode) CreateNodeContainer(ctx context.Context, pdAddress string) error
func (*PenumbraClientNode) Exec ¶
func (p *PenumbraClientNode) Exec(ctx context.Context, cmd []string, env []string) ([]byte, []byte, error)
Exec run a container for a specific job and block until the container exits
func (*PenumbraClientNode) GetAddress ¶
func (p *PenumbraClientNode) GetAddress(ctx context.Context) ([]byte, error)
func (*PenumbraClientNode) GetBalance ¶
func (*PenumbraClientNode) GetDenomMetadata ¶
func (p *PenumbraClientNode) GetDenomMetadata(ctx context.Context, assetId *cryptov1alpha1.AssetId) (*cryptov1alpha1.DenomMetadata, error)
GetDenomMetadata invokes a gRPC request to obtain the DenomMetadata for a specified asset ID.
func (*PenumbraClientNode) HomeDir ¶
func (p *PenumbraClientNode) HomeDir() string
func (*PenumbraClientNode) HostName ¶
func (p *PenumbraClientNode) HostName() string
the hostname of the test node container
func (*PenumbraClientNode) Initialize ¶
func (p *PenumbraClientNode) Initialize(ctx context.Context, spendKey, fullViewingKey string) error
Initialize loads the view and spend keys into the pclientd config.
func (*PenumbraClientNode) Name ¶
func (p *PenumbraClientNode) Name() string
Name of the test node container
func (*PenumbraClientNode) SendFunds ¶
func (p *PenumbraClientNode) SendFunds(ctx context.Context, amount ibc.WalletAmount) error
func (*PenumbraClientNode) SendIBCTransfer ¶
func (p *PenumbraClientNode) SendIBCTransfer( ctx context.Context, channelID string, amount ibc.WalletAmount, options ibc.TransferOptions, ) (ibc.Tx, error)
func (*PenumbraClientNode) StartContainer ¶
func (p *PenumbraClientNode) StartContainer(ctx context.Context) error
func (*PenumbraClientNode) StopContainer ¶
func (p *PenumbraClientNode) StopContainer(ctx context.Context) error
type PenumbraConsensusKey ¶
type PenumbraCustodyKey ¶
type PenumbraCustodyKey struct {
SpendKey string `json:"spend_key"`
}
type PenumbraNode ¶
type PenumbraNode struct { TendermintNode *tendermint.TendermintNode PenumbraAppNode *PenumbraAppNode PenumbraClientNodes map[string]*PenumbraClientNode // contains filtered or unexported fields }
func NewPenumbraNode ¶
func NewPenumbraNode( ctx context.Context, i int, c *PenumbraChain, dockerClient *dockerclient.Client, networkID string, testName string, tendermintImage ibc.DockerImage, penumbraImage ibc.DockerImage, ) (PenumbraNode, error)
NewChainNode returns a penumbra chain node with tendermint and penumbra nodes with docker volumes created.
func (*PenumbraNode) CreateClientNode ¶
type PenumbraNodes ¶
type PenumbraNodes []*PenumbraNode
type PenumbraValidatorDefinition ¶
type PenumbraValidatorDefinition struct { SequenceNumber int `json:"sequence_number" toml:"sequence_number"` Enabled bool `json:"enabled" toml:"enabled"` Name string `json:"name" toml:"name"` Website string `json:"website" toml:"website"` Description string `json:"description" toml:"description"` IdentityKey string `json:"identity_key" toml:"identity_key"` GovernanceKey string `json:"governance_key" toml:"governance_key"` ConsensusKey PenumbraConsensusKey `json:"consensus_key" toml:"consensus_key"` FundingStreams []PenumbraValidatorFundingStream `json:"funding_streams" toml:"funding_stream"` }
type PenumbraWallet ¶
type PenumbraWallet struct {
// contains filtered or unexported fields
}
func NewWallet ¶
func NewWallet(keyname string, address []byte, mnemonic string, chainCfg ibc.ChainConfig) *PenumbraWallet
func (*PenumbraWallet) FormattedAddress ¶
func (w *PenumbraWallet) FormattedAddress() string
Get Address formatted with chain's prefix
func (*PenumbraWallet) FormattedAddressWithPrefix ¶
func (w *PenumbraWallet) FormattedAddressWithPrefix(prefix string) string
func (*PenumbraWallet) KeyName ¶
func (w *PenumbraWallet) KeyName() string
func (*PenumbraWallet) Mnemonic ¶
func (w *PenumbraWallet) Mnemonic() string
Get mnemonic, only used for relayer wallets