# Functions
No description provided by the author
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.
# Constants
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
# Structs
Accounting implements the Hook interfaceIt interfaces to the balances through the Balance interface,while interfacing with protocols and its prices through the Prices interface.
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 instanceBalance defines the operations needed for accountingImplementations 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