prover

package
v0.0.3-RC10 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2023 License: GPL-3.0 Imports: 9 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, addr net.Addr, proofStatePollingInterval types.Duration) (*Prover, error)

New returns a new Prover instance.

func (*Prover) Addr

func (p *Prover) Addr() string

Addr returns the prover IP address.

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, aggregatorAddr 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, error)

IsIdle returns true if the prover is idling.

func (*Prover) Name

func (p *Prover) Name() string

Name returns the Prover name.

func (*Prover) Status

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

Status gets the prover status.

func (*Prover) SupportsForkID

func (p *Prover) SupportsForkID(forkID uint64) bool

SupportsForkID returns true if the prover supports the given fork id.

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