Documentation ¶
Index ¶
- Constants
- Variables
- func GetAddress(c echo.Context) error
- func GetAddressUnspentOutputs(c echo.Context) error
- func GetBranch(c echo.Context) (err error)
- func GetBranchChildren(c echo.Context) (err error)
- func GetBranchConflicts(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 GetTransactionConsensusMetadata(c echo.Context) (err error)
- func GetTransactionInclusionState(c echo.Context) (err error)
- func GetTransactionMetadata(c echo.Context) (err error)
- func Plugin() *node.Plugin
- func PostAddressUnspentOutputs(c echo.Context) error
- func PostTransaction(c echo.Context) error
- type DoubleSpendFilter
Constants ¶
const ( PluginName = "WebAPI ledgerstate Endpoint" 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.
Functions ¶
func GetAddress ¶
GetAddress is the handler for the /ledgerstate/addresses/:address endpoint.
func GetAddressUnspentOutputs ¶
GetAddressUnspentOutputs is the handler for the /ledgerstate/addresses/:address/unspentOutputs endpoint.
func GetBranchChildren ¶
GetBranchChildren is the handler for the /ledgerstate/branch/:branchID/childBranches endpoint.
func GetBranchConflicts ¶
GetBranchConflicts is the handler for the /ledgerstate/branch/:branchID/conflicts 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 GetTransactionConsensusMetadata ¶ added in v0.5.7
GetTransactionConsensusMetadata is the handler for the ledgerstate/transactions/:transactionID/consensus endpoint.
func GetTransactionInclusionState ¶ added in v0.6.0
GetTransactionInclusionState is the handler for the ledgerstate/transactions/:transactionID/inclusionState endpoint.
func GetTransactionMetadata ¶
GetTransactionMetadata is the handler for the ledgerstate/transactions/:transactionID/metadata endpoint.
func PostAddressUnspentOutputs ¶ added in v0.6.0
PostAddressUnspentOutputs is the handler for the /ledgerstate/addresses/unspentOutputs endpoint.
func PostTransaction ¶ added in v0.6.0
PostTransaction sends a transaction.
Types ¶
type DoubleSpendFilter ¶ added in v0.7.2
type DoubleSpendFilter struct {
// contains filtered or unexported fields
}
DoubleSpendFilter keeps a log of recently submitted transactions and their consumed outputs.
func Filter ¶ added in v0.7.2
func Filter() *DoubleSpendFilter
Filter returns the double spend filter singleton.
func NewDoubleSpendFilter ¶ added in v0.7.2
func NewDoubleSpendFilter() *DoubleSpendFilter
NewDoubleSpendFilter creates a new doubleSpendFilter worker.
func (*DoubleSpendFilter) Add ¶ added in v0.7.2
func (d *DoubleSpendFilter) Add(tx *ledgerstate.Transaction)
Add adds a transaction and it's consumed inputs to the doubleSpendFilter.
func (*DoubleSpendFilter) CleanUp ¶ added in v0.7.2
func (d *DoubleSpendFilter) CleanUp()
CleanUp removes transactions from the DoubleSpendFilter if they were added more, than 30s ago.
func (*DoubleSpendFilter) HasConflict ¶ added in v0.7.2
func (d *DoubleSpendFilter) HasConflict(outputs ledgerstate.Inputs) (bool, ledgerstate.TransactionID)
HasConflict returns if there is a conflicting output in the internal map wrt to the provided inputs (outputIDs).
func (*DoubleSpendFilter) Remove ¶ added in v0.7.2
func (d *DoubleSpendFilter) Remove(txID ledgerstate.TransactionID)
Remove removes all outputs associated to the given transaction ID.