// Code generated by protoc-gen-go. DO NOT EDIT.
// source: services.proto

package services

import (
	context "context"
	fmt "fmt"
	proto "github.com/golang/protobuf/proto"
	grpc "google.golang.org/grpc"
	math "math"
)

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package

type EmptyMsg struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *EmptyMsg) Reset()         { *m = EmptyMsg{} }
func (m *EmptyMsg) String() string { return proto.CompactTextString(m) }
func (*EmptyMsg) ProtoMessage()    {}
func (*EmptyMsg) Descriptor() ([]byte, []int) {
	return fileDescriptor_8e16ccb8c5307b32, []int{0}
}

func (m *EmptyMsg) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_EmptyMsg.Unmarshal(m, b)
}
func (m *EmptyMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_EmptyMsg.Marshal(b, m, deterministic)
}
func (m *EmptyMsg) XXX_Merge(src proto.Message) {
	xxx_messageInfo_EmptyMsg.Merge(m, src)
}
func (m *EmptyMsg) XXX_Size() int {
	return xxx_messageInfo_EmptyMsg.Size(m)
}
func (m *EmptyMsg) XXX_DiscardUnknown() {
	xxx_messageInfo_EmptyMsg.DiscardUnknown(m)
}

var xxx_messageInfo_EmptyMsg proto.InternalMessageInfo

type AckMsg struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *AckMsg) Reset()         { *m = AckMsg{} }
func (m *AckMsg) String() string { return proto.CompactTextString(m) }
func (*AckMsg) ProtoMessage()    {}
func (*AckMsg) Descriptor() ([]byte, []int) {
	return fileDescriptor_8e16ccb8c5307b32, []int{1}
}

func (m *AckMsg) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_AckMsg.Unmarshal(m, b)
}
func (m *AckMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_AckMsg.Marshal(b, m, deterministic)
}
func (m *AckMsg) XXX_Merge(src proto.Message) {
	xxx_messageInfo_AckMsg.Merge(m, src)
}
func (m *AckMsg) XXX_Size() int {
	return xxx_messageInfo_AckMsg.Size(m)
}
func (m *AckMsg) XXX_DiscardUnknown() {
	xxx_messageInfo_AckMsg.DiscardUnknown(m)
}

var xxx_messageInfo_AckMsg proto.InternalMessageInfo

type Cmt1Msg struct {
	Index                int32    `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
	Polycmt              []byte   `protobuf:"bytes,2,opt,name=polycmt,proto3" json:"polycmt,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *Cmt1Msg) Reset()         { *m = Cmt1Msg{} }
func (m *Cmt1Msg) String() string { return proto.CompactTextString(m) }
func (*Cmt1Msg) ProtoMessage()    {}
func (*Cmt1Msg) Descriptor() ([]byte, []int) {
	return fileDescriptor_8e16ccb8c5307b32, []int{2}
}

func (m *Cmt1Msg) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_Cmt1Msg.Unmarshal(m, b)
}
func (m *Cmt1Msg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_Cmt1Msg.Marshal(b, m, deterministic)
}
func (m *Cmt1Msg) XXX_Merge(src proto.Message) {
	xxx_messageInfo_Cmt1Msg.Merge(m, src)
}
func (m *Cmt1Msg) XXX_Size() int {
	return xxx_messageInfo_Cmt1Msg.Size(m)
}
func (m *Cmt1Msg) XXX_DiscardUnknown() {
	xxx_messageInfo_Cmt1Msg.DiscardUnknown(m)
}

var xxx_messageInfo_Cmt1Msg proto.InternalMessageInfo

func (m *Cmt1Msg) GetIndex() int32 {
	if m != nil {
		return m.Index
	}
	return 0
}

func (m *Cmt1Msg) GetPolycmt() []byte {
	if m != nil {
		return m.Polycmt
	}
	return nil
}

