reputation

package
v0.0.0-...-be0f657 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MinerScore

type MinerScore struct {
	Addr  string
	Score int
}

MinerScore contains a score for a miner

type Module

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

Module consolidates different sources of information to create a reputation rank of FC miners

func New

func New(ds datastore.TxnDatastore, mi *miner.MinerIndex, si *slashing.SlashingIndex, ai *ask.AskIndex) *Module

New returns a new reputation Module

func (*Module) AddSource

func (rm *Module) AddSource(id string, maddr ma.Multiaddr) error

AddSource adds a new external Source to be considered for reputation generation

func (*Module) Close

func (rm *Module) Close() error

Close closes the reputation Module

func (*Module) GetTopMiners

func (rm *Module) GetTopMiners(n int) ([]MinerScore, error)

GetTopMiners gets the top n miners with best score

type Service

type Service struct {
	pb.UnimplementedAPIServer
	// contains filtered or unexported fields
}

Service implements the gprc service

func NewService

func NewService(m *Module) *Service

NewService is a helper to create a new Service

func (*Service) AddSource

func (s *Service) AddSource(ctx context.Context, req *pb.AddSourceRequest) (*pb.AddSourceReply, error)

AddSource calls Module.AddSource

func (*Service) GetTopMiners

func (s *Service) GetTopMiners(ctx context.Context, req *pb.GetTopMinersRequest) (*pb.GetTopMinersReply, error)

GetTopMiners calls Module.GetTopMiners

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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