ledgerstate

package
v0.8.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2022 License: Apache-2.0, BSD-2-Clause Imports: 20 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	PluginName                       = "WebAPILedgerstateEndpoint"
	DoubleSpendFilterCleanupInterval = 10 * time.Second
)

PluginName is the name of the web API plugin.

Variables

View Source
var ErrNotAllowedToPledgeManaToNode = errors.New("not allowed to pledge mana to node")

ErrNotAllowedToPledgeManaToNode defines an unsupported node to pledge mana to.

View Source
var (
	// Plugin holds the singleton instance of the plugin.
	Plugin *node.Plugin
)

Functions

func GetAddress

func GetAddress(c echo.Context) error

GetAddress is the handler for the /ledgerstate/addresses/:address endpoint.

func GetAddressUnspentOutputs

func GetAddressUnspentOutputs(c echo.Context) error

GetAddressUnspentOutputs is the handler for the /ledgerstate/addresses/:address/unspentOutputs endpoint.

func GetBranch

func GetBranch(c echo.Context) (err error)

GetBranch is the handler for the /ledgerstate/branch/:branchID endpoint.

func GetBranchChildren

func GetBranchChildren(c echo.Context) (err error)

GetBranchChildren is the handler for the /ledgerstate/branch/:branchID/childBranches endpoint.

func GetBranchConflicts

func GetBranchConflicts(c echo.Context) (err error)

GetBranchConflicts is the handler for the /ledgerstate/branch/:branchID/conflicts endpoint.

func GetBranchSupporters added in v0.8.0

func GetBranchSupporters(c echo.Context) (err error)

GetBranchSupporters is the handler for the /ledgerstate/branches/:branchID/supporters endpoint.

func GetOutput

func GetOutput(c echo.Context) (err error)

GetOutput is the handler for the /ledgerstate/outputs/:outputID endpoint.

func GetOutputConsumers

func GetOutputConsumers(c echo.Context) (err error)

GetOutputConsumers is the handler for the /ledgerstate/outputs/:outputID/consumers endpoint.

func GetOutputMetadata

func GetOutputMetadata(c echo.Context) (err error)

GetOutputMetadata is the handler for the /ledgerstate/outputs/:outputID/metadata endpoint.

func GetTransaction

func GetTransaction(c echo.Context) (err error)

GetTransaction is the handler for the /ledgerstate/transactions/:transactionID endpoint.

func GetTransactionAttachments

func GetTransactionAttachments(c echo.Context) (err error)

GetTransactionAttachments is the handler for the ledgerstate/transactions/:transactionID/attachments endpoint.

func GetTransactionMetadata

func GetTransactionMetadata(c echo.Context) (err error)

GetTransactionMetadata is the handler for the ledgerstate/transactions/:transactionID/metadata endpoint.

func PostAddressUnspentOutputs added in v0.6.0

func PostAddressUnspentOutputs(c echo.Context) error

PostAddressUnspentOutputs is the handler for the /ledgerstate/addresses/unspentOutputs endpoint.

func PostTransaction added in v0.6.0

func PostTransaction(c echo.Context) error

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

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

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

Remove removes all outputs associated to the given transaction ID.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL