File tree 1 file changed +9
-2
lines changed
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import { enrTree, wakuDnsDiscovery } from "@waku/dns-discovery";
17
17
import type {
18
18
CreateLibp2pOptions ,
19
19
FullNode ,
20
+ IMetadata ,
20
21
Libp2p ,
21
22
Libp2pComponents ,
22
23
LightNode ,
@@ -174,6 +175,10 @@ type PubsubService = {
174
175
pubsub ?: ( components : Libp2pComponents ) => GossipSub ;
175
176
} ;
176
177
178
+ type MetadataService = {
179
+ metadata ?: ( components : Libp2pComponents ) => IMetadata ;
180
+ } ;
181
+
177
182
export async function defaultLibp2p (
178
183
shardInfo ?: ShardInfo ,
179
184
wakuGossipSub ?: PubsubService [ "pubsub" ] ,
@@ -197,7 +202,9 @@ export async function defaultLibp2p(
197
202
? { pubsub : wakuGossipSub }
198
203
: { } ;
199
204
200
- const metadataService = shardInfo && wakuMetadata ( shardInfo ) ;
205
+ const metadataService : MetadataService = shardInfo
206
+ ? { metadata : wakuMetadata ( shardInfo ) }
207
+ : { } ;
201
208
202
209
return createLibp2p ( {
203
210
connectionManager : {
@@ -212,7 +219,7 @@ export async function defaultLibp2p(
212
219
agentVersion : userAgent ?? DefaultUserAgent
213
220
} ) ,
214
221
ping : pingService ( ) ,
215
- metadata : metadataService ,
222
+ ... metadataService ,
216
223
...pubsubService ,
217
224
...options ?. services
218
225
}
You can’t perform that action at this time.
0 commit comments