@libp2p/daemon-protocol 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +4 -0
- package/README.md +37 -0
- package/dist/src/index.d.ts +1528 -0
- package/dist/src/index.js +4449 -0
- package/package.json +133 -0
- package/src/index.d.ts +1528 -0
- package/src/index.js +4449 -0
- package/src/index.proto +175 -0
package/src/index.proto
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
message Request {
|
|
4
|
+
enum Type {
|
|
5
|
+
IDENTIFY = 0;
|
|
6
|
+
CONNECT = 1;
|
|
7
|
+
STREAM_OPEN = 2;
|
|
8
|
+
STREAM_HANDLER = 3;
|
|
9
|
+
DHT = 4;
|
|
10
|
+
LIST_PEERS = 5;
|
|
11
|
+
CONNMANAGER = 6;
|
|
12
|
+
DISCONNECT = 7;
|
|
13
|
+
PUBSUB = 8;
|
|
14
|
+
PEERSTORE = 9;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
required Type type = 1;
|
|
18
|
+
|
|
19
|
+
optional ConnectRequest connect = 2;
|
|
20
|
+
optional StreamOpenRequest streamOpen = 3;
|
|
21
|
+
optional StreamHandlerRequest streamHandler = 4;
|
|
22
|
+
optional DHTRequest dht = 5;
|
|
23
|
+
optional ConnManagerRequest connManager = 6;
|
|
24
|
+
optional DisconnectRequest disconnect = 7;
|
|
25
|
+
optional PSRequest pubsub = 8;
|
|
26
|
+
optional PeerstoreRequest peerStore = 9;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
message Response {
|
|
30
|
+
enum Type {
|
|
31
|
+
OK = 0;
|
|
32
|
+
ERROR = 1;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
required Type type = 1;
|
|
36
|
+
optional ErrorResponse error = 2;
|
|
37
|
+
optional StreamInfo streamInfo = 3;
|
|
38
|
+
optional IdentifyResponse identify = 4;
|
|
39
|
+
optional DHTResponse dht = 5;
|
|
40
|
+
repeated PeerInfo peers = 6;
|
|
41
|
+
optional PSResponse pubsub = 7;
|
|
42
|
+
optional PeerstoreResponse peerStore = 8;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
message IdentifyResponse {
|
|
46
|
+
required bytes id = 1;
|
|
47
|
+
repeated bytes addrs = 2;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
message ConnectRequest {
|
|
51
|
+
required bytes peer = 1;
|
|
52
|
+
repeated bytes addrs = 2;
|
|
53
|
+
optional int64 timeout = 3;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
message StreamOpenRequest {
|
|
57
|
+
required bytes peer = 1;
|
|
58
|
+
repeated string proto = 2;
|
|
59
|
+
optional int64 timeout = 3;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
message StreamHandlerRequest {
|
|
63
|
+
required bytes addr = 1;
|
|
64
|
+
repeated string proto = 2;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
message ErrorResponse {
|
|
68
|
+
required string msg = 1;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
message StreamInfo {
|
|
72
|
+
required bytes peer = 1;
|
|
73
|
+
required bytes addr = 2;
|
|
74
|
+
required string proto = 3;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
message DHTRequest {
|
|
78
|
+
enum Type {
|
|
79
|
+
FIND_PEER = 0;
|
|
80
|
+
FIND_PEERS_CONNECTED_TO_PEER = 1;
|
|
81
|
+
FIND_PROVIDERS = 2;
|
|
82
|
+
GET_CLOSEST_PEERS = 3;
|
|
83
|
+
GET_PUBLIC_KEY = 4;
|
|
84
|
+
GET_VALUE = 5;
|
|
85
|
+
SEARCH_VALUE = 6;
|
|
86
|
+
PUT_VALUE = 7;
|
|
87
|
+
PROVIDE = 8;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
required Type type = 1;
|
|
91
|
+
optional bytes peer = 2;
|
|
92
|
+
optional bytes cid = 3;
|
|
93
|
+
optional bytes key = 4;
|
|
94
|
+
optional bytes value = 5;
|
|
95
|
+
optional int32 count = 6;
|
|
96
|
+
optional int64 timeout = 7;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
message DHTResponse {
|
|
100
|
+
enum Type {
|
|
101
|
+
BEGIN = 0;
|
|
102
|
+
VALUE = 1;
|
|
103
|
+
END = 2;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
required Type type = 1;
|
|
107
|
+
optional PeerInfo peer = 2;
|
|
108
|
+
optional bytes value = 3;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
message PeerInfo {
|
|
112
|
+
required bytes id = 1;
|
|
113
|
+
repeated bytes addrs = 2;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
message ConnManagerRequest {
|
|
117
|
+
enum Type {
|
|
118
|
+
TAG_PEER = 0;
|
|
119
|
+
UNTAG_PEER = 1;
|
|
120
|
+
TRIM = 2;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
required Type type = 1;
|
|
124
|
+
|
|
125
|
+
optional bytes peer = 2;
|
|
126
|
+
optional string tag = 3;
|
|
127
|
+
optional int64 weight = 4;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
message DisconnectRequest {
|
|
131
|
+
required bytes peer = 1;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
message PSRequest {
|
|
135
|
+
enum Type {
|
|
136
|
+
GET_TOPICS = 0;
|
|
137
|
+
LIST_PEERS = 1;
|
|
138
|
+
PUBLISH = 2;
|
|
139
|
+
SUBSCRIBE = 3;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
required Type type = 1;
|
|
143
|
+
optional string topic = 2;
|
|
144
|
+
optional bytes data = 3;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
message PSMessage {
|
|
148
|
+
optional bytes from = 1;
|
|
149
|
+
optional bytes data = 2;
|
|
150
|
+
optional bytes seqno = 3;
|
|
151
|
+
repeated string topicIDs = 4;
|
|
152
|
+
optional bytes signature = 5;
|
|
153
|
+
optional bytes key = 6;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
message PSResponse {
|
|
157
|
+
repeated string topics = 1;
|
|
158
|
+
repeated bytes peerIDs = 2;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
message PeerstoreRequest {
|
|
162
|
+
enum Type {
|
|
163
|
+
GET_PROTOCOLS = 1;
|
|
164
|
+
GET_PEER_INFO = 2;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
required Type type = 1;
|
|
168
|
+
optional bytes id = 2;
|
|
169
|
+
repeated string protos = 3;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
message PeerstoreResponse {
|
|
173
|
+
optional PeerInfo peer = 1;
|
|
174
|
+
repeated string protos = 2;
|
|
175
|
+
}
|