@@ -51,7 +51,8 @@ describe("getConnectedPeersForProtocolAndShard", function () {
51
51
peerExchange : true ,
52
52
clusterId : shardInfo . clusterId ,
53
53
pubsubTopic : shardInfoToPubsubTopics ( shardInfo ) ,
54
- lightpush : true
54
+ lightpush : true ,
55
+ relay : true
55
56
} ) ;
56
57
57
58
const serviceNodeMa = await serviceNode1 . getMultiaddrWithId ( ) ;
@@ -77,12 +78,18 @@ describe("getConnectedPeersForProtocolAndShard", function () {
77
78
shards : [ 1 ]
78
79
} ;
79
80
81
+ const shardInfoServiceNode : ShardInfo = {
82
+ clusterId : 1 ,
83
+ shards : [ 2 ]
84
+ } ;
85
+
80
86
await serviceNode1 . start ( {
81
87
discv5Discovery : true ,
82
88
peerExchange : true ,
83
- clusterId : shardInfo . clusterId ,
84
- pubsubTopic : shardInfoToPubsubTopics ( shardInfo ) ,
85
- lightpush : true
89
+ clusterId : shardInfoServiceNode . clusterId ,
90
+ pubsubTopic : shardInfoToPubsubTopics ( shardInfoServiceNode ) ,
91
+ lightpush : true ,
92
+ relay : true
86
93
} ) ;
87
94
88
95
const serviceNodeMa = await serviceNode1 . getMultiaddrWithId ( ) ;
@@ -120,7 +127,8 @@ describe("getConnectedPeersForProtocolAndShard", function () {
120
127
peerExchange : true ,
121
128
clusterId : shardInfo1 . clusterId ,
122
129
pubsubTopic : shardInfoToPubsubTopics ( shardInfo1 ) ,
123
- lightpush : true
130
+ lightpush : true ,
131
+ relay : true
124
132
} ) ;
125
133
126
134
// and another node in the same cluster cluster as our node
@@ -129,15 +137,16 @@ describe("getConnectedPeersForProtocolAndShard", function () {
129
137
peerExchange : true ,
130
138
clusterId : shardInfo2 . clusterId ,
131
139
pubsubTopic : shardInfoToPubsubTopics ( shardInfo2 ) ,
132
- lightpush : true
140
+ lightpush : true ,
141
+ relay : true
133
142
} ) ;
134
143
135
144
const serviceNode1Ma = await serviceNode1 . getMultiaddrWithId ( ) ;
136
145
const serviceNode2Ma = await serviceNode2 . getMultiaddrWithId ( ) ;
137
146
138
147
waku = await createLightNode ( { shardInfo : shardInfo2 } ) ;
139
- await waku . libp2p . dialProtocol ( serviceNode1Ma , LightPushCodec ) ;
140
- await waku . libp2p . dialProtocol ( serviceNode2Ma , LightPushCodec ) ;
148
+ await waku . dial ( serviceNode1Ma , [ Protocols . LightPush ] ) ;
149
+ await waku . dial ( serviceNode2Ma , [ Protocols . LightPush ] ) ;
141
150
142
151
await waku . start ( ) ;
143
152
await waitForRemotePeer ( waku , [ Protocols . LightPush ] ) ;
@@ -170,7 +179,8 @@ describe("getConnectedPeersForProtocolAndShard", function () {
170
179
peerExchange : true ,
171
180
clusterId : shardInfo1 . clusterId ,
172
181
pubsubTopic : shardInfoToPubsubTopics ( shardInfo1 ) ,
173
- lightpush : true
182
+ lightpush : true ,
183
+ relay : true
174
184
} ) ;
175
185
176
186
// and another node in the same cluster cluster as our node
@@ -180,15 +190,16 @@ describe("getConnectedPeersForProtocolAndShard", function () {
180
190
peerExchange : true ,
181
191
clusterId : shardInfo2 . clusterId ,
182
192
pubsubTopic : shardInfoToPubsubTopics ( shardInfo2 ) ,
183
- lightpush : true
193
+ lightpush : true ,
194
+ relay : true
184
195
} ) ;
185
196
186
197
const serviceNodeMa1 = await serviceNode1 . getMultiaddrWithId ( ) ;
187
198
const serviceNodeMa2 = await serviceNode2 . getMultiaddrWithId ( ) ;
188
199
189
200
waku = await createLightNode ( { shardInfo : shardInfo2 } ) ;
190
- await waku . libp2p . dialProtocol ( serviceNodeMa1 , LightPushCodec ) ;
191
- await waku . libp2p . dialProtocol ( serviceNodeMa2 , LightPushCodec ) ;
201
+ await waku . dial ( serviceNodeMa1 , [ Protocols . LightPush ] ) ;
202
+ await waku . dial ( serviceNodeMa2 , [ Protocols . LightPush ] ) ;
192
203
await waku . start ( ) ;
193
204
await waitForRemotePeer ( waku , [ Protocols . LightPush ] ) ;
194
205
0 commit comments