server

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package server implements a gRPC server following protobuf description of the proof service in gnarkd/pb.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	pb.UnimplementedGroth16Server
	// contains filtered or unexported fields
}

Server implements Groth16Server

func NewServer

func NewServer(ctx context.Context, log *zap.SugaredLogger, circuitDir string) (*Server, error)

NewServer returns a server implementing the service as defined in pb/gnarkd.proto

func (*Server) CancelProveJob

func (s *Server) CancelProveJob(ctx context.Context, request *pb.CancelProveJobRequest) (*pb.CancelProveJobResponse, error)

CancelProveJob does what it says it does.

func (*Server) CreateProveJob

func (s *Server) CreateProveJob(ctx context.Context, request *pb.CreateProveJobRequest) (*pb.CreateProveJobResponse, error)

CreateProveJob enqueue a job into the job queue with WAITING_WITNESS status

func (*Server) ListProveJob

func (s *Server) ListProveJob(ctx context.Context, request *pb.ListProveJobRequest) (*pb.ListProveJobResponse, error)

ListProveJob does what it says it does

func (*Server) Prove

func (s *Server) Prove(ctx context.Context, request *pb.ProveRequest) (*pb.ProveResult, error)

Prove takes circuitID and witness as parameter this is a synchronous call and bypasses the job queue it is meant to be used for small circuits, for larger circuits (proving time) and witnesses, use CreateProveJob instead

func (*Server) StartWitnessListener

func (s *Server) StartWitnessListener(l net.Listener)

StartWitnessListener listen on given socket for incoming connection and read and try to interpret stream of bytes as a circuit witness

func (*Server) SubscribeToProveJob

func (s *Server) SubscribeToProveJob(request *pb.SubscribeToProveJobRequest, stream pb.Groth16_SubscribeToProveJobServer) error

SubscribeToProveJob enables a client to get job status changes from the Server at connection start, Server sends current job status when job is done (ok or errored), Server closes connection

func (*Server) Verify

func (s *Server) Verify(ctx context.Context, request *pb.VerifyRequest) (*pb.VerifyResult, error)

Verify takes circuitID, proof and public witness as parameter this is a synchronous call

Jump to

Keyboard shortcuts

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