type Cmt2Msg struct {
	Index                int32    `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
	Sharecmt             []byte   `protobuf:"bytes,2,opt,name=sharecmt,proto3" json:"sharecmt,omitempty"`
	Polycmt              []byte   `protobuf:"bytes,3,opt,name=polycmt,proto3" json:"polycmt,omitempty"`
	Zerowitness          []byte   `protobuf:"bytes,4,opt,name=zerowitness,proto3" json:"zerowitness,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *Cmt2Msg) Reset()         { *m = Cmt2Msg{} }
func (m *Cmt2Msg) String() string { return proto.CompactTextString(m) }
func (*Cmt2Msg) ProtoMessage()    {}
func (*Cmt2Msg) Descriptor() ([]byte, []int) {
	return fileDescriptor_8e16ccb8c5307b32, []int{3}
}

func (m *Cmt2Msg) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_Cmt2Msg.Unmarshal(m, b)
}
func (m *Cmt2Msg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_Cmt2Msg.Marshal(b, m, deterministic)
}
func (m *Cmt2Msg) XXX_Merge(src proto.Message) {
	xxx_messageInfo_Cmt2Msg.Merge(m, src)
}
func (m *Cmt2Msg) XXX_Size() int {
	return xxx_messageInfo_Cmt2Msg.Size(m)
}
func (m *Cmt2Msg) XXX_DiscardUnknown() {
	xxx_messageInfo_Cmt2Msg.DiscardUnknown(m)
}

var xxx_messageInfo_Cmt2Msg proto.InternalMessageInfo

func (m *Cmt2Msg) GetIndex() int32 {
	if m != nil {
		return m.Index
	}
	return 0
}

func (m *Cmt2Msg) GetSharecmt() []byte {
	if m != nil {
		return m.Sharecmt
	}
	return nil
}

func (m *Cmt2Msg) GetPolycmt() []byte {
	if m != nil {
		return m.Polycmt
	}
	return nil
}

func (m *Cmt2Msg) GetZerowitness() []byte {
	if m != nil {
		return m.Zerowitness
	}
	return nil
}

type PointMsg struct {
	Index                int32    `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
	X                    int32    `protobuf:"varint,2,opt,name=x,proto3" json:"x,omitempty"`
	Y                    []byte   `protobuf:"bytes,3,opt,name=y,proto3" json:"y,omitempty"`
	Witness              []byte   `protobuf:"bytes,4,opt,name=witness,proto3" json:"witness,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *PointMsg) Reset()         { *m = PointMsg{} }
func (m *PointMsg) String() string { return proto.CompactTextString(m) }
func (*PointMsg) ProtoMessage()    {}
func (*PointMsg) Descriptor() ([]byte, []int) {
	return fileDescriptor_8e16ccb8c5307b32, []int{4}
}

func (m *PointMsg) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_PointMsg.Unmarshal(m, b)
}
func (m *PointMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_PointMsg.Marshal(b, m, deterministic)
}
func (m *PointMsg) XXX_Merge(src proto.Message) {
	xxx_messageInfo_PointMsg.Merge(m, src)
}
func (m *PointMsg) XXX_Size() int {
	return xxx_messageInfo_PointMsg.Size(m)
}
func (m *PointMsg) XXX_DiscardUnknown() {
	xxx_messageInfo_PointMsg.DiscardUnknown(m)
}

var xxx_messageInfo_PointMsg proto.InternalMessageInfo

func (m *PointMsg) GetIndex() int32 {
	if m != nil {
		return m.Index
	}
	return 0
}

func (m *PointMsg) GetX() int32 {
	if m != nil {
		return m.X
	}
	return 0
}

func (m *PointMsg) GetY() []byte {
	if m != nil {
		return m.Y
	}
	return nil
}

func (m *PointMsg) GetWitness() []byte {
	if m != nil {
		return m.Witness
	}
	return nil
}

