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 ¶
- Variables
- type Service
- func (s *Service) Metrics() []prometheus.Collector
- func (s *Service) Pay(ctx context.Context, peer swarm.Address, amount uint64) error
- func (s *Service) Protocol() p2p.ProtocolSpec
- func (s *Service) SetNotifyPaymentFunc(notifyPaymentFunc settlement.NotifyPaymentFunc)
- func (s *Service) SettlementsReceived() (map[string]uint64, error)
- func (s *Service) SettlementsSent() (map[string]uint64, error)
- func (s *Service) TotalReceived(peer swarm.Address) (totalReceived uint64, err error)
- func (s *Service) TotalSent(peer swarm.Address) (totalSent uint64, err error)
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 (*Service) Metrics ¶
func (s *Service) Metrics() []prometheus.Collector
func (*Service) Protocol ¶
func (s *Service) Protocol() p2p.ProtocolSpec
func (*Service) SetNotifyPaymentFunc ¶ added in v0.4.0
func (s *Service) SetNotifyPaymentFunc(notifyPaymentFunc settlement.NotifyPaymentFunc)
SetNotifyPaymentFunc sets the NotifyPaymentFunc to notify
func (*Service) SettlementsReceived ¶ added in v0.3.0
func (*Service) SettlementsSent ¶ added in v0.3.0
AllSettlements returns all stored settlement values for a given type of prefix (sent or received)
func (*Service) TotalReceived ¶ added in v0.3.0
TotalReceived returns the total amount received from a peer
Click to show internal directories.
Click to hide internal directories.