serverworker

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2019 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Overview

Package serverworker gives additional functionalities to regular CoconutWorker that are required by a server instance.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ID         uint64
	Params     *coconut.Params
	JobQueue   chan<- *jobpacket.JobPacket
	IncomingCh <-chan *commands.CommandRequest
	Log        *logger.Logger
	NymClient  *nymclient.Client
	Store      *storage.Database
}

Config encapsulates arguments passed in New to create new instance of the serverworker.

type IssuerWorker

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

type ServerWorker

type ServerWorker struct {
	worker.Worker
	IssuerWorker
	VerificationWorker

	*coconutworker.CoconutWorker // TODO: since CoconutWorker does not have many attributes should we still use reference?
	// contains filtered or unexported fields
}

TODO: perhaps rename considering it is used by issuers and providers (servers) and the verifiers (not entirely a server)? ServerWorker allows writing coconut actions to a shared job queue, so that they could be run concurrently.

func New

func New(cfg *Config) (*ServerWorker, error)

New creates new instance of a serverWorker.

func (*ServerWorker) RegisterAsFaucet

func (sw *ServerWorker) RegisterAsFaucet(privateKey *ecdsa.PrivateKey,
	nodeAddress string,
	nymContract ethcommon.Address,
	pipeContract ethcommon.Address,
	etherAmount float64,
	logger *logger.Logger,
) error

really nasty workaround that will be removed later on.

func (*ServerWorker) RegisterAsIssuer

Issuing authority functionality

func (*ServerWorker) RegisterAsProvider

func (sw *ServerWorker) RegisterAsProvider(avk *coconut.VerificationKey,
	privateKey *ecdsa.PrivateKey,
	disableVerification bool,
) error

Service provider functionality

func (*ServerWorker) RegisterAsVerifier

func (sw *ServerWorker) RegisterAsVerifier(avk *coconut.VerificationKey, privateKey *ecdsa.PrivateKey) error

Verifier functionality (monitors chain and checks credentials)

func (*ServerWorker) RegisterHandler

func (sw *ServerWorker) RegisterHandler(o interface{},
	hfn commandhandler.HandlerFunc,
	dfn func(commands.Command) commandhandler.HandlerData)

func (*ServerWorker) WithEcdsaKey

func (sw *ServerWorker) WithEcdsaKey(key *ecdsa.PrivateKey)

type VerificationWorker

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

Directories

Path Synopsis
Package commandhandler contains functions that are used to resolve commands issued to issuers and providers.
Package commandhandler contains functions that are used to resolve commands issued to issuers and providers.

Jump to

Keyboard shortcuts

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