powergate: github.com/textileio/powergate/reputation Index | Files | Directories

package reputation

import "github.com/textileio/powergate/reputation"

Index

Package Files

reputation.go

type MinerScore Uses

type MinerScore struct {
    Addr  string
    Score int
}

MinerScore contains a score for a miner.

type Module Uses

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

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

func New Uses

func New(ds datastore.TxnDatastore, mi miner.Module, fi faults.Module, ai ask.Module) *Module

New returns a new reputation Module.

func (*Module) AddSource Uses

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 Uses

func (rm *Module) Close() error

Close closes the reputation Module.

func (*Module) GetTopMiners Uses

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

GetTopMiners gets the top n miners with best score.

func (*Module) QueryMiners Uses

func (rm *Module) QueryMiners(excludedMiners []string, countryCodes []string, trustedMiners []string) ([]MinerScore, error)

QueryMiners makes a filtered query on the scored-sorted miner list. Empty filter slices represent no-filters applied.

Directories

PathSynopsis
internal/source
rpc

Package reputation imports 13 packages (graph) and is imported by 14 packages. Updated 2020-09-21. Refresh now. Tools for package owners.