settlement

package
v1.18.1 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: BSD-3-Clause Imports: 3 Imported by: 2 modules, 4 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

This section is empty.

Variables

View Source
var (
	ErrPeerNoSettlements = errors.New("no settlements for peer")
)

Functions

This section is empty.

Types

type Accounting added in v0.6.0

type Accounting interface {
	PeerDebt(peer swarm.Address) (*big.Int, error)
	NotifyPaymentReceived(peer swarm.Address, amount *big.Int) error
	NotifyPaymentSent(peer swarm.Address, amount *big.Int, receivedError error)
	NotifyRefreshmentReceived(peer swarm.Address, amount *big.Int, timestamp int64) error
	NotifyRefreshmentSent(peer swarm.Address, attemptedAmount, amount *big.Int, timestamp, interval int64, receivedError error)
	Connect(peer swarm.Address, fullNode bool)
	Disconnect(peer swarm.Address)
}

type Interface

type Interface interface {
	// TotalSent returns the total amount sent to a peer
	TotalSent(peer swarm.Address) (totalSent *big.Int, err error)
	// TotalReceived returns the total amount received from a peer
	TotalReceived(peer swarm.Address) (totalSent *big.Int, err error)
	// SettlementsSent returns sent settlements for each individual known peer
	SettlementsSent() (map[string]*big.Int, error)
	// SettlementsReceived returns received settlements for each individual known peer
	SettlementsReceived() (map[string]*big.Int, error)
}

Interface is the interface used by Accounting to trigger settlement

Directories

Path Synopsis
Package pseudosettle implements a pretend settlement protocol where nodes send pretend payment messages consisting only of the payment amount.
Package pseudosettle implements a pretend settlement protocol where nodes send pretend payment messages consisting only of the payment amount.
pb

Jump to

Keyboard shortcuts

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