pseudosettle

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

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, address common.Address) *Service

func (*Service) API

func (s *Service) API() rpc.API

func (*Service) Address

func (s *Service) Address() common.Address

func (*Service) AvailableBalance

func (s *Service) AvailableBalance() (*big.Int, error)

AvailableBalance Get actual available balance

func (*Service) Balance

func (s *Service) Balance() (*big.Int, error)

Balance Get chain balance

func (*Service) CashCheque

func (s *Service) CashCheque(_ context.Context, _ boson.Address) (common.Hash, error)

func (*Service) GetPeerBalance

func (s *Service) GetPeerBalance(_ boson.Address) (*big.Int, error)

func (*Service) GetUnPaidBalance

func (s *Service) GetUnPaidBalance(_ boson.Address) (*big.Int, error)

func (*Service) Init

func (s *Service) Init() error

func (*Service) LastReceivedCheque

func (s *Service) LastReceivedCheque(_ boson.Address) (*chequePkg.SignedCheque, error)

func (*Service) LastSentCheque

func (s *Service) LastSentCheque(_ boson.Address) (*chequePkg.Cheque, error)

func (*Service) Metrics

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

func (*Service) Pay

func (s *Service) Pay(_ context.Context, peer boson.Address, paymentThreshold *big.Int) error

Pay initiates a payment to the given peer

func (*Service) PutRetrieveTraffic

func (s *Service) PutRetrieveTraffic(peer boson.Address, traffic *big.Int) error

func (*Service) PutTransferTraffic

func (s *Service) PutTransferTraffic(peer boson.Address, traffic *big.Int) error

func (*Service) RetrieveTraffic

func (s *Service) RetrieveTraffic(_ boson.Address) (traffic *big.Int, err error)

func (*Service) SetNotifyPaymentFunc

func (s *Service) SetNotifyPaymentFunc(notifyPaymentFunc settlement.NotifyPaymentFunc)

SetNotifyPaymentFunc sets the NotifyPaymentFunc to notify

func (*Service) SettlementsReceived

func (s *Service) SettlementsReceived() (map[string]*big.Int, error)

SettlementsReceived returns all stored received settlement values for a given type of prefix

func (*Service) SettlementsSent

func (s *Service) SettlementsSent() (map[string]*big.Int, error)

SettlementsSent returns all stored sent settlement values for a given type of prefix

func (*Service) TotalReceived

func (s *Service) TotalReceived(peer boson.Address) (totalReceived *big.Int, err error)

TotalReceived returns the total amount received from a peer

func (*Service) TotalSent

func (s *Service) TotalSent(peer boson.Address) (totalSent *big.Int, err error)

TotalSent returns the total amount sent to a peer

func (*Service) TrafficCheques

func (s *Service) TrafficCheques() ([]*traffic.TrafficCheque, error)

func (*Service) TrafficInfo

func (s *Service) TrafficInfo() (*traffic.TrafficInfo, error)

func (*Service) TrafficInit

func (s *Service) TrafficInit() error

func (*Service) TransferTraffic

func (s *Service) TransferTraffic(_ boson.Address) (traffic *big.Int, err error)

func (*Service) UpdatePeerBalance

func (s *Service) UpdatePeerBalance(_ boson.Address) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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