diff --git a/backend/rpc.go b/backend/rpc.go index 103487b..6fa80d8 100644 --- a/backend/rpc.go +++ b/backend/rpc.go @@ -13,6 +13,8 @@ type RicochetCore struct { Config *ricochet.Config } +var NotImplementedError error = errors.New("Not implemented") + func (core *RicochetCore) GetServerStatus(ctx context.Context, req *rpc.ServerStatusRequest) (*rpc.ServerStatusReply, error) { if req.RpcVersion != 1 { return nil, errors.New("Unsupported RPC protocol version") @@ -68,3 +70,35 @@ func (core *RicochetCore) StopNetwork(ctx context.Context, req *rpc.StopNetworkR status := core.Network.GetStatus() return &status, nil } + +func (core *RicochetCore) GetIdentity(ctx context.Context, req *rpc.IdentityRequest) (*rpc.Identity, error) { + return nil, NotImplementedError +} + +func (core *RicochetCore) MonitorContacts(req *rpc.MonitorContactsRequest, stream rpc.RicochetCore_MonitorContactsServer) error { + return NotImplementedError +} + +func (core *RicochetCore) AddContactRequest(ctx context.Context, req *rpc.ContactRequest) (*rpc.Contact, error) { + return nil, NotImplementedError +} + +func (core *RicochetCore) UpdateContact(ctx context.Context, req *rpc.Contact) (*rpc.Contact, error) { + return nil, NotImplementedError +} + +func (core *RicochetCore) DeleteContact(ctx context.Context, req *rpc.DeleteContactRequest) (*rpc.DeleteContactReply, error) { + return nil, NotImplementedError +} + +func (core *RicochetCore) AcceptInboundRequest(ctx context.Context, req *rpc.ContactRequest) (*rpc.Contact, error) { + return nil, NotImplementedError +} + +func (core *RicochetCore) RejectInboundRequest(ctx context.Context, req *rpc.ContactRequest) (*rpc.RejectInboundRequestReply, error) { + return nil, NotImplementedError +} + +func (core *RicochetCore) StreamConversations(stream rpc.RicochetCore_StreamConversationsServer) error { + return NotImplementedError +} diff --git a/rpc/config.pb.go b/rpc/config.pb.go new file mode 100644 index 0000000..8bfda76 --- /dev/null +++ b/rpc/config.pb.go @@ -0,0 +1,89 @@ +// Code generated by protoc-gen-go. +// source: config.proto +// DO NOT EDIT! + +/* +Package ricochet is a generated protocol buffer package. + +It is generated from these files: + config.proto + contact.proto + conversation.proto + core.proto + identity.proto + network.proto + +It has these top-level messages: + Config + ConfigRequest + Contact + ContactRequest + MonitorContactsRequest + ContactEvent + AddContactReply + DeleteContactRequest + DeleteContactReply + RejectInboundRequestReply + ConversationEvent + Entity + Message + ServerStatusRequest + ServerStatusReply + Identity + IdentityRequest + MonitorNetworkRequest + TorProcessStatus + TorControlStatus + TorConnectionStatus + NetworkStatus + StartNetworkRequest + StopNetworkRequest +*/ +package ricochet + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import 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 Config struct { +} + +func (m *Config) Reset() { *m = Config{} } +func (m *Config) String() string { return proto.CompactTextString(m) } +func (*Config) ProtoMessage() {} +func (*Config) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +type ConfigRequest struct { +} + +func (m *ConfigRequest) Reset() { *m = ConfigRequest{} } +func (m *ConfigRequest) String() string { return proto.CompactTextString(m) } +func (*ConfigRequest) ProtoMessage() {} +func (*ConfigRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func init() { + proto.RegisterType((*Config)(nil), "ricochet.Config") + proto.RegisterType((*ConfigRequest)(nil), "ricochet.ConfigRequest") +} + +func init() { proto.RegisterFile("config.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 73 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0x49, 0xce, 0xcf, 0x4b, + 0xcb, 0x4c, 0xd7, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x28, 0xca, 0x4c, 0xce, 0x4f, 0xce, + 0x48, 0x2d, 0x51, 0xe2, 0xe0, 0x62, 0x73, 0x06, 0xcb, 0x28, 0xf1, 0x73, 0xf1, 0x42, 0x58, 0x41, + 0xa9, 0x85, 0xa5, 0xa9, 0xc5, 0x25, 0x49, 0x6c, 0x60, 0xb5, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xad, 0xf5, 0x95, 0x4e, 0x3b, 0x00, 0x00, 0x00, +} diff --git a/rpc/contact.pb.go b/rpc/contact.pb.go new file mode 100644 index 0000000..d7cc0ce --- /dev/null +++ b/rpc/contact.pb.go @@ -0,0 +1,341 @@ +// Code generated by protoc-gen-go. +// source: contact.proto +// DO NOT EDIT! + +package ricochet + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +type Contact_Status int32 + +const ( + Contact_OFFLINE Contact_Status = 0 + Contact_ONLINE Contact_Status = 1 + Contact_REQUEST Contact_Status = 2 + Contact_REJECTED Contact_Status = 3 +) + +var Contact_Status_name = map[int32]string{ + 0: "OFFLINE", + 1: "ONLINE", + 2: "REQUEST", + 3: "REJECTED", +} +var Contact_Status_value = map[string]int32{ + "OFFLINE": 0, + "ONLINE": 1, + "REQUEST": 2, + "REJECTED": 3, +} + +func (x Contact_Status) String() string { + return proto.EnumName(Contact_Status_name, int32(x)) +} +func (Contact_Status) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{0, 0} } + +type ContactRequest_Direction int32 + +const ( + ContactRequest_INBOUND ContactRequest_Direction = 0 + ContactRequest_OUTBOUND ContactRequest_Direction = 1 +) + +var ContactRequest_Direction_name = map[int32]string{ + 0: "INBOUND", + 1: "OUTBOUND", +} +var ContactRequest_Direction_value = map[string]int32{ + "INBOUND": 0, + "OUTBOUND": 1, +} + +func (x ContactRequest_Direction) String() string { + return proto.EnumName(ContactRequest_Direction_name, int32(x)) +} +func (ContactRequest_Direction) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{1, 0} } + +type ContactEvent_Type int32 + +const ( + ContactEvent_NULL ContactEvent_Type = 0 + ContactEvent_POPULATE ContactEvent_Type = 1 + ContactEvent_ADD ContactEvent_Type = 2 + ContactEvent_UPDATE ContactEvent_Type = 3 + ContactEvent_DELETE ContactEvent_Type = 4 +) + +var ContactEvent_Type_name = map[int32]string{ + 0: "NULL", + 1: "POPULATE", + 2: "ADD", + 3: "UPDATE", + 4: "DELETE", +} +var ContactEvent_Type_value = map[string]int32{ + "NULL": 0, + "POPULATE": 1, + "ADD": 2, + "UPDATE": 3, + "DELETE": 4, +} + +func (x ContactEvent_Type) String() string { + return proto.EnumName(ContactEvent_Type_name, int32(x)) +} +func (ContactEvent_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{3, 0} } + +type Contact struct { + Id int32 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` + Address string `protobuf:"bytes,2,opt,name=address" json:"address,omitempty"` + Nickname string `protobuf:"bytes,3,opt,name=nickname" json:"nickname,omitempty"` + WhenCreated string `protobuf:"bytes,4,opt,name=whenCreated" json:"whenCreated,omitempty"` + LastConnected string `protobuf:"bytes,5,opt,name=lastConnected" json:"lastConnected,omitempty"` + Request *ContactRequest `protobuf:"bytes,6,opt,name=request" json:"request,omitempty"` + Status Contact_Status `protobuf:"varint,10,opt,name=status,enum=ricochet.Contact_Status" json:"status,omitempty"` +} + +func (m *Contact) Reset() { *m = Contact{} } +func (m *Contact) String() string { return proto.CompactTextString(m) } +func (*Contact) ProtoMessage() {} +func (*Contact) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } + +func (m *Contact) GetRequest() *ContactRequest { + if m != nil { + return m.Request + } + return nil +} + +type ContactRequest struct { + Direction ContactRequest_Direction `protobuf:"varint,1,opt,name=direction,enum=ricochet.ContactRequest_Direction" json:"direction,omitempty"` + Address string `protobuf:"bytes,2,opt,name=address" json:"address,omitempty"` + Nickname string `protobuf:"bytes,3,opt,name=nickname" json:"nickname,omitempty"` + Text string `protobuf:"bytes,4,opt,name=text" json:"text,omitempty"` +} + +func (m *ContactRequest) Reset() { *m = ContactRequest{} } +func (m *ContactRequest) String() string { return proto.CompactTextString(m) } +func (*ContactRequest) ProtoMessage() {} +func (*ContactRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} } + +type MonitorContactsRequest struct { +} + +func (m *MonitorContactsRequest) Reset() { *m = MonitorContactsRequest{} } +func (m *MonitorContactsRequest) String() string { return proto.CompactTextString(m) } +func (*MonitorContactsRequest) ProtoMessage() {} +func (*MonitorContactsRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} } + +type ContactEvent struct { + Type ContactEvent_Type `protobuf:"varint,1,opt,name=type,enum=ricochet.ContactEvent_Type" json:"type,omitempty"` + // Types that are valid to be assigned to Subject: + // *ContactEvent_Contact + // *ContactEvent_Request + Subject isContactEvent_Subject `protobuf_oneof:"subject"` +} + +func (m *ContactEvent) Reset() { *m = ContactEvent{} } +func (m *ContactEvent) String() string { return proto.CompactTextString(m) } +func (*ContactEvent) ProtoMessage() {} +func (*ContactEvent) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3} } + +type isContactEvent_Subject interface { + isContactEvent_Subject() +} + +type ContactEvent_Contact struct { + Contact *Contact `protobuf:"bytes,2,opt,name=contact,oneof"` +} +type ContactEvent_Request struct { + Request *ContactRequest `protobuf:"bytes,3,opt,name=request,oneof"` +} + +func (*ContactEvent_Contact) isContactEvent_Subject() {} +func (*ContactEvent_Request) isContactEvent_Subject() {} + +func (m *ContactEvent) GetSubject() isContactEvent_Subject { + if m != nil { + return m.Subject + } + return nil +} + +func (m *ContactEvent) GetContact() *Contact { + if x, ok := m.GetSubject().(*ContactEvent_Contact); ok { + return x.Contact + } + return nil +} + +func (m *ContactEvent) GetRequest() *ContactRequest { + if x, ok := m.GetSubject().(*ContactEvent_Request); ok { + return x.Request + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*ContactEvent) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _ContactEvent_OneofMarshaler, _ContactEvent_OneofUnmarshaler, _ContactEvent_OneofSizer, []interface{}{ + (*ContactEvent_Contact)(nil), + (*ContactEvent_Request)(nil), + } +} + +func _ContactEvent_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*ContactEvent) + // subject + switch x := m.Subject.(type) { + case *ContactEvent_Contact: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Contact); err != nil { + return err + } + case *ContactEvent_Request: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Request); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("ContactEvent.Subject has unexpected type %T", x) + } + return nil +} + +func _ContactEvent_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*ContactEvent) + switch tag { + case 2: // subject.contact + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Contact) + err := b.DecodeMessage(msg) + m.Subject = &ContactEvent_Contact{msg} + return true, err + case 3: // subject.request + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(ContactRequest) + err := b.DecodeMessage(msg) + m.Subject = &ContactEvent_Request{msg} + return true, err + default: + return false, nil + } +} + +func _ContactEvent_OneofSizer(msg proto.Message) (n int) { + m := msg.(*ContactEvent) + // subject + switch x := m.Subject.(type) { + case *ContactEvent_Contact: + s := proto.Size(x.Contact) + n += proto.SizeVarint(2<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *ContactEvent_Request: + s := proto.Size(x.Request) + n += proto.SizeVarint(3<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +type AddContactReply struct { +} + +func (m *AddContactReply) Reset() { *m = AddContactReply{} } +func (m *AddContactReply) String() string { return proto.CompactTextString(m) } +func (*AddContactReply) ProtoMessage() {} +func (*AddContactReply) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{4} } + +type DeleteContactRequest struct { + Id int32 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` + Address string `protobuf:"bytes,2,opt,name=address" json:"address,omitempty"` +} + +func (m *DeleteContactRequest) Reset() { *m = DeleteContactRequest{} } +func (m *DeleteContactRequest) String() string { return proto.CompactTextString(m) } +func (*DeleteContactRequest) ProtoMessage() {} +func (*DeleteContactRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{5} } + +type DeleteContactReply struct { +} + +func (m *DeleteContactReply) Reset() { *m = DeleteContactReply{} } +func (m *DeleteContactReply) String() string { return proto.CompactTextString(m) } +func (*DeleteContactReply) ProtoMessage() {} +func (*DeleteContactReply) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{6} } + +type RejectInboundRequestReply struct { +} + +func (m *RejectInboundRequestReply) Reset() { *m = RejectInboundRequestReply{} } +func (m *RejectInboundRequestReply) String() string { return proto.CompactTextString(m) } +func (*RejectInboundRequestReply) ProtoMessage() {} +func (*RejectInboundRequestReply) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{7} } + +func init() { + proto.RegisterType((*Contact)(nil), "ricochet.Contact") + proto.RegisterType((*ContactRequest)(nil), "ricochet.ContactRequest") + proto.RegisterType((*MonitorContactsRequest)(nil), "ricochet.MonitorContactsRequest") + proto.RegisterType((*ContactEvent)(nil), "ricochet.ContactEvent") + proto.RegisterType((*AddContactReply)(nil), "ricochet.AddContactReply") + proto.RegisterType((*DeleteContactRequest)(nil), "ricochet.DeleteContactRequest") + proto.RegisterType((*DeleteContactReply)(nil), "ricochet.DeleteContactReply") + proto.RegisterType((*RejectInboundRequestReply)(nil), "ricochet.RejectInboundRequestReply") + proto.RegisterEnum("ricochet.Contact_Status", Contact_Status_name, Contact_Status_value) + proto.RegisterEnum("ricochet.ContactRequest_Direction", ContactRequest_Direction_name, ContactRequest_Direction_value) + proto.RegisterEnum("ricochet.ContactEvent_Type", ContactEvent_Type_name, ContactEvent_Type_value) +} + +func init() { proto.RegisterFile("contact.proto", fileDescriptor1) } + +var fileDescriptor1 = []byte{ + // 495 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x9c, 0x53, 0xd1, 0x6e, 0xd3, 0x30, + 0x14, 0x5d, 0x9a, 0x2c, 0x69, 0x6f, 0xb7, 0xd2, 0x59, 0x13, 0x0a, 0xec, 0x65, 0xb2, 0x10, 0xe2, + 0x85, 0x80, 0x0a, 0x8f, 0x48, 0xac, 0x6b, 0x32, 0x51, 0x14, 0x92, 0xe2, 0x25, 0x1f, 0x90, 0x26, + 0x96, 0x16, 0x28, 0x4e, 0x49, 0x5c, 0x60, 0xdf, 0xc6, 0x2b, 0x1f, 0xc4, 0x27, 0x60, 0x3b, 0x4e, + 0xc7, 0x36, 0x40, 0x68, 0x6f, 0xd7, 0xf7, 0x9c, 0xeb, 0x7b, 0xcf, 0x3d, 0x36, 0xec, 0xe7, 0x15, + 0xe3, 0x59, 0xce, 0xbd, 0x75, 0x5d, 0xf1, 0x0a, 0xf5, 0xeb, 0x32, 0xaf, 0xf2, 0x0b, 0xca, 0xf1, + 0xf7, 0x1e, 0x38, 0xb3, 0x16, 0x43, 0x23, 0xe8, 0x95, 0x85, 0x6b, 0x1c, 0x1b, 0x4f, 0x76, 0x89, + 0x88, 0x90, 0x0b, 0x4e, 0x56, 0x14, 0x35, 0x6d, 0x1a, 0xb7, 0x27, 0x92, 0x03, 0xd2, 0x1d, 0xd1, + 0x43, 0xe8, 0xb3, 0x32, 0xff, 0xc8, 0xb2, 0x4f, 0xd4, 0x35, 0x15, 0xb4, 0x3d, 0xa3, 0x63, 0x18, + 0x7e, 0xbd, 0xa0, 0x6c, 0x56, 0xd3, 0x8c, 0xd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xe9, 0x5c, 0xf0, + 0x85, 0x32, 0x8e, 0x9e, 0x89, 0x36, 0x97, 0x6b, 0xaa, 0x95, 0x1d, 0xdd, 0x52, 0xa6, 0x58, 0x5e, + 0x22, 0x28, 0x44, 0x11, 0xd1, 0x53, 0x70, 0xf4, 0xdb, 0x53, 0x6a, 0x86, 0x93, 0x83, 0x5b, 0x35, + 0x6f, 0x76, 0x48, 0xc7, 0x41, 0x2f, 0xaf, 0x5c, 0x37, 0xff, 0xed, 0xba, 0xac, 0xd2, 0x54, 0xfc, + 0x1a, 0x2c, 0xd9, 0x12, 0xf5, 0xc1, 0x8a, 0xd2, 0x30, 0x6c, 0x05, 0x2e, 0xe2, 0x45, 0x1a, 0x4e, + 0x13, 0x69, 0xa1, 0x03, 0xe6, 0xd4, 0xf7, 0x85, 0x7d, 0xc2, 0xd7, 0x74, 0xe1, 0xcb, 0xa4, 0x29, + 0x63, 0x3f, 0x08, 0x03, 0x11, 0x5b, 0xa7, 0x03, 0x70, 0x9a, 0xcd, 0xf2, 0x83, 0x58, 0x15, 0x3e, + 0x80, 0x7b, 0xd3, 0xa2, 0xd8, 0xf6, 0x5a, 0xaf, 0x2e, 0xf1, 0x09, 0x1c, 0xfa, 0x74, 0x45, 0x39, + 0xbd, 0xe1, 0xf5, 0x7f, 0x7f, 0x18, 0x7c, 0x08, 0xe8, 0xc6, 0x0d, 0xf2, 0xde, 0x23, 0x78, 0x40, + 0xa8, 0x6c, 0x3a, 0x67, 0xcb, 0x6a, 0xc3, 0x8a, 0xee, 0x3d, 0x4b, 0x70, 0x69, 0xab, 0xaf, 0xfa, + 0xe2, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa1, 0xab, 0x53, 0xdb, 0xbb, 0x03, 0x00, 0x00, +} diff --git a/rpc/contact.proto b/rpc/contact.proto new file mode 100644 index 0000000..c9c0669 --- /dev/null +++ b/rpc/contact.proto @@ -0,0 +1,63 @@ +syntax = "proto3"; +package ricochet; + +message Contact { + int32 id = 1; + string address = 2; + string nickname = 3; + string whenCreated = 4; + string lastConnected = 5; + ContactRequest request = 6; + + enum Status { + OFFLINE = 0; + ONLINE = 1; + REQUEST = 2; + REJECTED = 3; + } + Status status = 10; +} + +message ContactRequest { + enum Direction { + INBOUND = 0; + OUTBOUND = 1; + } + Direction direction = 1; + string address = 2; + string nickname = 3; + string text = 4; +} + +message MonitorContactsRequest { +} + +message ContactEvent { + enum Type { + NULL = 0; + POPULATE = 1; + ADD = 2; + UPDATE = 3; + DELETE = 4; + } + Type type = 1; + + oneof subject { + Contact contact = 2; + ContactRequest request = 3; + } +} + +message AddContactReply { +} + +message DeleteContactRequest { + int32 id = 1; + string address = 2; +} + +message DeleteContactReply { +} + +message RejectInboundRequestReply { +} diff --git a/rpc/conversation.pb.go b/rpc/conversation.pb.go new file mode 100644 index 0000000..2131c0e --- /dev/null +++ b/rpc/conversation.pb.go @@ -0,0 +1,173 @@ +// Code generated by protoc-gen-go. +// source: conversation.proto +// DO NOT EDIT! + +package ricochet + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +type ConversationEvent_Type int32 + +const ( + ConversationEvent_NULL ConversationEvent_Type = 0 + ConversationEvent_POPULATE ConversationEvent_Type = 1 + ConversationEvent_RECEIVE ConversationEvent_Type = 2 + ConversationEvent_SEND ConversationEvent_Type = 3 + ConversationEvent_UPDATE ConversationEvent_Type = 4 +) + +var ConversationEvent_Type_name = map[int32]string{ + 0: "NULL", + 1: "POPULATE", + 2: "RECEIVE", + 3: "SEND", + 4: "UPDATE", +} +var ConversationEvent_Type_value = map[string]int32{ + "NULL": 0, + "POPULATE": 1, + "RECEIVE": 2, + "SEND": 3, + "UPDATE": 4, +} + +func (x ConversationEvent_Type) String() string { + return proto.EnumName(ConversationEvent_Type_name, int32(x)) +} +func (ConversationEvent_Type) EnumDescriptor() ([]byte, []int) { return fileDescriptor2, []int{0, 0} } + +type Message_Status int32 + +const ( + Message_NULL Message_Status = 0 + Message_RECEIVED Message_Status = 1 + Message_QUEUED Message_Status = 2 + Message_SENDING Message_Status = 3 + Message_DELIVERED Message_Status = 4 + Message_ERROR Message_Status = 5 +) + +var Message_Status_name = map[int32]string{ + 0: "NULL", + 1: "RECEIVED", + 2: "QUEUED", + 3: "SENDING", + 4: "DELIVERED", + 5: "ERROR", +} +var Message_Status_value = map[string]int32{ + "NULL": 0, + "RECEIVED": 1, + "QUEUED": 2, + "SENDING": 3, + "DELIVERED": 4, + "ERROR": 5, +} + +func (x Message_Status) String() string { + return proto.EnumName(Message_Status_name, int32(x)) +} +func (Message_Status) EnumDescriptor() ([]byte, []int) { return fileDescriptor2, []int{2, 0} } + +type ConversationEvent struct { + Type ConversationEvent_Type `protobuf:"varint,1,opt,name=type,enum=ricochet.ConversationEvent_Type" json:"type,omitempty"` + Msg *Message `protobuf:"bytes,2,opt,name=msg" json:"msg,omitempty"` +} + +func (m *ConversationEvent) Reset() { *m = ConversationEvent{} } +func (m *ConversationEvent) String() string { return proto.CompactTextString(m) } +func (*ConversationEvent) ProtoMessage() {} +func (*ConversationEvent) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} } + +func (m *ConversationEvent) GetMsg() *Message { + if m != nil { + return m.Msg + } + return nil +} + +type Entity struct { + // null is self + ContactId int32 `protobuf:"varint,1,opt,name=contactId" json:"contactId,omitempty"` + Address string `protobuf:"bytes,2,opt,name=address" json:"address,omitempty"` +} + +func (m *Entity) Reset() { *m = Entity{} } +func (m *Entity) String() string { return proto.CompactTextString(m) } +func (*Entity) ProtoMessage() {} +func (*Entity) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{1} } + +type Message struct { + Sender *Entity `protobuf:"bytes,1,opt,name=sender" json:"sender,omitempty"` + Recipient *Entity `protobuf:"bytes,2,opt,name=recipient" json:"recipient,omitempty"` + Timestamp int64 `protobuf:"varint,3,opt,name=timestamp" json:"timestamp,omitempty"` + // Identifiers are unique _only_ to a sender/recipient pair in a session + // XXX This is a silly thing to perpetuate; should we UUID? + Identifier uint32 `protobuf:"varint,4,opt,name=identifier" json:"identifier,omitempty"` + Status Message_Status `protobuf:"varint,5,opt,name=status,enum=ricochet.Message_Status" json:"status,omitempty"` + Text string `protobuf:"bytes,6,opt,name=text" json:"text,omitempty"` +} + +func (m *Message) Reset() { *m = Message{} } +func (m *Message) String() string { return proto.CompactTextString(m) } +func (*Message) ProtoMessage() {} +func (*Message) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{2} } + +func (m *Message) GetSender() *Entity { + if m != nil { + return m.Sender + } + return nil +} + +func (m *Message) GetRecipient() *Entity { + if m != nil { + return m.Recipient + } + return nil +} + +func init() { + proto.RegisterType((*ConversationEvent)(nil), "ricochet.ConversationEvent") + proto.RegisterType((*Entity)(nil), "ricochet.Entity") + proto.RegisterType((*Message)(nil), "ricochet.Message") + proto.RegisterEnum("ricochet.ConversationEvent_Type", ConversationEvent_Type_name, ConversationEvent_Type_value) + proto.RegisterEnum("ricochet.Message_Status", Message_Status_name, Message_Status_value) +} + +func init() { proto.RegisterFile("conversation.proto", fileDescriptor2) } + +var fileDescriptor2 = []byte{ + // 378 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x64, 0x92, 0x4d, 0xef, 0xd2, 0x40, + 0x10, 0xc6, 0xed, 0x2b, 0x74, 0x10, 0x53, 0xe6, 0xd4, 0x83, 0x31, 0xa4, 0x5e, 0x38, 0x35, 0x06, + 0xfd, 0x00, 0x12, 0xba, 0x31, 0x24, 0x15, 0x70, 0xa1, 0xde, 0x6b, 0xbb, 0xe2, 0x1e, 0x68, 0x9b, + 0x76, 0x25, 0xf2, 0xb1, 0xbc, 0xfb, 0xe1, 0x9c, 0x2e, 0x25, 0xe5, 0x1f, 0x6e, 0xdb, 0x79, 0x7e, + 0xd3, 0x79, 0xe6, 0xd9, 0x05, 0x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 0xac, 0x25, 0xed, 0xdd, 0x6f, 0xf9, + 0x0c, 0x0f, 0x48, 0xe7, 0x4e, 0xc9, 0xb3, 0x68, 0x55, 0x76, 0xae, 0x03, 0x8b, 0x78, 0x8b, 0x0f, + 0x05, 0x7c, 0x07, 0x20, 0x0b, 0xc2, 0xe4, 0x4f, 0x49, 0xb3, 0x6d, 0x92, 0xa7, 0xfc, 0xa1, 0x82, + 0x1f, 0xc8, 0x97, 0xca, 0xd4, 0xef, 0x36, 0x70, 0xf4, 0x2d, 0x04, 0x4f, 0x81, 0x46, 0x07, 0xad, + 0xf3, 0x9e, 0x43, 0xa4, 0x5b, 0x13, 0x7f, 0x54, 0xe0, 0xea, 0x65, 0xf5, 0x39, 0x3c, 0x80, 0x7b, + 0xa3, 0x5e, 0x06, 0xde, 0x47, 0x1c, 0x53, 0xe0, 0x94, 0xec, 0xb7, 0x94, 0xa5, 0x74, 0x36, 0xbb, + 0xf0, 0xbb, 0xbc, 0x37, 0xdb, 0x2f, 0x14, 0xf9, 0x14, 0xbc, 0x98, 0x25, 0x44, 0x71, 0xd2, 0x6c, + 0xf4, 0xc0, 0x61, 0x9c, 0xef, 0xb8, 0xef, 0xfc, 0x70, 0xf5, 0x2b, 0xfa, 0xf8, 0x3f, 0x00, 0x00, + 0xff, 0xff, 0xe1, 0x5b, 0xde, 0x0a, 0x5b, 0x02, 0x00, 0x00, +} diff --git a/rpc/conversation.proto b/rpc/conversation.proto new file mode 100644 index 0000000..a256c9f --- /dev/null +++ b/rpc/conversation.proto @@ -0,0 +1,43 @@ +syntax = "proto3"; +package ricochet; + +message ConversationEvent { + enum Type { + NULL = 0; + POPULATE = 1; + RECEIVE = 2; + SEND = 3; + UPDATE = 4; + } + Type type = 1; + + Message msg = 2; +} + +message Entity { + // null is self + int32 contactId = 1; + string address = 2; +} + +message Message { + Entity sender = 1; + Entity recipient = 2; + int64 timestamp = 3; + // Identifiers are unique _only_ to a sender/recipient pair in a session + // XXX This is a silly thing to perpetuate; should we UUID? + uint32 identifier = 4; + + enum Status { + NULL = 0; + RECEIVED = 1; + QUEUED = 2; + SENDING = 3; + DELIVERED = 4; + ERROR = 5; + } + Status status = 5; + + string text = 6; +} + diff --git a/rpc/core.pb.go b/rpc/core.pb.go index 1ced577..3d2b52a 100644 --- a/rpc/core.pb.go +++ b/rpc/core.pb.go @@ -2,24 +2,6 @@ // source: core.proto // DO NOT EDIT! -/* -Package ricochet is a generated protocol buffer package. - -It is generated from these files: - core.proto - network.proto - -It has these top-level messages: - ServerStatusRequest - ServerStatusReply - MonitorNetworkRequest - TorProcessStatus - TorControlStatus - TorConnectionStatus - NetworkStatus - StartNetworkRequest - StopNetworkRequest -*/ package ricochet import proto "github.com/golang/protobuf/proto" @@ -36,12 +18,6 @@ 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 ServerStatusRequest struct { RpcVersion int32 `protobuf:"varint,1,opt,name=rpcVersion" json:"rpcVersion,omitempty"` } @@ -49,7 +25,7 @@ type ServerStatusRequest struct { func (m *ServerStatusRequest) Reset() { *m = ServerStatusRequest{} } func (m *ServerStatusRequest) String() string { return proto.CompactTextString(m) } func (*ServerStatusRequest) ProtoMessage() {} -func (*ServerStatusRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (*ServerStatusRequest) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} } type ServerStatusReply struct { RpcVersion int32 `protobuf:"varint,1,opt,name=rpcVersion" json:"rpcVersion,omitempty"` @@ -59,7 +35,7 @@ type ServerStatusReply struct { func (m *ServerStatusReply) Reset() { *m = ServerStatusReply{} } func (m *ServerStatusReply) String() string { return proto.CompactTextString(m) } func (*ServerStatusReply) ProtoMessage() {} -func (*ServerStatusReply) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } +func (*ServerStatusReply) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{1} } func init() { proto.RegisterType((*ServerStatusRequest)(nil), "ricochet.ServerStatusRequest") @@ -77,10 +53,31 @@ const _ = grpc.SupportPackageIsVersion3 // Client API for RicochetCore service type RicochetCoreClient interface { + // Query RPC server version and status GetServerStatus(ctx context.Context, in *ServerStatusRequest, opts ...grpc.CallOption) (*ServerStatusReply, error) + // Open a stream to monitor changes to network status. The current + // NetworkStatus will be sent immediately, and the stream will receive a + // new NetworkStatus after any changes until the stream is closed. MonitorNetwork(ctx context.Context, in *MonitorNetworkRequest, opts ...grpc.CallOption) (RicochetCore_MonitorNetworkClient, error) + // Start connecting to the network. Before StartNetwork is called (by any + // client), the backend will not make any connections or appear online. + // This call blocks until the first connection attempt succeeds or fails, + // and returns the current network status, but connection attempts will + // continue unless this call returns an RPC error, or until StopNetwork + // is called. StartNetwork(ctx context.Context, in *StartNetworkRequest, opts ...grpc.CallOption) (*NetworkStatus, error) + // Stop all network connections and go offline. Blocks until the network + // has been taken offline, and returns the new network status. StopNetwork(ctx context.Context, in *StopNetworkRequest, opts ...grpc.CallOption) (*NetworkStatus, error) + // XXX Service status + GetIdentity(ctx context.Context, in *IdentityRequest, opts ...grpc.CallOption) (*Identity, error) + MonitorContacts(ctx context.Context, in *MonitorContactsRequest, opts ...grpc.CallOption) (RicochetCore_MonitorContactsClient, error) + AddContactRequest(ctx context.Context, in *ContactRequest, opts ...grpc.CallOption) (*Contact, error) + UpdateContact(ctx context.Context, in *Contact, opts ...grpc.CallOption) (*Contact, error) + DeleteContact(ctx context.Context, in *DeleteContactRequest, opts ...grpc.CallOption) (*DeleteContactReply, error) + AcceptInboundRequest(ctx context.Context, in *ContactRequest, opts ...grpc.CallOption) (*Contact, error) + RejectInboundRequest(ctx context.Context, in *ContactRequest, opts ...grpc.CallOption) (*RejectInboundRequestReply, error) + StreamConversations(ctx context.Context, opts ...grpc.CallOption) (RicochetCore_StreamConversationsClient, error) } type ricochetCoreClient struct { @@ -150,13 +147,151 @@ func (c *ricochetCoreClient) StopNetwork(ctx context.Context, in *StopNetworkReq return out, nil } +func (c *ricochetCoreClient) GetIdentity(ctx context.Context, in *IdentityRequest, opts ...grpc.CallOption) (*Identity, error) { + out := new(Identity) + err := grpc.Invoke(ctx, "/ricochet.RicochetCore/GetIdentity", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *ricochetCoreClient) MonitorContacts(ctx context.Context, in *MonitorContactsRequest, opts ...grpc.CallOption) (RicochetCore_MonitorContactsClient, error) { + stream, err := grpc.NewClientStream(ctx, &_RicochetCore_serviceDesc.Streams[1], c.cc, "/ricochet.RicochetCore/MonitorContacts", opts...) + if err != nil { + return nil, err + } + x := &ricochetCoreMonitorContactsClient{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 RicochetCore_MonitorContactsClient interface { + Recv() (*ContactEvent, error) + grpc.ClientStream +} + +type ricochetCoreMonitorContactsClient struct { + grpc.ClientStream +} + +func (x *ricochetCoreMonitorContactsClient) Recv() (*ContactEvent, error) { + m := new(ContactEvent) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *ricochetCoreClient) AddContactRequest(ctx context.Context, in *ContactRequest, opts ...grpc.CallOption) (*Contact, error) { + out := new(Contact) + err := grpc.Invoke(ctx, "/ricochet.RicochetCore/AddContactRequest", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *ricochetCoreClient) UpdateContact(ctx context.Context, in *Contact, opts ...grpc.CallOption) (*Contact, error) { + out := new(Contact) + err := grpc.Invoke(ctx, "/ricochet.RicochetCore/UpdateContact", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *ricochetCoreClient) DeleteContact(ctx context.Context, in *DeleteContactRequest, opts ...grpc.CallOption) (*DeleteContactReply, error) { + out := new(DeleteContactReply) + err := grpc.Invoke(ctx, "/ricochet.RicochetCore/DeleteContact", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *ricochetCoreClient) AcceptInboundRequest(ctx context.Context, in *ContactRequest, opts ...grpc.CallOption) (*Contact, error) { + out := new(Contact) + err := grpc.Invoke(ctx, "/ricochet.RicochetCore/AcceptInboundRequest", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *ricochetCoreClient) RejectInboundRequest(ctx context.Context, in *ContactRequest, opts ...grpc.CallOption) (*RejectInboundRequestReply, error) { + out := new(RejectInboundRequestReply) + err := grpc.Invoke(ctx, "/ricochet.RicochetCore/RejectInboundRequest", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *ricochetCoreClient) StreamConversations(ctx context.Context, opts ...grpc.CallOption) (RicochetCore_StreamConversationsClient, error) { + stream, err := grpc.NewClientStream(ctx, &_RicochetCore_serviceDesc.Streams[2], c.cc, "/ricochet.RicochetCore/StreamConversations", opts...) + if err != nil { + return nil, err + } + x := &ricochetCoreStreamConversationsClient{stream} + return x, nil +} + +type RicochetCore_StreamConversationsClient interface { + Send(*ConversationEvent) error + Recv() (*ConversationEvent, error) + grpc.ClientStream +} + +type ricochetCoreStreamConversationsClient struct { + grpc.ClientStream +} + +func (x *ricochetCoreStreamConversationsClient) Send(m *ConversationEvent) error { + return x.ClientStream.SendMsg(m) +} + +func (x *ricochetCoreStreamConversationsClient) Recv() (*ConversationEvent, error) { + m := new(ConversationEvent) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + // Server API for RicochetCore service type RicochetCoreServer interface { + // Query RPC server version and status GetServerStatus(context.Context, *ServerStatusRequest) (*ServerStatusReply, error) + // Open a stream to monitor changes to network status. The current + // NetworkStatus will be sent immediately, and the stream will receive a + // new NetworkStatus after any changes until the stream is closed. MonitorNetwork(*MonitorNetworkRequest, RicochetCore_MonitorNetworkServer) error + // Start connecting to the network. Before StartNetwork is called (by any + // client), the backend will not make any connections or appear online. + // This call blocks until the first connection attempt succeeds or fails, + // and returns the current network status, but connection attempts will + // continue unless this call returns an RPC error, or until StopNetwork + // is called. StartNetwork(context.Context, *StartNetworkRequest) (*NetworkStatus, error) + // Stop all network connections and go offline. Blocks until the network + // has been taken offline, and returns the new network status. StopNetwork(context.Context, *StopNetworkRequest) (*NetworkStatus, error) + // XXX Service status + GetIdentity(context.Context, *IdentityRequest) (*Identity, error) + MonitorContacts(*MonitorContactsRequest, RicochetCore_MonitorContactsServer) error + AddContactRequest(context.Context, *ContactRequest) (*Contact, error) + UpdateContact(context.Context, *Contact) (*Contact, error) + DeleteContact(context.Context, *DeleteContactRequest) (*DeleteContactReply, error) + AcceptInboundRequest(context.Context, *ContactRequest) (*Contact, error) + RejectInboundRequest(context.Context, *ContactRequest) (*RejectInboundRequestReply, error) + StreamConversations(RicochetCore_StreamConversationsServer) error } func RegisterRicochetCoreServer(s *grpc.Server, srv RicochetCoreServer) { @@ -238,6 +373,161 @@ func _RicochetCore_StopNetwork_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _RicochetCore_GetIdentity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdentityRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RicochetCoreServer).GetIdentity(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ricochet.RicochetCore/GetIdentity", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RicochetCoreServer).GetIdentity(ctx, req.(*IdentityRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RicochetCore_MonitorContacts_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(MonitorContactsRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(RicochetCoreServer).MonitorContacts(m, &ricochetCoreMonitorContactsServer{stream}) +} + +type RicochetCore_MonitorContactsServer interface { + Send(*ContactEvent) error + grpc.ServerStream +} + +type ricochetCoreMonitorContactsServer struct { + grpc.ServerStream +} + +func (x *ricochetCoreMonitorContactsServer) Send(m *ContactEvent) error { + return x.ServerStream.SendMsg(m) +} + +func _RicochetCore_AddContactRequest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ContactRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RicochetCoreServer).AddContactRequest(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ricochet.RicochetCore/AddContactRequest", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RicochetCoreServer).AddContactRequest(ctx, req.(*ContactRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RicochetCore_UpdateContact_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(Contact) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RicochetCoreServer).UpdateContact(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ricochet.RicochetCore/UpdateContact", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RicochetCoreServer).UpdateContact(ctx, req.(*Contact)) + } + return interceptor(ctx, in, info, handler) +} + +func _RicochetCore_DeleteContact_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteContactRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RicochetCoreServer).DeleteContact(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ricochet.RicochetCore/DeleteContact", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RicochetCoreServer).DeleteContact(ctx, req.(*DeleteContactRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RicochetCore_AcceptInboundRequest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ContactRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RicochetCoreServer).AcceptInboundRequest(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ricochet.RicochetCore/AcceptInboundRequest", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RicochetCoreServer).AcceptInboundRequest(ctx, req.(*ContactRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RicochetCore_RejectInboundRequest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ContactRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RicochetCoreServer).RejectInboundRequest(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ricochet.RicochetCore/RejectInboundRequest", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RicochetCoreServer).RejectInboundRequest(ctx, req.(*ContactRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _RicochetCore_StreamConversations_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(RicochetCoreServer).StreamConversations(&ricochetCoreStreamConversationsServer{stream}) +} + +type RicochetCore_StreamConversationsServer interface { + Send(*ConversationEvent) error + Recv() (*ConversationEvent, error) + grpc.ServerStream +} + +type ricochetCoreStreamConversationsServer struct { + grpc.ServerStream +} + +func (x *ricochetCoreStreamConversationsServer) Send(m *ConversationEvent) error { + return x.ServerStream.SendMsg(m) +} + +func (x *ricochetCoreStreamConversationsServer) Recv() (*ConversationEvent, error) { + m := new(ConversationEvent) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + var _RicochetCore_serviceDesc = grpc.ServiceDesc{ ServiceName: "ricochet.RicochetCore", HandlerType: (*RicochetCoreServer)(nil), @@ -254,6 +544,30 @@ var _RicochetCore_serviceDesc = grpc.ServiceDesc{ MethodName: "StopNetwork", Handler: _RicochetCore_StopNetwork_Handler, }, + { + MethodName: "GetIdentity", + Handler: _RicochetCore_GetIdentity_Handler, + }, + { + MethodName: "AddContactRequest", + Handler: _RicochetCore_AddContactRequest_Handler, + }, + { + MethodName: "UpdateContact", + Handler: _RicochetCore_UpdateContact_Handler, + }, + { + MethodName: "DeleteContact", + Handler: _RicochetCore_DeleteContact_Handler, + }, + { + MethodName: "AcceptInboundRequest", + Handler: _RicochetCore_AcceptInboundRequest_Handler, + }, + { + MethodName: "RejectInboundRequest", + Handler: _RicochetCore_RejectInboundRequest_Handler, + }, }, Streams: []grpc.StreamDesc{ { @@ -261,27 +575,49 @@ var _RicochetCore_serviceDesc = grpc.ServiceDesc{ Handler: _RicochetCore_MonitorNetwork_Handler, ServerStreams: true, }, + { + StreamName: "MonitorContacts", + Handler: _RicochetCore_MonitorContacts_Handler, + ServerStreams: true, + }, + { + StreamName: "StreamConversations", + Handler: _RicochetCore_StreamConversations_Handler, + ServerStreams: true, + ClientStreams: true, + }, }, - Metadata: fileDescriptor0, + Metadata: fileDescriptor3, } -func init() { proto.RegisterFile("core.proto", fileDescriptor0) } +func init() { proto.RegisterFile("core.proto", fileDescriptor3) } -var fileDescriptor0 = []byte{ - // 236 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0x4a, 0xce, 0x2f, 0x4a, - 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x28, 0xca, 0x4c, 0xce, 0x4f, 0xce, 0x48, 0x2d, - 0x91, 0xe2, 0xcd, 0x4b, 0x2d, 0x29, 0xcf, 0x2f, 0xca, 0x86, 0x48, 0x28, 0x99, 0x72, 0x09, 0x07, - 0xa7, 0x16, 0x95, 0xa5, 0x16, 0x05, 0x97, 0x24, 0x96, 0x94, 0x16, 0x07, 0xa5, 0x16, 0x96, 0xa6, - 0x16, 0x97, 0x08, 0xc9, 0x71, 0x71, 0x15, 0x15, 0x24, 0x87, 0xa5, 0x16, 0x15, 0x67, 0xe6, 0xe7, - 0x49, 0x30, 0x2a, 0x30, 0x6a, 0xb0, 0x06, 0x21, 0x89, 0x28, 0x45, 0x72, 0x09, 0xa2, 0x6a, 0x2b, - 0xc8, 0xa9, 0x24, 0xa4, 0x49, 0x48, 0x85, 0x8b, 0xb7, 0x18, 0xac, 0x09, 0xa6, 0x84, 0x09, 0xa8, - 0x84, 0x33, 0x08, 0x55, 0xd0, 0x68, 0x27, 0x13, 0x17, 0x4f, 0x10, 0xd4, 0xb5, 0xce, 0x40, 0x1f, - 0x08, 0xf9, 0x72, 0xf1, 0xbb, 0xa7, 0x96, 0x20, 0x5b, 0x27, 0x24, 0xab, 0x07, 0xf3, 0x8f, 0x1e, - 0x16, 0xd7, 0x4b, 0x49, 0xe3, 0x92, 0x06, 0xb9, 0xd2, 0x87, 0x8b, 0xcf, 0x37, 0x3f, 0x2f, 0xb3, - 0x24, 0xbf, 0xc8, 0x0f, 0x12, 0x12, 0x42, 0xf2, 0x08, 0xe5, 0xa8, 0x32, 0x30, 0xf3, 0xc4, 0x11, - 0x0a, 0xa0, 0x32, 0x10, 0x03, 0x0d, 0x18, 0x85, 0xdc, 0xb8, 0x78, 0x80, 0xec, 0xa2, 0x12, 0x98, - 0x59, 0xc8, 0x2e, 0x43, 0x12, 0x27, 0x64, 0x92, 0x90, 0x0b, 0x17, 0x77, 0x70, 0x49, 0x7e, 0x01, - 0xcc, 0x18, 0x19, 0x64, 0x63, 0xe0, 0xc2, 0x84, 0x4c, 0x49, 0x62, 0x03, 0x47, 0xaa, 0x31, 0x20, - 0x00, 0x00, 0xff, 0xff, 0x19, 0x90, 0x5f, 0x9e, 0xfb, 0x01, 0x00, 0x00, +var fileDescriptor3 = []byte{ + // 414 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x9c, 0x54, 0x41, 0xaf, 0xd2, 0x40, + 0x10, 0x4e, 0x4d, 0x24, 0x3a, 0x50, 0x0c, 0x2b, 0x51, 0x2c, 0x88, 0x04, 0x3d, 0x70, 0x22, 0x44, + 0xc3, 0xcd, 0x83, 0xa4, 0xa8, 0x21, 0x11, 0x0f, 0x6d, 0x30, 0xf1, 0x58, 0xb6, 0x93, 0x58, 0xc5, + 0x6e, 0xdd, 0x0e, 0x18, 0x7e, 0xfd, 0x7b, 0x0b, 0xdd, 0xa5, 0x6d, 0x0a, 0x8f, 0x97, 0x77, 0x63, + 0xbf, 0xef, 0x9b, 0x6f, 0x67, 0x3e, 0x66, 0x0b, 0xc0, 0x85, 0xc4, 0x71, 0x22, 0x05, 0x09, 0xf6, + 0x44, 0x46, 0x5c, 0xf0, 0x5f, 0x48, 0x8e, 0x1d, 0x23, 0xfd, 0x17, 0xf2, 0x4f, 0x46, 0x38, 0xcd, + 0x28, 0xc4, 0x98, 0x22, 0xda, 0xeb, 0xb3, 0xcd, 0x45, 0x4c, 0x01, 0x27, 0x7d, 0x64, 0xea, 0xb8, + 0x43, 0x99, 0x06, 0x14, 0x89, 0x38, 0xc3, 0x86, 0x53, 0x78, 0xee, 0xa3, 0x54, 0xa8, 0x4f, 0x01, + 0x6d, 0x53, 0x0f, 0xff, 0x6d, 0x31, 0x25, 0xd6, 0x07, 0x90, 0x09, 0xff, 0xa1, 0xc4, 0x4a, 0xda, + 0xb1, 0x06, 0xd6, 0xe8, 0xb1, 0x57, 0x40, 0x86, 0x3f, 0xa1, 0x55, 0x2e, 0x4b, 0x36, 0xfb, 0x6b, + 0x45, 0xec, 0x1d, 0xd8, 0xe9, 0xb1, 0xc8, 0x48, 0x1e, 0x29, 0xc9, 0x53, 0xaf, 0x0c, 0xbe, 0xbf, + 0xa9, 0x41, 0xc3, 0xd3, 0x03, 0xba, 0x6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, 0x67, 0xce, 0x55, + 0x66, 0xbd, 0xf9, 0xea, 0xf9, 0x92, 0xc4, 0xe0, 0xaf, 0x5b, 0x78, 0xda, 0x29, 0xeb, 0x96, 0x5c, + 0x4f, 0xc4, 0xf1, 0x9f, 0x71, 0xee, 0x22, 0x47, 0xd6, 0xc4, 0x5a, 0xd7, 0x8e, 0x9f, 0x86, 0x0f, + 0xb7, 0x01, 0x00, 0x00, 0xff, 0xff, 0x7f, 0x06, 0xe1, 0xc6, 0x74, 0x04, 0x00, 0x00, } diff --git a/rpc/core.proto b/rpc/core.proto index b104067..8191bb5 100644 --- a/rpc/core.proto +++ b/rpc/core.proto @@ -2,13 +2,42 @@ syntax = "proto3"; package ricochet; import "network.proto"; +import "identity.proto"; +import "contact.proto"; +import "conversation.proto"; service RicochetCore { + // Query RPC server version and status rpc GetServerStatus (ServerStatusRequest) returns (ServerStatusReply); + // Open a stream to monitor changes to network status. The current + // NetworkStatus will be sent immediately, and the stream will receive a + // new NetworkStatus after any changes until the stream is closed. rpc MonitorNetwork (MonitorNetworkRequest) returns (stream NetworkStatus); + // Start connecting to the network. Before StartNetwork is called (by any + // client), the backend will not make any connections or appear online. + // This call blocks until the first connection attempt succeeds or fails, + // and returns the current network status, but connection attempts will + // continue unless this call returns an RPC error, or until StopNetwork + // is called. rpc StartNetwork (StartNetworkRequest) returns (NetworkStatus); + // Stop all network connections and go offline. Blocks until the network + // has been taken offline, and returns the new network status. rpc StopNetwork (StopNetworkRequest) returns (NetworkStatus); + + // XXX Config (tor, etc) + + // XXX Service status + rpc GetIdentity (IdentityRequest) returns (Identity); + + rpc MonitorContacts (MonitorContactsRequest) returns (stream ContactEvent); + rpc AddContactRequest (ContactRequest) returns (Contact); + rpc UpdateContact (Contact) returns (Contact); + rpc DeleteContact (DeleteContactRequest) returns (DeleteContactReply); + rpc AcceptInboundRequest (ContactRequest) returns (Contact); + rpc RejectInboundRequest (ContactRequest) returns (RejectInboundRequestReply); + + rpc StreamConversations (stream ConversationEvent) returns (stream ConversationEvent); } message ServerStatusRequest { diff --git a/rpc/identity.pb.go b/rpc/identity.pb.go new file mode 100644 index 0000000..28dc8dd --- /dev/null +++ b/rpc/identity.pb.go @@ -0,0 +1,48 @@ +// Code generated by protoc-gen-go. +// source: identity.proto +// DO NOT EDIT! + +package ricochet + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +type Identity struct { + Address string `protobuf:"bytes,1,opt,name=address" json:"address,omitempty"` +} + +func (m *Identity) Reset() { *m = Identity{} } +func (m *Identity) String() string { return proto.CompactTextString(m) } +func (*Identity) ProtoMessage() {} +func (*Identity) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{0} } + +type IdentityRequest struct { +} + +func (m *IdentityRequest) Reset() { *m = IdentityRequest{} } +func (m *IdentityRequest) String() string { return proto.CompactTextString(m) } +func (*IdentityRequest) ProtoMessage() {} +func (*IdentityRequest) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{1} } + +func init() { + proto.RegisterType((*Identity)(nil), "ricochet.Identity") + proto.RegisterType((*IdentityRequest)(nil), "ricochet.IdentityRequest") +} + +func init() { proto.RegisterFile("identity.proto", fileDescriptor4) } + +var fileDescriptor4 = []byte{ + // 95 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0xcb, 0x4c, 0x49, 0xcd, + 0x2b, 0xc9, 0x2c, 0xa9, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x28, 0xca, 0x4c, 0xce, + 0x4f, 0xce, 0x48, 0x2d, 0x51, 0x52, 0xe1, 0xe2, 0xf0, 0x84, 0xca, 0x09, 0x49, 0x70, 0xb1, 0x27, + 0xa6, 0xa4, 0x14, 0xa5, 0x16, 0x17, 0x4b, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x06, 0xc1, 0xb8, 0x4a, + 0x82, 0x5c, 0xfc, 0x30, 0x55, 0x41, 0xa9, 0x85, 0xa5, 0xa9, 0xc5, 0x25, 0x49, 0x6c, 0x60, 0x93, + 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xcc, 0xc7, 0x44, 0x6d, 0x5b, 0x00, 0x00, 0x00, +} diff --git a/rpc/identity.proto b/rpc/identity.proto new file mode 100644 index 0000000..1af92cc --- /dev/null +++ b/rpc/identity.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; +package ricochet; + +message Identity { + string address = 1; +} + +message IdentityRequest { +} diff --git a/rpc/network.pb.go b/rpc/network.pb.go index 76eda73..d0d0cea 100644 --- a/rpc/network.pb.go +++ b/rpc/network.pb.go @@ -38,7 +38,7 @@ var TorProcessStatus_Status_value = map[string]int32{ func (x TorProcessStatus_Status) String() string { return proto.EnumName(TorProcessStatus_Status_name, int32(x)) } -func (TorProcessStatus_Status) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{1, 0} } +func (TorProcessStatus_Status) EnumDescriptor() ([]byte, []int) { return fileDescriptor5, []int{1, 0} } type TorControlStatus_Status int32 @@ -65,7 +65,7 @@ var TorControlStatus_Status_value = map[string]int32{ func (x TorControlStatus_Status) String() string { return proto.EnumName(TorControlStatus_Status_name, int32(x)) } -func (TorControlStatus_Status) EnumDescriptor() ([]byte, []int) { return fileDescriptor1, []int{2, 0} } +func (TorControlStatus_Status) EnumDescriptor() ([]byte, []int) { return fileDescriptor5, []int{2, 0} } type TorConnectionStatus_Status int32 @@ -93,7 +93,7 @@ func (x TorConnectionStatus_Status) String() string { return proto.EnumName(TorConnectionStatus_Status_name, int32(x)) } func (TorConnectionStatus_Status) EnumDescriptor() ([]byte, []int) { - return fileDescriptor1, []int{3, 0} + return fileDescriptor5, []int{3, 0} } type MonitorNetworkRequest struct { @@ -102,7 +102,7 @@ type MonitorNetworkRequest struct { func (m *MonitorNetworkRequest) Reset() { *m = MonitorNetworkRequest{} } func (m *MonitorNetworkRequest) String() string { return proto.CompactTextString(m) } func (*MonitorNetworkRequest) ProtoMessage() {} -func (*MonitorNetworkRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } +func (*MonitorNetworkRequest) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{0} } type TorProcessStatus struct { Status TorProcessStatus_Status `protobuf:"varint,1,opt,name=status,enum=ricochet.TorProcessStatus_Status" json:"status,omitempty"` @@ -112,7 +112,7 @@ type TorProcessStatus struct { func (m *TorProcessStatus) Reset() { *m = TorProcessStatus{} } func (m *TorProcessStatus) String() string { return proto.CompactTextString(m) } func (*TorProcessStatus) ProtoMessage() {} -func (*TorProcessStatus) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} } +func (*TorProcessStatus) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{1} } type TorControlStatus struct { Status TorControlStatus_Status `protobuf:"varint,1,opt,name=status,enum=ricochet.TorControlStatus_Status" json:"status,omitempty"` @@ -123,17 +123,18 @@ type TorControlStatus struct { func (m *TorControlStatus) Reset() { *m = TorControlStatus{} } func (m *TorControlStatus) String() string { return proto.CompactTextString(m) } func (*TorControlStatus) ProtoMessage() {} -func (*TorControlStatus) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} } +func (*TorControlStatus) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{2} } type TorConnectionStatus struct { Status TorConnectionStatus_Status `protobuf:"varint,1,opt,name=status,enum=ricochet.TorConnectionStatus_Status" json:"status,omitempty"` BootstrapProgress string `protobuf:"bytes,10,opt,name=bootstrapProgress" json:"bootstrapProgress,omitempty"` + SocksAddress []string `protobuf:"bytes,11,rep,name=socksAddress" json:"socksAddress,omitempty"` } func (m *TorConnectionStatus) Reset() { *m = TorConnectionStatus{} } func (m *TorConnectionStatus) String() string { return proto.CompactTextString(m) } func (*TorConnectionStatus) ProtoMessage() {} -func (*TorConnectionStatus) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3} } +func (*TorConnectionStatus) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{3} } type NetworkStatus struct { Process *TorProcessStatus `protobuf:"bytes,1,opt,name=process" json:"process,omitempty"` @@ -144,7 +145,7 @@ type NetworkStatus struct { func (m *NetworkStatus) Reset() { *m = NetworkStatus{} } func (m *NetworkStatus) String() string { return proto.CompactTextString(m) } func (*NetworkStatus) ProtoMessage() {} -func (*NetworkStatus) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{4} } +func (*NetworkStatus) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{4} } func (m *NetworkStatus) GetProcess() *TorProcessStatus { if m != nil { @@ -173,7 +174,7 @@ type StartNetworkRequest struct { func (m *StartNetworkRequest) Reset() { *m = StartNetworkRequest{} } func (m *StartNetworkRequest) String() string { return proto.CompactTextString(m) } func (*StartNetworkRequest) ProtoMessage() {} -func (*StartNetworkRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{5} } +func (*StartNetworkRequest) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{5} } type StopNetworkRequest struct { } @@ -181,7 +182,7 @@ type StopNetworkRequest struct { func (m *StopNetworkRequest) Reset() { *m = StopNetworkRequest{} } func (m *StopNetworkRequest) String() string { return proto.CompactTextString(m) } func (*StopNetworkRequest) ProtoMessage() {} -func (*StopNetworkRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{6} } +func (*StopNetworkRequest) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{6} } func init() { proto.RegisterType((*MonitorNetworkRequest)(nil), "ricochet.MonitorNetworkRequest") @@ -196,35 +197,37 @@ func init() { proto.RegisterEnum("ricochet.TorConnectionStatus_Status", TorConnectionStatus_Status_name, TorConnectionStatus_Status_value) } -func init() { proto.RegisterFile("network.proto", fileDescriptor1) } +func init() { proto.RegisterFile("network.proto", fileDescriptor5) } -var fileDescriptor1 = []byte{ - // 431 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x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, 0x93, - 0xb4, 0xc8, 0x4a, 0xf4, 0xca, 0xca, 0x6d, 0x34, 0xb3, 0x6a, 0xeb, 0xa4, 0x27, 0x29, 0x7a, 0x09, - 0x90, 0x9c, 0x07, 0xe2, 0xb4, 0xca, 0xc4, 0x7b, 0xff, 0x9c, 0x17, 0xad, 0x24, 0xe0, 0x31, 0x8c, - 0x94, 0x57, 0xc8, 0xc6, 0x13, 0xb9, 0x0d, 0x28, 0x92, 0x3c, 0xab, 0x7b, 0x77, 0xed, 0xf2, 0x89, - 0x3d, 0xfd, 0x1d, 0x00, 0x00, 0xff, 0xff, 0xb1, 0xce, 0xd8, 0xfb, 0x73, 0x03, 0x00, 0x00, +var fileDescriptor5 = []byte{ + // 451 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x9c, 0x93, 0xcf, 0x6e, 0xd3, 0x40, + 0x10, 0xc6, 0xeb, 0x46, 0xa4, 0xcd, 0xa4, 0xae, 0xd2, 0x2d, 0x15, 0x16, 0x12, 0xa8, 0xac, 0x38, + 0x70, 0x40, 0x3e, 0x14, 0x2e, 0x48, 0xfc, 0x73, 0x13, 0x17, 0x45, 0xb4, 0x6b, 0x6b, 0xed, 0x82, + 0x38, 0xa6, 0xee, 0xaa, 0x44, 0x45, 0x1e, 0xb3, 0xbb, 0x15, 0xcf, 0xc5, 0x95, 0xc7, 0xe0, 0x25, + 0x78, 0x0d, 0xd6, 0xde, 0x4d, 0x64, 0x1b, 0x81, 0x50, 0x4f, 0xc9, 0xce, 0x7e, 0x33, 0x9e, 0xdf, + 0x37, 0xb3, 0xe0, 0x97, 0x42, 0x7f, 0x43, 0x79, 0x1d, 0x56, 0x12, 0x35, 0x92, 0x6d, 0xb9, 0x2c, + 0xb0, 0xf8, 0x2c, 0x34, 0xbd, 0x07, 0x07, 0x67, 0x58, 0x2e, 0x35, 0x4a, 0x66, 0x15, 0x5c, 0x7c, + 0xbd,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0x14, 0xf6, 0x2e, 0x10, 0xb5, 0xd2, 0x72, 0x51, 0x99, 0xb9, + 0x5d, 0x49, 0x83, 0xe3, 0xba, 0xff, 0xf3, 0xa2, 0x36, 0x42, 0x61, 0x71, 0xad, 0xa2, 0xcb, 0xcb, + 0x46, 0x38, 0x3e, 0x1c, 0xd4, 0x46, 0xb4, 0x63, 0xf4, 0x6d, 0x1b, 0xf4, 0x9c, 0xbd, 0x67, 0xc9, + 0x47, 0x66, 0x67, 0x97, 0x9c, 0x9c, 0x9c, 0xce, 0x59, 0x6c, 0x50, 0xf7, 0xc0, 0x3f, 0x4e, 0x92, + 0x3c, 0xcb, 0x79, 0x94, 0xa6, 0x96, 0xd6, 0x18, 0xc1, 0xe3, 0x68, 0xf6, 0xc9, 0x90, 0xfe, 0xf0, + 0xc0, 0x77, 0x5b, 0xe8, 0x2a, 0x3d, 0x87, 0xad, 0xca, 0x2e, 0x55, 0x03, 0x39, 0x3e, 0xba, 0xff, + 0xf7, 0x85, 0xe3, 0x2b, 0x69, 0x9d, 0x55, 0xd8, 0xb1, 0x36, 0x13, 0xeb, 0x67, 0x75, 0x46, 0xce, + 0x57, 0x52, 0xf2, 0x0a, 0xa0, 0x58, 0x9b, 0x16, 0x0c, 0x9a, 0xc4, 0x07, 0xff, 0xf4, 0x94, 0xb7, + 0x12, 0xe8, 0x01, 0xec, 0x9b, 0xa8, 0xd4, 0xbd, 0x67, 0x74, 0x17, 0x48, 0xa6, 0xb1, 0xea, 0x46, + 0x2f, 0x86, 0xcd, 0x33, 0x7c, 0xf6, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x78, 0x89, 0xf8, 0x34, 0x97, + 0x03, 0x00, 0x00, } diff --git a/rpc/network.proto b/rpc/network.proto index 7192a86..b7262a7 100644 --- a/rpc/network.proto +++ b/rpc/network.proto @@ -38,6 +38,7 @@ message TorConnectionStatus { Status status = 1; string bootstrapProgress = 10; + repeated string socksAddress = 11; } message NetworkStatus {