type ZeroMsg struct {
	Index                int32    `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
	Share                []byte   `protobuf:"bytes,2,opt,name=share,proto3" json:"share,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *ZeroMsg) Reset()         { *m = ZeroMsg{} }
func (m *ZeroMsg) String() string { return proto.CompactTextString(m) }
func (*ZeroMsg) ProtoMessage()    {}
func (*ZeroMsg) Descriptor() ([]byte, []int) {
	return fileDescriptor_8e16ccb8c5307b32, []int{5}
}

func (m *ZeroMsg) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_ZeroMsg.Unmarshal(m, b)
}
func (m *ZeroMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_ZeroMsg.Marshal(b, m, deterministic)
}
func (m *ZeroMsg) XXX_Merge(src proto.Message) {
	xxx_messageInfo_ZeroMsg.Merge(m, src)
}
func (m *ZeroMsg) XXX_Size() int {
	return xxx_messageInfo_ZeroMsg.Size(m)
}
func (m *ZeroMsg) XXX_DiscardUnknown() {
	xxx_messageInfo_ZeroMsg.DiscardUnknown(m)
}

var xxx_messageInfo_ZeroMsg proto.InternalMessageInfo

func (m *ZeroMsg) GetIndex() int32 {
	if m != nil {
		return m.Index
	}
	return 0
}

func (m *ZeroMsg) GetShare() []byte {
	if m != nil {
		return m.Share
	}
	return nil
}

func init() {
	proto.RegisterType((*EmptyMsg)(nil), "services.EmptyMsg")
	proto.RegisterType((*AckMsg)(nil), "services.AckMsg")
	proto.RegisterType((*Cmt1Msg)(nil), "services.Cmt1Msg")
	proto.RegisterType((*Cmt2Msg)(nil), "services.Cmt2Msg")
	proto.RegisterType((*PointMsg)(nil), "services.PointMsg")
	proto.RegisterType((*ZeroMsg)(nil), "services.ZeroMsg")
}

func init() { proto.RegisterFile("services.proto", fileDescriptor_8e16ccb8c5307b32) }

