2016-08-02 02:58:10 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
package ricochet;
|
|
|
|
|
|
|
|
import "network.proto";
|
2016-08-17 00:43:39 +00:00
|
|
|
import "identity.proto";
|
|
|
|
import "contact.proto";
|
|
|
|
import "conversation.proto";
|
2016-08-02 02:58:10 +00:00
|
|
|
|
|
|
|
service RicochetCore {
|
2016-08-17 00:43:39 +00:00
|
|
|
// Query RPC server version and status
|
2016-08-02 02:58:10 +00:00
|
|
|
rpc GetServerStatus (ServerStatusRequest) returns (ServerStatusReply);
|
|
|
|
|
2016-08-17 00:43:39 +00:00
|
|
|
// 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.
|
2016-08-02 02:58:10 +00:00
|
|
|
rpc MonitorNetwork (MonitorNetworkRequest) returns (stream NetworkStatus);
|
2016-08-17 00:43:39 +00:00
|
|
|
// 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.
|
2016-08-02 02:58:10 +00:00
|
|
|
rpc StartNetwork (StartNetworkRequest) returns (NetworkStatus);
|
2016-08-17 00:43:39 +00:00
|
|
|
// Stop all network connections and go offline. Blocks until the network
|
|
|
|
// has been taken offline, and returns the new network status.
|
2016-08-02 02:58:10 +00:00
|
|
|
rpc StopNetwork (StopNetworkRequest) returns (NetworkStatus);
|
2016-08-17 00:43:39 +00:00
|
|
|
|
|
|
|
// 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);
|
2016-08-02 02:58:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message ServerStatusRequest {
|
|
|
|
int32 rpcVersion = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ServerStatusReply {
|
|
|
|
int32 rpcVersion = 1;
|
|
|
|
string serverVersion = 2;
|
|
|
|
}
|
|
|
|
|