forked from farcasterxyz/hub-monorepo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rpc.proto
128 lines (111 loc) · 5.18 KB
/
rpc.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
syntax = "proto3";
import "message.proto";
import "hub_event.proto";
import "request_response.proto";
import "username_proof.proto";
import "onchain_event.proto";
// Note about http-api annotations:
// The `httpServer.ts` class implements a HTTP API wrapper on top of this gRPC API.
// The annotations below are used to verify that all the HTTP API endpoints are implemented.
// If you are adding a new RPC method, if there needs to be a corresponding HTTP API endpoint,
// add the annotation to the method. @http-api: none means that there is no corresponding HTTP API
// If there is no annotation, we assume there is a corresponding HTTP API endpoint with the same name as the RPC method
// Please see `httpServer.ts` for more details
service HubService {
// Submit Methods
rpc SubmitMessage(Message) returns (Message);
// Validation Methods
rpc ValidateMessage(Message) returns (ValidationResponse);
// Event Methods
// @http-api: none
rpc Subscribe(SubscribeRequest) returns (stream HubEvent);
// @http-api: events
rpc GetEvent(EventRequest) returns (HubEvent);
// Casts
// @http-api: castById
rpc GetCast(CastId) returns (Message);
rpc GetCastsByFid(FidRequest) returns (MessagesResponse);
rpc GetCastsByParent(CastsByParentRequest) returns (MessagesResponse);
rpc GetCastsByMention(FidRequest) returns (MessagesResponse);
// Reactions
// @http-api: reactionById
rpc GetReaction(ReactionRequest) returns (Message);
rpc GetReactionsByFid(ReactionsByFidRequest) returns (MessagesResponse);
rpc GetReactionsByCast(ReactionsByTargetRequest) returns (MessagesResponse); // To be deprecated
rpc GetReactionsByTarget(ReactionsByTargetRequest) returns (MessagesResponse);
// User Data
// @http-api: none
rpc GetUserData(UserDataRequest) returns (Message);
rpc GetUserDataByFid(FidRequest) returns (MessagesResponse);
// Username Proof
// @http-api: userNameProofByName
rpc GetUsernameProof(UsernameProofRequest) returns (UserNameProof);
rpc GetUserNameProofsByFid(FidRequest) returns (UsernameProofsResponse);
// Verifications
// @http-api: none
rpc GetVerification(VerificationRequest) returns (Message);
rpc GetVerificationsByFid(FidRequest) returns (MessagesResponse);
// OnChain Events
// @http-api: none
rpc GetOnChainSigner(SignerRequest) returns (OnChainEvent);
rpc GetOnChainSignersByFid(FidRequest) returns (OnChainEventResponse);
// @http-api: none
rpc GetOnChainEvents(OnChainEventRequest) returns (OnChainEventResponse);
// @http-api: none
rpc GetIdRegistryOnChainEvent(FidRequest) returns (OnChainEvent);
// @http-api: onChainIdRegistryEventByAddress
rpc GetIdRegistryOnChainEventByAddress(IdRegistryEventByAddressRequest) returns (OnChainEvent);
// @http-api: storageLimitsByFid
rpc GetCurrentStorageLimitsByFid(FidRequest) returns (StorageLimitsResponse);
rpc GetFids(FidsRequest) returns (FidsResponse);
// Links
// @http-api: linkById
rpc GetLink(LinkRequest) returns (Message);
rpc GetLinksByFid(LinksByFidRequest) returns (MessagesResponse);
// @http-api: linksByTargetFid
rpc GetLinksByTarget(LinksByTargetRequest) returns (MessagesResponse);
// Bulk Methods
// The Bulk methods don't have corresponding HTTP API endpoints because the
// regular endpoints can be used to get all the messages
// @http-api: none
rpc GetAllCastMessagesByFid(FidTimestampRequest) returns (MessagesResponse);
// @http-api: none
rpc GetAllReactionMessagesByFid(FidTimestampRequest) returns (MessagesResponse);
// @http-api: none
rpc GetAllVerificationMessagesByFid(FidTimestampRequest) returns (MessagesResponse);
// @http-api: none
rpc GetAllUserDataMessagesByFid(FidTimestampRequest) returns (MessagesResponse);
// @http-api: none
rpc GetAllLinkMessagesByFid(FidTimestampRequest) returns (MessagesResponse);
// @http-api: none
rpc GetLinkCompactStateMessageByFid(FidRequest) returns (MessagesResponse);
// @http-api: none
rpc SubmitBulkMessages(SubmitBulkMessagesRequest) returns (SubmitBulkMessagesResponse);
// Sync Methods
rpc GetInfo(HubInfoRequest) returns (HubInfoResponse);
rpc GetCurrentPeers(Empty) returns (ContactInfoResponse);
// @http-api: none
rpc StopSync(Empty) returns (SyncStatusResponse);
// This is experimental, do not rely on this endpoint existing in the future
// @http-api: none
rpc ForceSync(SyncStatusRequest) returns (SyncStatusResponse);
// @http-api: none
rpc GetSyncStatus(SyncStatusRequest) returns (SyncStatusResponse);
// @http-api: none
rpc GetAllSyncIdsByPrefix(TrieNodePrefix) returns (SyncIds);
// @http-api: none
rpc GetAllMessagesBySyncIds(SyncIds) returns (MessagesResponse);
// @http-api: none
rpc GetSyncMetadataByPrefix(TrieNodePrefix) returns (TrieNodeMetadataResponse);
// @http-api: none
rpc GetSyncSnapshotByPrefix(TrieNodePrefix) returns (TrieNodeSnapshotResponse);
// @http-api: none
rpc StreamSync(stream StreamSyncRequest) returns (stream StreamSyncResponse);
// @http-api: none
rpc StreamFetch(stream StreamFetchRequest) returns (stream StreamFetchResponse);
}
service AdminService {
rpc RebuildSyncTrie(Empty) returns (Empty);
rpc DeleteAllMessagesFromDb(Empty) returns (Empty);
rpc SubmitOnChainEvent(OnChainEvent) returns (OnChainEvent);
}