pseudosettle

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2020 License: BSD-3-Clause Imports: 14 Imported by: 2 modules, 2 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

Overview

Package pseudosettle implements a pretend settlement protocol where nodes send pretend payment messages consisting only of the payment amount. Its purpose is to be able to have the full payment / disconnect treshold machinery in place without having to send cheques or real values.

Index

Constants

This section is empty.

Variables

View Source
var (
	SettlementReceivedPrefix = "pseudosettle_total_received_"
	SettlementSentPrefix     = "pseudosettle_total_sent_"
)

Functions

This section is empty.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(streamer p2p.Streamer, logger logging.Logger, store storage.StateStorer) *Service

func (*Service) Metrics

func (s *Service) Metrics() []prometheus.Collector

func (*Service) Pay

func (s *Service) Pay(ctx context.Context, peer swarm.Address, amount uint64) error

Pay initiates a payment to the given peer

func (*Service) Protocol

func (s *Service) Protocol() p2p.ProtocolSpec

func (*Service) SetPaymentObserver

func (s *Service) SetPaymentObserver(observer settlement.PaymentObserver)

SetPaymentObserver sets the payment observer which will be notified of incoming payments

func (*Service) SettlementsReceived added in v0.3.0

func (s *Service) SettlementsReceived() (map[string]uint64, error)

func (*Service) SettlementsSent added in v0.3.0

func (s *Service) SettlementsSent() (map[string]uint64, error)

AllSettlements returns all stored settlement values for a given type of prefix (sent or received)

func (*Service) TotalReceived added in v0.3.0

func (s *Service) TotalReceived(peer swarm.Address) (totalReceived uint64, err error)

TotalReceived returns the total amount received from a peer

func (*Service) TotalSent added in v0.3.0

func (s *Service) TotalSent(peer swarm.Address) (totalSent uint64, err error)

TotalSent returns the total amount sent to a peer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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