var fileDescriptor_8e16ccb8c5307b32 = []byte{
	// 380 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0xc1, 0x6f, 0xa2, 0x40,
	0x14, 0xc6, 0xc5, 0x5d, 0x94, 0x3c, 0xcc, 0xc6, 0x9d, 0x78, 0x20, 0x9e, 0x0c, 0x27, 0x4f, 0x66,
	0x1d, 0x34, 0x9b, 0xf6, 0x56, 0x1b, 0x8f, 0x36, 0x06, 0x13, 0x9b, 0xf4, 0x46, 0x61, 0xaa, 0x93,
	0x2a, 0x43, 0x66, 0xa6, 0x55, 0xfa, 0xd7, 0x36, 0xe9, 0x3f, 0xd2, 0x30, 0x82, 0x4a, 0x44, 0xa5,
	0x37, 0xbe, 0x81, 0xef, 0xfd, 0xde, 0xfb, 0xde, 0x04, 0xf8, 0x23, 0x08, 0x7f, 0xa7, 0x3e, 0x11,
	0xbd, 0x88, 0x33, 0xc9, 0x90, 0x91, 0x69, 0x1b, 0xc0, 0x18, 0xaf, 0x23, 0x19, 0x4f, 0xc4, 0xc2,
	0x36, 0xa0, 0x76, 0xe7, 0xbf, 0x26, 0x4f, 0x37, 0x50, 0xbf, 0x5f, 0xcb, 0xfe, 0x44, 0x2c, 0x50,
	0x0b, 0x74, 0x1a, 0x06, 0x64, 0x6b, 0x69, 0x1d, 0xad, 0xab, 0xbb, 0x3b, 0x81, 0x2c, 0xa8, 0x47,
	0x6c, 0x15, 0xfb, 0x6b, 0x69, 0x55, 0x3b, 0x5a, 0xb7, 0xe1, 0x66, 0xd2, 0xde, 0x28, 0x2b, 0x3e,
	0x6f, 0x6d, 0x83, 0x21, 0x96, 0x1e, 0x27, 0x07, 0xef, 0x5e, 0x1f, 0x97, 0xfd, 0x95, 0x2b, 0x8b,
	0x3a, 0x60, 0x7e, 0x10, 0xce, 0x36, 0x54, 0x86, 0x44, 0x08, 0xeb, 0xb7, 0x7a, 0x7b, 0x7c, 0x64,
	0xcf, 0xc1, 0x98, 0x32, 0x1a, 0xca, 0xf3, 0xe4, 0x06, 0x68, 0x5b, 0x85, 0xd4, 0x5d, 0x4d, 0xa9,
	0x38, 0xa5, 0x68, 0x71, 0x42, 0xce, 0xd7, 0xce, 0xa4, 0x3d, 0x84, 0xfa, 0x13, 0xe1, 0xec, 0x7c,
	0xd9, 0x16, 0xe8, 0x6a, 0x80, 0x74, 0x9a, 0x9d, 0xc0, 0x5f, 0x55, 0x68, 0x8d, 0xde, 0x56, 0x2b,
	0x22, 0x69, 0x38, 0x62, 0x1e, 0x0f, 0x66, 0xbb, 0xc8, 0xd1, 0x00, 0x60, 0x26, 0x3d, 0x2e, 0xc7,
	0x11, 0xf3, 0x97, 0x08, 0xf5, 0xf6, 0xab, 0xc9, 0xf6, 0xd0, 0x6e, 0x1e, 0xce, 0xd2, 0x7d, 0x54,
	0xd0, 0x7f, 0x00, 0x97, 0x78, 0xc1, 0x74, 0xe9, 0x09, 0xd2, 0x2f, 0x74, 0xfd, 0x3d, 0x9c, 0xa5,
	0xbb, 0xb3, 0x2b, 0xff, 0x34, 0x34, 0x00, 0xf3, 0x91, 0x53, 0x49, 0x94, 0x13, 0xa3, 0xfc, 0x57,
	0xb8, 0x0c, 0x0e, 0x97, 0xc0, 0xe1, 0x42, 0x9c, 0x83, 0x4e, 0x9b, 0xba, 0x8a, 0x73, 0x7e, 0x30,
	0x1d, 0xfe, 0xac, 0x82, 0xf9, 0xc0, 0x02, 0x92, 0x85, 0x3b, 0x04, 0x53, 0x85, 0x7b, 0x21, 0xa7,
	0x22, 0x7e, 0x62, 0x4b, 0xb6, 0x76, 0x6a, 0xcb, 0xae, 0x54, 0xa1, 0x6d, 0x70, 0x6c, 0xcb, 0x65,
	0x9b, 0xde, 0x98, 0x42, 0xd7, 0x2d, 0x34, 0x55, 0x8f, 0x73, 0xc2, 0xe9, 0xcb, 0x85, 0x84, 0xaf,
	0x36, 0xea, 0x94, 0x6e, 0xf4, 0x14, 0xe9, 0x94, 0x45, 0x3e, 0xd7, 0xd4, 0x2f, 0xc3, 0xf9, 0x0e,
	0x00, 0x00, 0xff, 0xff, 0x0e, 0x16, 0xd4, 0xda, 0x44, 0x04, 0x00, 0x00,
}

// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4

