Documentation ¶
Index ¶
- func ValidateExecutions(job model.Job, executions []model.ExecutionState) error
- type DecrypterFunction
- type Encrypter
- type EncrypterFunction
- type ErrInsufficientExecutions
- type ErrInvalidExecutionState
- type ErrMismatchingExecution
- type ErrMissingVerificationProposal
- type Verifier
- type VerifierProvider
- type VerifierResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateExecutions ¶
func ValidateExecutions(job model.Job, executions []model.ExecutionState) error
Types ¶
type DecrypterFunction ¶
type Encrypter ¶
type Encrypter struct {
// contains filtered or unexported fields
}
func NewEncrypter ¶
type EncrypterFunction ¶
type ErrInsufficientExecutions ¶
ErrInsufficientExecutions is returned when the number of executions is less than the minimum required
func NewErrInsufficientExecutions ¶
func NewErrInsufficientExecutions(id string, minCount, submittedCount int) ErrInsufficientExecutions
func (ErrInsufficientExecutions) Error ¶
func (e ErrInsufficientExecutions) Error() string
type ErrInvalidExecutionState ¶
type ErrInvalidExecutionState struct { ExecutionID model.ExecutionID State model.ExecutionStateType }
ErrInvalidExecutionState is returned when the execution state is not valid for verification
func NewErrInvalidExecutionState ¶
func NewErrInvalidExecutionState(id model.ExecutionID, state model.ExecutionStateType) ErrInvalidExecutionState
func (ErrInvalidExecutionState) Error ¶
func (e ErrInvalidExecutionState) Error() string
type ErrMismatchingExecution ¶
type ErrMismatchingExecution struct { JobID string ExecutionID model.ExecutionID }
ErrMismatchingExecution is returned when the execution does not match the job
func NewErrMismatchingExecution ¶
func NewErrMismatchingExecution(jobID string, executionID model.ExecutionID) ErrMismatchingExecution
func (ErrMismatchingExecution) Error ¶
func (e ErrMismatchingExecution) Error() string
type ErrMissingVerificationProposal ¶
type ErrMissingVerificationProposal struct {
ExecutionID model.ExecutionID
}
ErrMissingVerificationProposal is returned when the verification proposal is missing
func NewErrMissingVerificationProposal ¶
func NewErrMissingVerificationProposal(id model.ExecutionID) ErrMissingVerificationProposal
func (ErrMissingVerificationProposal) Error ¶
func (e ErrMissingVerificationProposal) Error() string
type Verifier ¶
type Verifier interface { model.Providable // compute node // // return the local file path where the output of a local execution // should live - this is called by the executor to prepare // output volumes when running a job and the publisher when uploading // the results after verification GetResultPath( ctx context.Context, executionID string, job model.Job, ) (string, error) // compute node // // the executor has completed the job and produced a local folder of results // the verifier will now "process" this local folder into the result // that will be broadcast back to the network // For example - the "resultsHash" verifier will hash the folder // and encrypt that hash with the public key of the requester GetProposal( ctx context.Context, job model.Job, resultPath string, ) ([]byte, error) // requester node // // once we've decided that a job is complete - we verify the results reported // by the compute nodes - what this actually does is up to the verifier but // it's highly likely that a verifier implementation has a controller attached // and so can trigger state transitions (such as results accepted / rejected) // // IsJobComplete must return true otherwise this function will error Verify( ctx context.Context, job model.Job, executions []model.ExecutionState, ) ([]VerifierResult, error) }
Verifier is an interface representing something that can verify the results of a job.
type VerifierProvider ¶
Returns a verifier that can be used to verify a job.
type VerifierResult ¶
type VerifierResult struct { Execution model.ExecutionState Verified bool }
Click to show internal directories.
Click to hide internal directories.