prover

package
v0.0.1-RC2 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: GPL-3.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBadProverResponse    = errors.New("Prover returned wrong type for response")  //nolint:revive
	ErrProverInternalError  = errors.New("Prover returned INTERNAL_ERROR response")  //nolint:revive
	ErrProverCompletedError = errors.New("Prover returned COMPLETED_ERROR response") //nolint:revive
	ErrBadRequest           = errors.New("Prover returned ERROR for a bad request")  //nolint:revive
	ErrUnspecified          = errors.New("Prover returned an UNSPECIFIED response")  //nolint:revive
	ErrUnknown              = errors.New("Prover returned an unknown response")      //nolint:revive
	ErrProofCanceled        = errors.New("Proof has been canceled")                  //nolint:revive
)

Functions

This section is empty.

Types

type Prover

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

Prover abstraction of the grpc prover client.

func New

func New(stream pb.AggregatorService_ChannelServer, intervalFrequencyToGetProofGenerationState types.Duration) (*Prover, error)

New returns a new Prover instance.

func (*Prover) AggregatedProof

func (p *Prover) AggregatedProof(inputProof1, inputProof2 string) (*string, error)

AggregatedProof instructs the prover to generate an aggregated proof from the two inputs provided. It returns the ID of the proof being computed.

func (*Prover) BatchProof

func (p *Prover) BatchProof(input *pb.InputProver) (*string, error)

BatchProof instructs the prover to generate a batch proof for the provided input. It returns the ID of the proof being computed.

func (*Prover) CancelProofRequest

func (p *Prover) CancelProofRequest(proofID string) error

CancelProofRequest asks the prover to stop the generation of the proof matching the provided proofID.

func (*Prover) FinalProof

func (p *Prover) FinalProof(inputProof string) (*string, error)

FinalProof instructs the prover to generate a final proof for the given input. It returns the ID of the proof being computed.

func (*Prover) ID

func (p *Prover) ID() string

ID returns the Prover ID.

func (*Prover) IsIdle

func (p *Prover) IsIdle() bool

IsIdle returns true if the prover is idling.

func (*Prover) Status

func (p *Prover) Status() (*pb.GetStatusResponse, error)

Status gets the prover status.

func (*Prover) WaitFinalProof

func (p *Prover) WaitFinalProof(ctx context.Context, proofID string) (*pb.FinalProof, error)

WaitFinalProof waits for the final proof to be generated by the prover and returns it.

func (*Prover) WaitRecursiveProof

func (p *Prover) WaitRecursiveProof(ctx context.Context, proofID string) (string, error)

WaitRecursiveProof waits for a recursive proof to be generated by the prover and returns it.

Jump to

Keyboard shortcuts

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