// BulletinBoardServiceClient is the client API for BulletinBoardService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type BulletinBoardServiceClient interface {
	// Start a epoch
	StartEpoch(ctx context.Context, in *EmptyMsg, opts ...grpc.CallOption) (*AckMsg, error)
	// BulletinBoard RPC for recontruction phase
	ReadPhase1(ctx context.Context, in *EmptyMsg, opts ...grpc.CallOption) (BulletinBoardService_ReadPhase1Client, error)
	// BulletinBoard RPC for proactivization phase
	WritePhase2(ctx context.Context, in *Cmt2Msg, opts ...grpc.CallOption) (*AckMsg, error)
	ReadPhase2(ctx context.Context, in *EmptyMsg, opts ...grpc.CallOption) (BulletinBoardService_ReadPhase2Client, error)
	// BulletinBoard RPC for share distribution phase
	WritePhase3(ctx context.Context, in *Cmt1Msg, opts ...grpc.CallOption) (*AckMsg, error)
	ReadPhase3(ctx context.Context, in *EmptyMsg, opts ...grpc.CallOption) (BulletinBoardService_ReadPhase3Client, error)
}

type bulletinBoardServiceClient struct {
	cc *grpc.ClientConn
}

func NewBulletinBoardServiceClient(cc *grpc.ClientConn) BulletinBoardServiceClient {
	return &bulletinBoardServiceClient{cc}
}

