forked from farcasterxyz/hub-monorepo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gossip.proto
80 lines (70 loc) · 1.94 KB
/
gossip.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
syntax = "proto3";
import "message.proto";
enum GossipVersion {
GOSSIP_VERSION_V1 = 0;
GOSSIP_VERSION_V1_1 = 1;
}
message GossipAddressInfo {
string address = 1;
uint32 family = 2;
uint32 port = 3;
string dns_name = 4;
}
message ContactInfoContentBody {
GossipAddressInfo gossip_address = 1;
GossipAddressInfo rpc_address = 2;
repeated string excluded_hashes = 3;
uint32 count = 4;
string hub_version = 5;
FarcasterNetwork network = 6;
string app_version = 7;
uint64 timestamp = 8;
}
message ContactInfoContent {
GossipAddressInfo gossip_address = 1;
GossipAddressInfo rpc_address = 2;
repeated string excluded_hashes = 3;
uint32 count = 4;
string hub_version = 5;
FarcasterNetwork network = 6;
string app_version = 7;
uint64 timestamp = 8;
ContactInfoContentBody body = 9;
bytes signature = 10; // Signature of the message digest
bytes signer = 11; // Public key of the peer that originated the contact info
optional bytes data_bytes = 12; // Optional alternative serialization used for signing
}
message PingMessageBody {
bytes ping_origin_peer_id = 1;
uint64 ping_timestamp = 2;
}
message AckMessageBody {
bytes ping_origin_peer_id = 1;
bytes ack_origin_peer_id = 2;
uint64 ping_timestamp = 3;
uint64 ack_timestamp = 4;
}
message NetworkLatencyMessage {
oneof body {
PingMessageBody ping_message = 2;
AckMessageBody ack_message = 3;
}
}
message MessageBundle {
bytes hash = 1;
repeated Message messages = 2;
}
message GossipMessage {
oneof content {
Message message = 1;
// Deprecated
// IdRegistryEvent id_registry_event = 2;
ContactInfoContent contact_info_content = 3;
NetworkLatencyMessage network_latency_message = 7;
MessageBundle message_bundle = 9;
}
repeated string topics = 4;
bytes peer_id = 5;
GossipVersion version = 6;
uint32 timestamp = 8; // Farcaster epoch timestamp in seconds when this message was first created
}