intermediate

package
v0.0.0-...-79ba347 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyNetMap = errors.New("empty NepMap")
View Source
var ErrIncorrectContextPanicMsg = "could not write intermediate trust: passed context incorrect"

Functions

This section is empty.

Types

type ConsumerStorageWriterProvider

type ConsumerStorageWriterProvider struct {
	Log     *logger.Logger
	Storage *consumerstorage.Storage
}

ConsumerStorageWriterProvider is an implementation of the reputation.WriterProvider interface that provides ConsumerTrustWriter writer.

func (*ConsumerStorageWriterProvider) InitWriter

type ConsumerTrustWriter

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

ConsumerTrustWriter is an implementation of the reputation.Writer interface that writes passed consumer's Trust values to the Consumer storage. After writing that, values can be used in eigenTrust algorithm's iterations.

func (*ConsumerTrustWriter) Close

func (w *ConsumerTrustWriter) Close() error

func (*ConsumerTrustWriter) Write

type DaughterStorageWriterProvider

type DaughterStorageWriterProvider struct {
	Log     *logger.Logger
	Storage *daughters.Storage
}

DaughterStorageWriterProvider is an implementation of the reputation.WriterProvider interface that provides DaughterTrustWriter writer.

func (*DaughterStorageWriterProvider) InitWriter

type DaughterTrustIteratorProvider

type DaughterTrustIteratorProvider struct {
	DaughterStorage *daughters.Storage
	ConsumerStorage *consumerstorage.Storage
}

DaughterTrustIteratorProvider is an implementation of the reputation/eigentrust/calculator's DaughterTrustIteratorProvider interface.

func (*DaughterTrustIteratorProvider) InitAllDaughtersIterator

InitAllDaughtersIterator returns an iterator over all daughters of the current node(manager) and all local trusts received from them for ctx.Epoch() epoch.

func (*DaughterTrustIteratorProvider) InitConsumersIterator

InitConsumersIterator returns an iterator over all daughters of the current node(manager) and all their consumers' local trusts for ctx.Epoch() epoch and ctx.I() iteration.

func (*DaughterTrustIteratorProvider) InitDaughterIterator

InitDaughterIterator returns an iterator over the received local trusts for ctx.Epoch() epoch from daughter p.

type DaughterTrustWriter

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

DaughterTrustWriter is an implementation of the reputation.Writer interface that writes passed daughter's Trust values to Daughter storage. After writing that, values can be used in eigenTrust algorithm's iterations.

func (*DaughterTrustWriter) Close

func (w *DaughterTrustWriter) Close() error

func (*DaughterTrustWriter) Write

type DaughtersTrustCalculator

type DaughtersTrustCalculator struct {
	Calculator *eigencalc.Calculator
}

DaughtersTrustCalculator wraps EigenTrust calculator and implements the eigentrust/calculator's DaughtersTrustCalculator interface.

func (*DaughtersTrustCalculator) Calculate

Calculate converts and passes values to the wrapped calculator.

type FinalWriter

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

FinalWriter is an implementation of the reputation.eigentrust.calculator IntermediateWriter interface that writes GlobalTrust to contract directly.

func (FinalWriter) WriteIntermediateTrust

func (fw FinalWriter) WriteIntermediateTrust(t eigentrust.IterationTrust) error

type FinalWriterOption

type FinalWriterOption func(*finalWriterOptions)

func FinalWriterWithLogger

func FinalWriterWithLogger(l *logger.Logger) FinalWriterOption

type FinalWriterProvider

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

FinalWriterProvider is an implementation of the reputation.eigentrust.calculator IntermediateWriterProvider interface. It inits FinalWriter.

func NewFinalWriterProvider

func NewFinalWriterProvider(prm FinalWriterProviderPrm, opts ...FinalWriterOption) *FinalWriterProvider

NewFinalWriterProvider creates a new instance of the FinalWriterProvider.

Panics if at least one value of the parameters is invalid.

The created FinalWriterProvider does not require additional initialization and is completely ready for work.

func (FinalWriterProvider) InitIntermediateWriter

type FinalWriterProviderPrm

type FinalWriterProviderPrm struct {
	PrivatKey *ecdsa.PrivateKey
	PubKey    []byte
	Client    *repClient.Client
}

FinalWriterProviderPrm groups the required parameters of the FinalWriterProvider's constructor.

All values must comply with the requirements imposed on them. Passing incorrect parameter values will result in constructor failure (error or panic depending on the implementation).

type InitialTrustSource

type InitialTrustSource struct {
	NetMap netmap.Source
}

InitialTrustSource is an implementation of the reputation/eigentrust/calculator's InitialTrustSource interface.

func (InitialTrustSource) InitialTrust

InitialTrust returns `initialTrust` as an initial trust value.

type RemoteProvider

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

RemoteProvider is an implementation of the clientKeyRemoteProvider interface.

func NewRemoteProvider

func NewRemoteProvider(prm RemoteProviderPrm) *RemoteProvider

NewRemoteProvider creates a new instance of the RemoteProvider.

Panics if at least one value of the parameters is invalid.

The created RemoteProvider does not require additional initialization and is completely ready for work.

func (RemoteProvider) WithClient

type RemoteProviderPrm

type RemoteProviderPrm struct {
	Key *ecdsa.PrivateKey
	Log *logger.Logger
}

RemoteProviderPrm groups the required parameters of the RemoteProvider's constructor.

All values must comply with the requirements imposed on them. Passing incorrect parameter values will result in constructor failure (error or panic depending on the implementation).

type RemoteTrustWriter

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

func (*RemoteTrustWriter) Close

func (rtp *RemoteTrustWriter) Close() error

func (*RemoteTrustWriter) Write

func (rtp *RemoteTrustWriter) Write(t reputation.Trust) error

Write sends a trust value to a remote node via ReputationService.AnnounceIntermediateResult RPC.

type TrustWriterProvider

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

func (*TrustWriterProvider) InitWriter

Jump to

Keyboard shortcuts

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