func (c *bulletinBoardServiceClient) StartEpoch(ctx context.Context, in *EmptyMsg, opts ...grpc.CallOption) (*AckMsg, error) {
	out := new(AckMsg)
	err := c.cc.Invoke(ctx, "/services.BulletinBoardService/StartEpoch", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *bulletinBoardServiceClient) ReadPhase1(ctx context.Context, in *EmptyMsg, opts ...grpc.CallOption) (BulletinBoardService_ReadPhase1Client, error) {
	stream, err := c.cc.NewStream(ctx, &_BulletinBoardService_serviceDesc.Streams[0], "/services.BulletinBoardService/ReadPhase1", opts...)
	if err != nil {
		return nil, err
	}
	x := &bulletinBoardServiceReadPhase1Client{stream}
	if err := x.ClientStream.SendMsg(in); err != nil {
		return nil, err
	}
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	return x, nil
}

type BulletinBoardService_ReadPhase1Client interface {
	Recv() (*Cmt1Msg, error)
	grpc.ClientStream
}

type bulletinBoardServiceReadPhase1Client struct {
	grpc.ClientStream
}

func (x *bulletinBoardServiceReadPhase1Client) Recv() (*Cmt1Msg, error) {
	m := new(Cmt1Msg)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func (c *bulletinBoardServiceClient) WritePhase2(ctx context.Context, in *Cmt2Msg, opts ...grpc.CallOption) (*AckMsg, error) {
	out := new(AckMsg)
	err := c.cc.Invoke(ctx, "/services.BulletinBoardService/WritePhase2", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *bulletinBoardServiceClient) ReadPhase2(ctx context.Context, in *EmptyMsg, opts ...grpc.CallOption) (BulletinBoardService_ReadPhase2Client, error) {
	stream, err := c.cc.NewStream(ctx, &_BulletinBoardService_serviceDesc.Streams[1], "/services.BulletinBoardService/ReadPhase2", opts...)
	if err != nil {
		return nil, err
	}
	x := &bulletinBoardServiceReadPhase2Client{stream}
	if err := x.ClientStream.SendMsg(in); err != nil {
		return nil, err
	}
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	return x, nil
}

type BulletinBoardService_ReadPhase2Client interface {
	Recv() (*Cmt2Msg, error)
	grpc.ClientStream
}

type bulletinBoardServiceReadPhase2Client struct {
	grpc.ClientStream
}

func (x *bulletinBoardServiceReadPhase2Client) Recv() (*Cmt2Msg, error) {
	m := new(Cmt2Msg)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func (c *bulletinBoardServiceClient) WritePhase3(ctx context.Context, in *Cmt1Msg, opts ...grpc.CallOption) (*AckMsg, error) {
	out := new(AckMsg)
	err := c.cc.Invoke(ctx, "/services.BulletinBoardService/WritePhase3", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *bulletinBoardServiceClient) ReadPhase3(ctx context.Context, in *EmptyMsg, opts ...grpc.CallOption) (BulletinBoardService_ReadPhase3Client, error) {
	stream, err := c.cc.NewStream(ctx, &_BulletinBoardService_serviceDesc.Streams[2], "/services.BulletinBoardService/ReadPhase3", opts...)
	if err != nil {
		return nil, err
	}
	x := &bulletinBoardServiceReadPhase3Client{stream}
	if err := x.ClientStream.SendMsg(in); err != nil {
		return nil, err
	}
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	return x, nil
}

type BulletinBoardService_ReadPhase3Client interface {
	Recv() (*Cmt1Msg, error)
	grpc.ClientStream
}

type bulletinBoardServiceReadPhase3Client struct {
	grpc.ClientStream
}

func (x *bulletinBoardServiceReadPhase3Client) Recv() (*Cmt1Msg, error) {
	m := new(Cmt1Msg)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

// BulletinBoardServiceServer is the server API for BulletinBoardService service.
type BulletinBoardServiceServer interface {
	// Start a epoch
	StartEpoch(context.Context, *EmptyMsg) (*AckMsg, error)
	// BulletinBoard RPC for recontruction phase
	ReadPhase1(*EmptyMsg, BulletinBoardService_ReadPhase1Server) error
	// BulletinBoard RPC for proactivization phase
	WritePhase2(context.Context, *Cmt2Msg) (*AckMsg, error)
	ReadPhase2(*EmptyMsg, BulletinBoardService_ReadPhase2Server) error
	// BulletinBoard RPC for share distribution phase
	WritePhase3(context.Context, *Cmt1Msg) (*AckMsg, error)
	ReadPhase3(*EmptyMsg, BulletinBoardService_ReadPhase3Server) error
}

func RegisterBulletinBoardServiceServer(s *grpc.Server, srv BulletinBoardServiceServer) {
	s.RegisterService(&_BulletinBoardService_serviceDesc, srv)
}

func _BulletinBoardService_StartEpoch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(EmptyMsg)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(BulletinBoardServiceServer).StartEpoch(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/services.BulletinBoardService/StartEpoch",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(BulletinBoardServiceServer).StartEpoch(ctx, req.(*EmptyMsg))
	}
	return interceptor(ctx, in, info, handler)
}

func _BulletinBoardService_ReadPhase1_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(EmptyMsg)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(BulletinBoardServiceServer).ReadPhase1(m, &bulletinBoardServiceReadPhase1Server{stream})
}

type BulletinBoardService_ReadPhase1Server interface {
	Send(*Cmt1Msg) error
	grpc.ServerStream
}

type bulletinBoardServiceReadPhase1Server struct {
	grpc.ServerStream
}

func (x *bulletinBoardServiceReadPhase1Server) Send(m *Cmt1Msg) error {
	return x.ServerStream.SendMsg(m)
}

func _BulletinBoardService_WritePhase2_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Cmt2Msg)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(BulletinBoardServiceServer).WritePhase2(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/services.BulletinBoardService/WritePhase2",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(BulletinBoardServiceServer).WritePhase2(ctx, req.(*Cmt2Msg))
	}
	return interceptor(ctx, in, info, handler)
}

func _BulletinBoardService_ReadPhase2_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(EmptyMsg)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(BulletinBoardServiceServer).ReadPhase2(m, &bulletinBoardServiceReadPhase2Server{stream})
}

type BulletinBoardService_ReadPhase2Server interface {
	Send(*Cmt2Msg) error
	grpc.ServerStream
}

type bulletinBoardServiceReadPhase2Server struct {
	grpc.ServerStream
}

func (x *bulletinBoardServiceReadPhase2Server) Send(m *Cmt2Msg) error {
	return x.ServerStream.SendMsg(m)
}

func _BulletinBoardService_WritePhase3_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Cmt1Msg)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(BulletinBoardServiceServer).WritePhase3(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/services.BulletinBoardService/WritePhase3",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(BulletinBoardServiceServer).WritePhase3(ctx, req.(*Cmt1Msg))
	}
	return interceptor(ctx, in, info, handler)
}

