@leofcoin/peernet 0.10.8 → 0.11.2
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 +1 -1
- package/README.md +49 -49
- package/coverage/lcov-report/block-navigation.js +8 -0
- package/coverage/lcov-report/codec-format-interface.js.html +224 -120
- package/coverage/lcov-report/dht-response.js.html +44 -39
- package/coverage/lcov-report/index.html +39 -64
- package/coverage/lcov-report/sorter.js +26 -0
- package/coverage/lcov.info +164 -424
- package/dist/browser/326.peernet.js +29 -0
- package/dist/browser/peernet.js +84258 -95769
- package/dist/commonjs/client-1a1f75e6.js +324 -0
- package/dist/commonjs/{codec-6367213c.js → codec-8c8c652f.js} +198 -188
- package/dist/commonjs/codec-format-interface.js +169 -152
- package/dist/commonjs/codec.js +4 -4
- package/dist/commonjs/dht-response.js +13 -13
- package/dist/commonjs/dht.js +24 -24
- package/dist/commonjs/hash.js +151 -141
- package/dist/commonjs/{http-a94c5a81.js → http-4bc6caeb.js} +19 -15
- package/dist/commonjs/peernet-message.js +15 -15
- package/dist/commonjs/peernet.js +1901 -1794
- package/dist/commonjs/request.js +13 -13
- package/dist/commonjs/response.js +13 -13
- package/dist/module/peernet.js +2462 -2348
- package/index.html +5 -7
- package/package.json +22 -14
- package/rollup.config.js +33 -5
- package/rollup0.config.js +7 -0
- package/src/client.js +75 -75
- package/src/codec/codec-format-interface.js +172 -155
- package/src/codec/codec.js +124 -114
- package/src/codec/codecs.js +79 -79
- package/src/dht/dht.js +121 -121
- package/src/discovery/peer-discovery.js +75 -75
- package/src/handlers/message.js +50 -52
- package/src/hash/hash.js +155 -145
- package/src/http/client/http-client.js +44 -44
- package/src/messages/chat-message.js +14 -14
- package/src/messages/data-response.js +14 -14
- package/src/messages/data.js +18 -18
- package/src/messages/dht-response.js +14 -15
- package/src/messages/dht.js +25 -25
- package/src/messages/peer-response.js +14 -14
- package/src/messages/peer.js +14 -14
- package/src/messages/peernet-message.js +14 -14
- package/src/messages/ps.js +14 -14
- package/src/messages/request.js +14 -14
- package/src/messages/response.js +14 -14
- package/src/peer.js +67 -67
- package/src/peernet.js +614 -697
- package/src/proto/chat-message.proto.js +7 -7
- package/src/proto/peernet.proto.js +2 -2
- package/src/utils/utils.js +78 -78
- package/test/codec.js +3 -2
- package/test/messages.js +7 -4
- package/test.js +11 -4
- package/webpack.config.js +41 -0
- package/coverage/lcov-report/codec.js.html +0 -677
- package/coverage/lcov-report/hash.js.html +0 -551
- package/debug.log +0 -3
- package/dist/browser/peernet.js.tmp-browserify-14074318104595318069 +0 -0
- package/dist/browser/peernet.js.tmp-browserify-45407634493269122267 +0 -0
- package/dist/browser/peernet.js.tmp-browserify-53722389064799025427 +0 -0
- package/dist/browser/peernet.js.tmp-browserify-96323030449218949300 +0 -0
- package/dist/codec/codec-format-interface.js +0 -433
- package/dist/codec/codec.js +0 -199
- package/dist/commonjs/codec-73adfc0f.js +0 -205
- package/dist/commonjs/http-2c603501.js +0 -324
- package/dist/commonjs/http-42a6e555.js +0 -324
- package/dist/commonjs/http-43f4fafe.js +0 -324
- package/dist/commonjs/peernet-message-b6925673.js +0 -32
- package/dist/hash/hash.js +0 -340
- package/dist/messages/dht-response.js +0 -454
- package/dist/messages/dht.js +0 -453
- package/dist/messages/peernet.js +0 -456
- package/dist/module/http-273664bd.js +0 -317
- package/dist/module/http-8fe3c0d7.js +0 -317
- package/dist/module/http-c780c991.js +0 -317
- package/dist/module/http-f13e0d77.js +0 -317
package/dist/commonjs/hash.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
var createKeccakHash = require('keccak');
|
|
4
4
|
var varint = require('varint');
|
|
5
|
-
var bs32 = require('
|
|
6
|
-
var bs58 = require('
|
|
7
|
-
var isHex = require('is-hex');
|
|
8
|
-
var codec = require('./codec-
|
|
5
|
+
var bs32 = require('@vandeurenglenn/base32');
|
|
6
|
+
var bs58 = require('@vandeurenglenn/base58');
|
|
7
|
+
var isHex = require('@vandeurenglenn/is-hex');
|
|
8
|
+
var codec = require('./codec-8c8c652f.js');
|
|
9
9
|
|
|
10
10
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
11
|
|
|
@@ -15,143 +15,153 @@ var bs32__default = /*#__PURE__*/_interopDefaultLegacy(bs32);
|
|
|
15
15
|
var bs58__default = /*#__PURE__*/_interopDefaultLegacy(bs58);
|
|
16
16
|
var isHex__default = /*#__PURE__*/_interopDefaultLegacy(isHex);
|
|
17
17
|
|
|
18
|
-
class PeernetHash {
|
|
19
|
-
constructor(buffer, options = {}) {
|
|
20
|
-
if (options.name) this.name = options.name;
|
|
21
|
-
else this.name = 'disco-hash';
|
|
22
|
-
if (options.codecs) this.codecs = options.codecs;
|
|
23
|
-
if (buffer) {
|
|
24
|
-
if (Buffer.isBuffer(buffer)) {
|
|
25
|
-
this.discoCodec = new codec.PeernetCodec(buffer, this.codecs);
|
|
26
|
-
const name = this.discoCodec.name;
|
|
27
|
-
|
|
28
|
-
if (name) {
|
|
29
|
-
this.name = name;
|
|
30
|
-
this.decode(buffer);
|
|
31
|
-
} else {
|
|
32
|
-
this.encode(buffer);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
if (typeof buffer === 'string') {
|
|
37
|
-
if (isHex__default["default"](buffer)) this.fromHex(buffer);
|
|
38
|
-
if (bs32__default["default"].
|
|
39
|
-
else this.fromBs58(buffer);
|
|
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
|
-
this.
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
this.
|
|
100
|
-
|
|
101
|
-
this.
|
|
102
|
-
this.
|
|
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
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
this.
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
18
|
+
class PeernetHash {
|
|
19
|
+
constructor(buffer, options = {}) {
|
|
20
|
+
if (options.name) this.name = options.name;
|
|
21
|
+
else this.name = 'disco-hash';
|
|
22
|
+
if (options.codecs) this.codecs = options.codecs;
|
|
23
|
+
if (buffer) {
|
|
24
|
+
if (Buffer.isBuffer(buffer)) {
|
|
25
|
+
this.discoCodec = new codec.PeernetCodec(buffer, this.codecs);
|
|
26
|
+
const name = this.discoCodec.name;
|
|
27
|
+
|
|
28
|
+
if (name) {
|
|
29
|
+
this.name = name;
|
|
30
|
+
this.decode(buffer);
|
|
31
|
+
} else {
|
|
32
|
+
this.encode(buffer);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (typeof buffer === 'string') {
|
|
37
|
+
if (isHex__default["default"](buffer)) this.fromHex(buffer);
|
|
38
|
+
if (bs32__default["default"].isBase32(buffer)) this.fromBs32(buffer);
|
|
39
|
+
else if (bs58__default["default"].isBase58(buffer)) this.fromBs58(buffer);
|
|
40
|
+
else throw new Error(`unsupported string ${buffer}`)
|
|
41
|
+
} else if (typeof buffer === 'object') this.fromJSON(buffer);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
get prefix() {
|
|
46
|
+
const length = this.length;
|
|
47
|
+
const uint8Array = new Uint8Array(length.length + this.discoCodec.codecBuffer.length);
|
|
48
|
+
for (let i = 0; i < this.discoCodec.codecBuffer.length; i++) {
|
|
49
|
+
uint8Array[i] = this.discoCodec.codecBuffer[i];
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
for (let i = uint8Array.length - 1; i < length.length; i++) {
|
|
53
|
+
uint8Array[i] = length[i];
|
|
54
|
+
}
|
|
55
|
+
return uint8Array
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
get length() {
|
|
59
|
+
return varint__default["default"].encode(this.size)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
get buffer() {
|
|
63
|
+
return this.hash
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
toHex() {
|
|
67
|
+
return this.hash.toString('hex')
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
fromHex(hex) {
|
|
71
|
+
return this.decode(Buffer.from(hex, 'hex'))
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
fromJSON(json) {
|
|
75
|
+
return this.encode(Buffer.from(JSON.stringify(json)))
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
toBs32() {
|
|
79
|
+
return bs32__default["default"].encode(this.hash)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
fromBs32(bs) {
|
|
83
|
+
return this.decode(bs32__default["default"].decode(bs))
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
toBs58() {
|
|
87
|
+
return bs58__default["default"].encode(this.hash)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
fromBs58(bs) {
|
|
91
|
+
return this.decode(bs58__default["default"].decode(bs))
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
toString(encoding = 'utf8') {
|
|
95
|
+
return this.hash.toString(encoding)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
encode(buffer, name) {
|
|
99
|
+
if (!this.name && name) this.name = name;
|
|
100
|
+
if (!buffer) buffer = this.buffer;
|
|
101
|
+
this.discoCodec = new codec.PeernetCodec(this.name, this.codecs);
|
|
102
|
+
this.discoCodec.fromName(this.name);
|
|
103
|
+
let hashAlg = this.discoCodec.hashAlg;
|
|
104
|
+
if (hashAlg.includes('dbl')) {
|
|
105
|
+
hashAlg = hashAlg.replace('dbl-', '');
|
|
106
|
+
buffer = createKeccakHash__default["default"](hashAlg.replace('-', '')).update(buffer).digest();
|
|
107
|
+
}
|
|
108
|
+
this.digest = createKeccakHash__default["default"](hashAlg.replace('-', '')).update(buffer).digest();
|
|
109
|
+
this.size = this.digest.length;
|
|
110
|
+
|
|
111
|
+
this.codec = this.discoCodec.encode();
|
|
112
|
+
this.codec = this.discoCodec.codecBuffer;
|
|
113
|
+
this.hash = Buffer.concat([
|
|
114
|
+
this.prefix,
|
|
115
|
+
this.digest,
|
|
116
|
+
]);
|
|
117
|
+
|
|
118
|
+
return this.hash
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
validate(buffer) {
|
|
122
|
+
if (Buffer.isBuffer(buffer)) {
|
|
123
|
+
const codec = varint__default["default"].decode(buffer);
|
|
124
|
+
if (this.codecs[codec]) {
|
|
125
|
+
this.decode(buffer);
|
|
126
|
+
} else {
|
|
127
|
+
this.encode(buffer);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
if (typeof buffer === 'string') {
|
|
131
|
+
if (isHex__default["default"](buffer)) this.fromHex(buffer);
|
|
132
|
+
if (bs32__default["default"].test(buffer)) this.fromBs32(buffer);
|
|
133
|
+
}
|
|
134
|
+
if (typeof buffer === 'object') this.fromJSON(buffer);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
decode(buffer) {
|
|
138
|
+
this.hash = buffer;
|
|
139
|
+
const codec$1 = varint__default["default"].decode(buffer);
|
|
140
|
+
|
|
141
|
+
this.discoCodec = new codec.PeernetCodec(codec$1, this.codecs);
|
|
142
|
+
// TODO: validate codec
|
|
143
|
+
buffer = buffer.slice(varint__default["default"].decode.bytes);
|
|
144
|
+
this.size = varint__default["default"].decode(buffer);
|
|
145
|
+
this.digest = buffer.slice(varint__default["default"].decode.bytes);
|
|
146
|
+
if (this.digest.length !== this.size) {
|
|
147
|
+
throw new Error(`hash length inconsistent: 0x${this.hash.toString('hex')}`)
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// const discoCodec = new Codec(codec, this.codecs)
|
|
151
|
+
|
|
152
|
+
this.name = this.discoCodec.name;
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
this.size = this.digest.length;
|
|
156
|
+
|
|
157
|
+
return {
|
|
158
|
+
codec: this.codec,
|
|
159
|
+
name: this.name,
|
|
160
|
+
size: this.size,
|
|
161
|
+
length: this.length,
|
|
162
|
+
digest: this.digest,
|
|
163
|
+
}
|
|
164
|
+
}
|
|
155
165
|
}
|
|
156
166
|
|
|
157
167
|
module.exports = PeernetHash;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var Pubsub = require('@vandeurenglenn/little-pubsub');
|
|
4
3
|
var websocket = require('websocket');
|
|
4
|
+
var PubSub = require('@vandeurenglenn/little-pubsub');
|
|
5
5
|
var http$1 = require('http');
|
|
6
6
|
var Koa = require('koa');
|
|
7
7
|
|
|
8
8
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var PubSub__default = /*#__PURE__*/_interopDefaultLegacy(PubSub);
|
|
11
11
|
var Koa__default = /*#__PURE__*/_interopDefaultLegacy(Koa);
|
|
12
12
|
|
|
13
|
-
var version = "0.
|
|
13
|
+
var version = "0.11.1";
|
|
14
14
|
|
|
15
15
|
var api$1 = {
|
|
16
16
|
version: ({send}) => send({client: '@peernet/api/http', version}),
|
|
@@ -173,12 +173,15 @@ var socketResponse = (connection, url, id, customEvent) => {
|
|
|
173
173
|
}
|
|
174
174
|
};
|
|
175
175
|
|
|
176
|
+
if (!globalThis.PubSub) globalThis.PubSub = PubSub__default["default"];
|
|
177
|
+
if (!globalThis.pubsub) globalThis.pubsub = new PubSub__default["default"]();
|
|
178
|
+
|
|
176
179
|
const socketRequestServer = (options, routes = {}) => {
|
|
177
180
|
// if (!routes && !routes.port && options) routes = options;
|
|
178
181
|
// else if (!options && !routes) return console.error('no routes defined');
|
|
179
182
|
|
|
180
183
|
let {httpServer, httpsServer, port, protocol, credentials, origin, pubsub } = options;
|
|
181
|
-
if (!pubsub) pubsub = new
|
|
184
|
+
if (!pubsub) pubsub = new PubSub__default["default"]({verbose: false});
|
|
182
185
|
if (!port) port = 6000;
|
|
183
186
|
const connections = [];
|
|
184
187
|
let connection;
|
|
@@ -195,12 +198,12 @@ const socketRequestServer = (options, routes = {}) => {
|
|
|
195
198
|
response = params;
|
|
196
199
|
params = {};
|
|
197
200
|
}
|
|
198
|
-
|
|
201
|
+
|
|
199
202
|
if (!params.topic) params.topic = 'pubsub';
|
|
200
|
-
|
|
203
|
+
|
|
201
204
|
const topic = params.topic;
|
|
202
205
|
delete params.topic;
|
|
203
|
-
|
|
206
|
+
|
|
204
207
|
if (params.subscribe) {
|
|
205
208
|
pubsub.subscribe(topic, message => {
|
|
206
209
|
response.connection.send(JSON.stringify({url: topic, status: 200, value: message}));
|
|
@@ -225,7 +228,7 @@ const socketRequestServer = (options, routes = {}) => {
|
|
|
225
228
|
pubsub.publish(topic, params.value);
|
|
226
229
|
response.send('ok', 200);
|
|
227
230
|
};
|
|
228
|
-
|
|
231
|
+
|
|
229
232
|
}
|
|
230
233
|
globalThis.peerMap = new Map();
|
|
231
234
|
if (!routes.peernet) {
|
|
@@ -282,10 +285,10 @@ const socketRequestServer = (options, routes = {}) => {
|
|
|
282
285
|
// ignore api when customEvent is defined
|
|
283
286
|
if (customEvent) return;
|
|
284
287
|
if (routes[url]) {
|
|
285
|
-
if (!params) return routes[url](socketResponse(connection, url, id));
|
|
286
|
-
return routes[url](params, socketResponse(connection, url, id));
|
|
288
|
+
if (!params) return routes[url](socketResponse(connection, url, id), connections);
|
|
289
|
+
return routes[url](params, socketResponse(connection, url, id), connections);
|
|
287
290
|
}
|
|
288
|
-
else return socketResponse(connection, url, id).error(`
|
|
291
|
+
else return socketResponse(connection, url, id).error(`no handler found for '${message.url}'`);
|
|
289
292
|
};
|
|
290
293
|
|
|
291
294
|
connection.on('message', routeHandler);
|
|
@@ -295,7 +298,8 @@ const socketRequestServer = (options, routes = {}) => {
|
|
|
295
298
|
close: () => socketServer.shutDown(),
|
|
296
299
|
connections
|
|
297
300
|
};
|
|
298
|
-
};
|
|
301
|
+
};
|
|
302
|
+
var server = socketRequestServer;
|
|
299
303
|
|
|
300
304
|
var http = (config = {}) => {
|
|
301
305
|
if (typeof config !== 'object') config = {};
|
|
@@ -303,7 +307,7 @@ var http = (config = {}) => {
|
|
|
303
307
|
if (!config.port) config.port = 2000;
|
|
304
308
|
if (!config.host) config.host = '127.0.0.1';
|
|
305
309
|
|
|
306
|
-
const app = new Koa__default[
|
|
310
|
+
const app = new Koa__default["default"]();
|
|
307
311
|
|
|
308
312
|
app.use(async (ctx) => {
|
|
309
313
|
const url = ctx.url.split('/api/')[1];
|
|
@@ -318,7 +322,7 @@ var http = (config = {}) => {
|
|
|
318
322
|
console.log(`listening on ${config.port}`);
|
|
319
323
|
});
|
|
320
324
|
|
|
321
|
-
return
|
|
325
|
+
return server(config, api$1)
|
|
322
326
|
};
|
|
323
327
|
|
|
324
|
-
exports
|
|
328
|
+
exports["default"] = http;
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
var protons = require('protons');
|
|
4
4
|
var codecFormatInterface = require('./codec-format-interface.js');
|
|
5
|
-
require('
|
|
6
|
-
require('
|
|
7
|
-
require('is-hex');
|
|
8
|
-
require('./codec-
|
|
5
|
+
require('@vandeurenglenn/base32');
|
|
6
|
+
require('@vandeurenglenn/base58');
|
|
7
|
+
require('@vandeurenglenn/is-hex');
|
|
8
|
+
require('./codec-8c8c652f.js');
|
|
9
9
|
require('varint');
|
|
10
10
|
require('./hash.js');
|
|
11
11
|
require('keccak');
|
|
@@ -19,20 +19,20 @@ var proto = `
|
|
|
19
19
|
message PeernetMessage {
|
|
20
20
|
required bytes data = 1;
|
|
21
21
|
required bytes signature = 2;
|
|
22
|
-
optional
|
|
23
|
-
optional
|
|
22
|
+
optional string from = 3;
|
|
23
|
+
optional string to = 4;
|
|
24
24
|
optional string id = 5;
|
|
25
25
|
}`;
|
|
26
26
|
|
|
27
|
-
class PeernetMessage extends codecFormatInterface {
|
|
28
|
-
get keys() {
|
|
29
|
-
return ['data', 'signature', 'from', 'to', 'id']
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
constructor(buffer) {
|
|
33
|
-
const name = 'peernet-message';
|
|
34
|
-
super(buffer, protons__default["default"](proto).PeernetMessage, {name});
|
|
35
|
-
}
|
|
27
|
+
class PeernetMessage extends codecFormatInterface {
|
|
28
|
+
get keys() {
|
|
29
|
+
return ['data', 'signature', 'from', 'to', 'id']
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
constructor(buffer) {
|
|
33
|
+
const name = 'peernet-message';
|
|
34
|
+
super(buffer, protons__default["default"](proto).PeernetMessage, {name});
|
|
35
|
+
}
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
module.exports = PeernetMessage;
|