pseudosettle

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: May 25, 2022 License: BSD-3-Clause 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 added in v1.3.0

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

func (*Service) Address added in v1.2.0

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

func (*Service) AvailableBalance added in v1.2.0

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

AvailableBalance Get actual available balance

func (*Service) Balance added in v1.2.0

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

Balance Get chain balance

func (*Service) CashCheque added in v1.2.0

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

func (*Service) GetPeerBalance added in v1.2.0

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

func (*Service) GetUnPaidBalance added in v1.2.0

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

func (*Service) Init added in v1.2.0

func (s *Service) Init() error

func (*Service) LastReceivedCheque added in v1.2.0

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

func (*Service) LastSentCheque added in v1.2.0

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

func (*Service) Metrics

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

func (*Service) Pay

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

Pay initiates a payment to the given peer

func (*Service) PutRetrieveTraffic added in v1.2.0

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

func (*Service) PutTransferTraffic added in v1.2.0

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

func (*Service) RetrieveTraffic added in v1.2.0

func (s *Service) RetrieveTraffic(peer 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 added in v1.2.0

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

func (*Service) TrafficInfo added in v1.2.0

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

func (*Service) TrafficInit added in v1.2.0

func (s *Service) TrafficInit() error

func (*Service) TransferTraffic added in v1.2.0

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

func (*Service) UpdatePeerBalance added in v1.2.0

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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