func _BulletinBoardService_ReadPhase3_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(EmptyMsg)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(BulletinBoardServiceServer).ReadPhase3(m, &bulletinBoardServiceReadPhase3Server{stream})
}

type BulletinBoardService_ReadPhase3Server interface {
	Send(*Cmt1Msg) error
	grpc.ServerStream
}

type bulletinBoardServiceReadPhase3Server struct {
	grpc.ServerStream
}

func (x *bulletinBoardServiceReadPhase3Server) Send(m *Cmt1Msg) error {
	return x.ServerStream.SendMsg(m)
}

var _BulletinBoardService_serviceDesc = grpc.ServiceDesc{
	ServiceName: "services.BulletinBoardService",
	HandlerType: (*BulletinBoardServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "StartEpoch",
			Handler:    _BulletinBoardService_StartEpoch_Handler,
		},
		{
			MethodName: "WritePhase2",
			Handler:    _BulletinBoardService_WritePhase2_Handler,
		},
		{
			MethodName: "WritePhase3",
			Handler:    _BulletinBoardService_WritePhase3_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "ReadPhase1",
			Handler:       _BulletinBoardService_ReadPhase1_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "ReadPhase2",
			Handler:       _BulletinBoardService_ReadPhase2_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "ReadPhase3",
			Handler:       _BulletinBoardService_ReadPhase3_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "services.proto",
}

// NodeServiceClient is the client API for NodeService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type NodeServiceClient interface {
	// Node RPC for reconstruction phase
	StartPhase1(ctx context.Context, in *EmptyMsg, opts ...grpc.CallOption) (*AckMsg, error)
	SharePhase1(ctx context.Context, in *PointMsg, opts ...grpc.CallOption) (*AckMsg, error)
	// Node RPC for proactivization phase
	SharePhase2(ctx context.Context, in *ZeroMsg, opts ...grpc.CallOption) (*AckMsg, error)
	StartVerifPhase2(ctx context.Context, in *EmptyMsg, opts ...grpc.CallOption) (*AckMsg, error)
	// Node RPC for share distribution phase
	SharePhase3(ctx context.Context, in *PointMsg, opts ...grpc.CallOption) (*AckMsg, error)
	StartVerifPhase3(ctx context.Context, in *EmptyMsg, opts ...grpc.CallOption) (*AckMsg, error)
}

type nodeServiceClient struct {
	cc *grpc.ClientConn
}

func NewNodeServiceClient(cc *grpc.ClientConn) NodeServiceClient {
	return &nodeServiceClient{cc}
}

