package
1.8.22
Repository: https://github.com/stefanhans/go-ethereum.git
Documentation: pkg.go.dev

# Functions

No description provided by the author
NewAccountingApi creates a new AccountingApi m will be used to check if accounting metrics are enabled.
NewMetricsDB creates a new LevelDB instance used to persist metrics definedinside p2p/protocols/accounting.go.
NewPeer constructs a new peer this constructor is called by the p2p.Protocol#Run function the first two arguments are the arguments passed to p2p.Protocol.Run function the third argument is the Spec describing the protocol.
SetupAccountingMetrics creates a separate registry for p2p accounting metrics; this registry should be independent of any other metrics as it persists at different endpoints.

# Constants

Textual version number of accounting API.
error codes used by this protocol scheme.
error codes used by this protocol scheme.
error codes used by this protocol scheme.
error codes used by this protocol scheme.
error codes used by this protocol scheme.
error codes used by this protocol scheme.
error codes used by this protocol scheme.
error codes used by this protocol scheme.
No description provided by the author
No description provided by the author

# Variables

define some metrics.

# Structs

Accounting implements the Hook interface It interfaces to the balances through the Balance interface, while interfacing with protocols and its prices through the Prices interface.
AccountingApi provides an API to access account related information.
AccountMetrics abstracts away the metrics DB andthe reporter to persist metrics.
Error implements the standard go error interface.
Peer represents a remote peer or protocol instance that is running on a peer connection with a remote peer.
Price represents the costs of a message.
Spec is a protocol specification including its name and version as well as the types of messages which are exchanged.
WrappedMsg is used to propagate marshalled context alongside message payloads.

# Interfaces

Balance is the actual accounting instance Balance defines the operations needed for accounting Implementations internally maintain the balance for every peer.
For accounting, the design is to allow the Spec to describe which and how its messages are pricedTo access this functionality, we provide a Hook interface which will call accounting methodsNOTE: there could be more such (horizontal) hooks in the future.
Prices defines how prices are being passed on to the accounting instance.

# Type aliases

No description provided by the author