Documentation ¶
Index ¶
- Constants
- Variables
- func FilterAdd(tx *devnetvm.Transaction)
- func FilterHasConflict(outputs devnetvm.Inputs) (bool, utxo.TransactionID)
- func FilterRemove(txID utxo.TransactionID)
- func GetAddress(c echo.Context) error
- func GetAddressUnspentOutputs(c echo.Context) error
- func GetConflict(c echo.Context) (err error)
- func GetConflictChildren(c echo.Context) (err error)
- func GetConflictConflicts(c echo.Context) (err error)
- func GetConflictSequenceIDs(c echo.Context) (err error)
- func GetConflictVoters(c echo.Context) (err error)
- func GetOutput(c echo.Context) (err error)
- func GetOutputConsumers(c echo.Context) (err error)
- func GetOutputMetadata(c echo.Context) (err error)
- func GetTransaction(c echo.Context) (err error)
- func GetTransactionAttachments(c echo.Context) (err error)
- func GetTransactionMetadata(c echo.Context) (err error)
- func PostAddressUnspentOutputs(c echo.Context) error
- func PostTransaction(c echo.Context) error
- type DoubleSpendFilter
Constants ¶
const ( PluginName = "WebAPILedgerstateEndpoint" DoubleSpendFilterCleanupInterval = 10 * time.Second )
PluginName is the name of the web API plugin.
Variables ¶
var ErrNotAllowedToPledgeManaToNode = errors.New("not allowed to pledge mana to node")
ErrNotAllowedToPledgeManaToNode defines an unsupported node to pledge mana to.
var ( // Plugin holds the singleton instance of the plugin. Plugin *node.Plugin )
Functions ¶
func FilterAdd ¶
func FilterAdd(tx *devnetvm.Transaction)
FilterAdd Adds transaction to the doubleSpendFilter if it is enabled.
func FilterHasConflict ¶
func FilterHasConflict(outputs devnetvm.Inputs) (bool, utxo.TransactionID)
FilterHasConflict checks if the outputs are conflicting if doubleSpendFilter is enabled.
func FilterRemove ¶
func FilterRemove(txID utxo.TransactionID)
FilterRemove Removes transaction id from the doubleSpendFilter if it is enabled.
func GetAddress ¶
GetAddress is the handler for the /ledgerstate/addresses/:address endpoint.
func GetAddressUnspentOutputs ¶ added in v0.1.2
GetAddressUnspentOutputs is the handler for the /ledgerstate/addresses/:address/unspentOutputs endpoint.
func GetConflict ¶
GetConflict is the handler for the /ledgerstate/conflict/:conflictID endpoint.
func GetConflictChildren ¶
GetConflictChildren is the handler for the /ledgerstate/conflict/:conflictID/childConflicts endpoint.
func GetConflictConflicts ¶
GetConflictConflicts is the handler for the /ledgerstate/conflict/:conflictID/conflicts endpoint.
func GetConflictSequenceIDs ¶
GetConflictSequenceIDs is the handler for the /ledgerstate/conflict/:conflictID endpoint.
func GetConflictVoters ¶
GetConflictVoters is the handler for the /ledgerstate/conflicts/:conflictID/voters endpoint.
func GetOutputConsumers ¶
GetOutputConsumers is the handler for the /ledgerstate/outputs/:outputID/consumers endpoint.
func GetOutputMetadata ¶
GetOutputMetadata is the handler for the /ledgerstate/outputs/:outputID/metadata endpoint.
func GetTransaction ¶
GetTransaction is the handler for the /ledgerstate/transactions/:transactionID endpoint.
func GetTransactionAttachments ¶
GetTransactionAttachments is the handler for the ledgerstate/transactions/:transactionID/attachments endpoint.
func GetTransactionMetadata ¶
GetTransactionMetadata is the handler for the ledgerstate/transactions/:transactionID/metadata endpoint.
func PostAddressUnspentOutputs ¶
PostAddressUnspentOutputs is the handler for the /ledgerstate/addresses/unspentOutputs endpoint.
func PostTransaction ¶
PostTransaction sends a transaction.
Types ¶
type DoubleSpendFilter ¶
type DoubleSpendFilter struct {
// contains filtered or unexported fields
}
DoubleSpendFilter keeps a log of recently submitted transactions and their consumed outputs.
func NewDoubleSpendFilter ¶
func NewDoubleSpendFilter() *DoubleSpendFilter
NewDoubleSpendFilter creates a new doubleSpendFilter worker.
func (*DoubleSpendFilter) Add ¶
func (d *DoubleSpendFilter) Add(tx *devnetvm.Transaction)
Add adds a transaction and it's consumed inputs to the doubleSpendFilter.
func (*DoubleSpendFilter) CleanUp ¶
func (d *DoubleSpendFilter) CleanUp()
CleanUp removes transactions from the DoubleSpendFilter if they were added more, than 30s ago.
func (*DoubleSpendFilter) HasConflict ¶
func (d *DoubleSpendFilter) HasConflict(outputs devnetvm.Inputs) (bool, utxo.TransactionID)
HasConflict returns if there is a conflicting output in the internal map wrt to the provided inputs (outputIDs).
func (*DoubleSpendFilter) Remove ¶
func (d *DoubleSpendFilter) Remove(txID utxo.TransactionID)
Remove removes all outputs associated to the given transaction ID.