func (c *nodeServiceClient) StartPhase1(ctx context.Context, in *EmptyMsg, opts ...grpc.CallOption) (*AckMsg, error) {
	out := new(AckMsg)
	err := c.cc.Invoke(ctx, "/services.NodeService/StartPhase1", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *nodeServiceClient) SharePhase1(ctx context.Context, in *PointMsg, opts ...grpc.CallOption) (*AckMsg, error) {
	out := new(AckMsg)
	err := c.cc.Invoke(ctx, "/services.NodeService/SharePhase1", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *nodeServiceClient) SharePhase2(ctx context.Context, in *ZeroMsg, opts ...grpc.CallOption) (*AckMsg, error) {
	out := new(AckMsg)
	err := c.cc.Invoke(ctx, "/services.NodeService/SharePhase2", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *nodeServiceClient) StartVerifPhase2(ctx context.Context, in *EmptyMsg, opts ...grpc.CallOption) (*AckMsg, error) {
	out := new(AckMsg)
	err := c.cc.Invoke(ctx, "/services.NodeService/StartVerifPhase2", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *nodeServiceClient) SharePhase3(ctx context.Context, in *PointMsg, opts ...grpc.CallOption) (*AckMsg, error) {
	out := new(AckMsg)
	err := c.cc.Invoke(ctx, "/services.NodeService/SharePhase3", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *nodeServiceClient) StartVerifPhase3(ctx context.Context, in *EmptyMsg, opts ...grpc.CallOption) (*AckMsg, error) {
	out := new(AckMsg)
	err := c.cc.Invoke(ctx, "/services.NodeService/StartVerifPhase3", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// NodeServiceServer is the server API for NodeService service.
type NodeServiceServer interface {
	// Node RPC for reconstruction phase
	StartPhase1(context.Context, *EmptyMsg) (*AckMsg, error)
	SharePhase1(context.Context, *PointMsg) (*AckMsg, error)
	// Node RPC for proactivization phase
	SharePhase2(context.Context, *ZeroMsg) (*AckMsg, error)
	StartVerifPhase2(context.Context, *EmptyMsg) (*AckMsg, error)
	// Node RPC for share distribution phase
	SharePhase3(context.Context, *PointMsg) (*AckMsg, error)
	StartVerifPhase3(context.Context, *EmptyMsg) (*AckMsg, error)
}

func RegisterNodeServiceServer(s *grpc.Server, srv NodeServiceServer) {
	s.RegisterService(&_NodeService_serviceDesc, srv)
}

func _NodeService_StartPhase1_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(EmptyMsg)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(NodeServiceServer).StartPhase1(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/services.NodeService/StartPhase1",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(NodeServiceServer).StartPhase1(ctx, req.(*EmptyMsg))
	}
	return interceptor(ctx, in, info, handler)
}

func _NodeService_SharePhase1_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PointMsg)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(NodeServiceServer).SharePhase1(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/services.NodeService/SharePhase1",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(NodeServiceServer).SharePhase1(ctx, req.(*PointMsg))
	}
	return interceptor(ctx, in, info, handler)
}

func _NodeService_SharePhase2_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ZeroMsg)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(NodeServiceServer).SharePhase2(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/services.NodeService/SharePhase2",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(NodeServiceServer).SharePhase2(ctx, req.(*ZeroMsg))
	}
	return interceptor(ctx, in, info, handler)
}

func _NodeService_StartVerifPhase2_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(EmptyMsg)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(NodeServiceServer).StartVerifPhase2(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/services.NodeService/StartVerifPhase2",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(NodeServiceServer).StartVerifPhase2(ctx, req.(*EmptyMsg))
	}
	return interceptor(ctx, in, info, handler)
}

func _NodeService_SharePhase3_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PointMsg)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(NodeServiceServer).SharePhase3(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/services.NodeService/SharePhase3",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(NodeServiceServer).SharePhase3(ctx, req.(*PointMsg))
	}
	return interceptor(ctx, in, info, handler)
}

func _NodeService_StartVerifPhase3_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(EmptyMsg)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(NodeServiceServer).StartVerifPhase3(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/services.NodeService/StartVerifPhase3",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(NodeServiceServer).StartVerifPhase3(ctx, req.(*EmptyMsg))
	}
	return interceptor(ctx, in, info, handler)
}

var _NodeService_serviceDesc = grpc.ServiceDesc{
	ServiceName: "services.NodeService",
	HandlerType: (*NodeServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "StartPhase1",
			Handler:    _NodeService_StartPhase1_Handler,
		},
		{
			MethodName: "SharePhase1",
			Handler:    _NodeService_SharePhase1_Handler,
		},
		{
			MethodName: "SharePhase2",
			Handler:    _NodeService_SharePhase2_Handler,
		},
		{
			MethodName: "StartVerifPhase2",
			Handler:    _NodeService_StartVerifPhase2_Handler,
		},
		{
			MethodName: "SharePhase3",
			Handler:    _NodeService_SharePhase3_Handler,
		},
		{
			MethodName: "StartVerifPhase3",
			Handler:    _NodeService_StartVerifPhase3_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "services.proto",
}
