Documentation
¶
Index ¶
- Constants
- Variables
- func OnWebAPIRequest(fundingRequest *faucet.Payload) error
- type Connector
- func (f *Connector) GetTransactionConfirmationState(txID utxo.TransactionID) (confirmationState confirmation.State, err error)
- func (f *Connector) GetUnspentAliasOutput(address *devnetvm.AliasAddress) (output *devnetvm.AliasOutput, err error)
- func (f *Connector) RequestFaucetFunds(address address.Address, powTarget int) (err error)
- func (f *Connector) SendTransaction(tx *devnetvm.Transaction) (err error)
- func (f *Connector) UnspentOutputs(addresses ...address.Address) (unspentOutputs wallet.OutputsByAddressAndOutputID, err error)
- type Faucet
- type ParametersDefinition
Constants ¶
View Source
const (
// PluginName is the name of the faucet plugin.
PluginName = "Faucet"
)
Variables ¶
View Source
var Parameters = &ParametersDefinition{}
Parameters contains the configuration parameters of the faucet plugin.
View Source
var ( // Plugin is the "plugin" instance of the faucet application. Plugin *node.Plugin )
Functions ¶
func OnWebAPIRequest ¶
Types ¶
type Connector ¶
type Connector struct {
// contains filtered or unexported fields
}
func NewConnector ¶
func NewConnector(p *protocol.Protocol, blockIssuer *blockissuer.BlockIssuer, indexer *indexer.Indexer) *Connector
func (*Connector) GetTransactionConfirmationState ¶
func (f *Connector) GetTransactionConfirmationState(txID utxo.TransactionID) (confirmationState confirmation.State, err error)
func (*Connector) GetUnspentAliasOutput ¶
func (f *Connector) GetUnspentAliasOutput(address *devnetvm.AliasAddress) (output *devnetvm.AliasOutput, err error)
func (*Connector) RequestFaucetFunds ¶
func (*Connector) SendTransaction ¶
func (f *Connector) SendTransaction(tx *devnetvm.Transaction) (err error)
func (*Connector) UnspentOutputs ¶
type Faucet ¶
type ParametersDefinition ¶
type ParametersDefinition struct {
// Seed defines the base58 encoded seed the faucet uses.
Seed string `usage:"the base58 encoded seed of the faucet, must be defined if this faucet is enabled"`
// TokensPerRequest defines the amount of tokens the faucet should send for each request.
TokensPerRequest int `default:"1000000" usage:"the amount of tokens the faucet should send for each request"`
// MaxTransactionBookedAwaitTime defines the time to await for the transaction fulfilling a funding request
// to become booked in the value layer.
MaxTransactionBookedAwaitTime time.Duration `default:"60s" usage:"the max amount of time for a funding transaction to become booked in the value layer"`
// PowDifficulty defines the PoW difficulty for faucet payloads.
PowDifficulty int `default:"22" usage:"defines the PoW difficulty for faucet payloads"`
// MaxWaitAttempts defines the maximum time to wait for a transaction to be accepted.
MaxAwait time.Duration `default:"60s" usage:"the maximum time to wait for a transaction to be accepted"`
}
ParametersDefinition contains the definition of configuration parameters used by the faucet plugin.
Click to show internal directories.
Click to hide internal directories.