@libp2p/gossipsub 16.0.5-e86b39e5d → 16.1.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/dist/index.min.js +1 -1
- package/dist/index.min.js.map +3 -3
- package/dist/src/gossipsub.d.ts +15 -0
- package/dist/src/gossipsub.d.ts.map +1 -1
- package/dist/src/gossipsub.js +53 -15
- package/dist/src/gossipsub.js.map +1 -1
- package/dist/typedoc-urls.json +195 -0
- package/package.json +9 -9
- package/src/gossipsub.ts +61 -16
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
{
|
|
2
|
+
"TopicValidatorResult": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub..TopicValidatorResult.html",
|
|
3
|
+
".:TopicValidatorResult": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub..TopicValidatorResult.html",
|
|
4
|
+
"GossipSub": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..GossipSub.html",
|
|
5
|
+
".:GossipSub": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..GossipSub.html",
|
|
6
|
+
"GossipSubComponents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..GossipSubComponents.html",
|
|
7
|
+
".:GossipSubComponents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..GossipSubComponents.html",
|
|
8
|
+
"GossipSubEvents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..GossipSubEvents.html",
|
|
9
|
+
".:GossipSubEvents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..GossipSubEvents.html",
|
|
10
|
+
"GossipsubMessage": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..GossipsubMessage.html",
|
|
11
|
+
".:GossipsubMessage": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..GossipsubMessage.html",
|
|
12
|
+
"GossipsubOpts": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..GossipsubOpts.html",
|
|
13
|
+
".:GossipsubOpts": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..GossipsubOpts.html",
|
|
14
|
+
"MeshPeer": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..MeshPeer.html",
|
|
15
|
+
".:MeshPeer": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..MeshPeer.html",
|
|
16
|
+
"PublishResult": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..PublishResult.html",
|
|
17
|
+
".:PublishResult": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..PublishResult.html",
|
|
18
|
+
"SignedMessage": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..SignedMessage.html",
|
|
19
|
+
".:SignedMessage": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..SignedMessage.html",
|
|
20
|
+
"Subscription": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..Subscription.html",
|
|
21
|
+
".:Subscription": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..Subscription.html",
|
|
22
|
+
"SubscriptionChangeData": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..SubscriptionChangeData.html",
|
|
23
|
+
".:SubscriptionChangeData": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..SubscriptionChangeData.html",
|
|
24
|
+
"TopicValidatorFn": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..TopicValidatorFn.html",
|
|
25
|
+
".:TopicValidatorFn": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..TopicValidatorFn.html",
|
|
26
|
+
"UnsignedMessage": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..UnsignedMessage.html",
|
|
27
|
+
".:UnsignedMessage": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub..UnsignedMessage.html",
|
|
28
|
+
"Message": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub..Message.html",
|
|
29
|
+
".:Message": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub..Message.html",
|
|
30
|
+
"SignaturePolicy": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub..SignaturePolicy.html",
|
|
31
|
+
".:SignaturePolicy": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub..SignaturePolicy.html",
|
|
32
|
+
"multicodec": "https://libp2p.github.io/js-libp2p/variables/_libp2p_gossipsub..multicodec.html",
|
|
33
|
+
".:multicodec": "https://libp2p.github.io/js-libp2p/variables/_libp2p_gossipsub..multicodec.html",
|
|
34
|
+
"StrictNoSign": "https://libp2p.github.io/js-libp2p/variables/_libp2p_gossipsub..StrictNoSign.html",
|
|
35
|
+
".:StrictNoSign": "https://libp2p.github.io/js-libp2p/variables/_libp2p_gossipsub..StrictNoSign.html",
|
|
36
|
+
"StrictSign": "https://libp2p.github.io/js-libp2p/variables/_libp2p_gossipsub..StrictSign.html",
|
|
37
|
+
".:StrictSign": "https://libp2p.github.io/js-libp2p/variables/_libp2p_gossipsub..StrictSign.html",
|
|
38
|
+
"gossipsub": "https://libp2p.github.io/js-libp2p/functions/_libp2p_gossipsub..gossipsub.html",
|
|
39
|
+
".:gossipsub": "https://libp2p.github.io/js-libp2p/functions/_libp2p_gossipsub..gossipsub.html",
|
|
40
|
+
"ControlGraftTopicIDFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlGraft.ControlGraftTopicIDFieldEvent.html",
|
|
41
|
+
"codec": "https://libp2p.github.io/js-libp2p/functions/_libp2p_gossipsub.message.RPC.ControlGraft.codec.html",
|
|
42
|
+
"decode": "https://libp2p.github.io/js-libp2p/functions/_libp2p_gossipsub.message.RPC.ControlGraft.decode.html",
|
|
43
|
+
"encode": "https://libp2p.github.io/js-libp2p/functions/_libp2p_gossipsub.message.RPC.ControlGraft.encode.html",
|
|
44
|
+
"stream": "https://libp2p.github.io/js-libp2p/functions/_libp2p_gossipsub.message.RPC.ControlGraft.stream.html",
|
|
45
|
+
"ControlIDontWantMessageIDsFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlIDontWant.ControlIDontWantMessageIDsFieldEvent.html",
|
|
46
|
+
"ControlIHaveMessageIDsFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlIHave.ControlIHaveMessageIDsFieldEvent.html",
|
|
47
|
+
"ControlIHaveTopicIDFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlIHave.ControlIHaveTopicIDFieldEvent.html",
|
|
48
|
+
"ControlIWantMessageIDsFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlIWant.ControlIWantMessageIDsFieldEvent.html",
|
|
49
|
+
"ControlMessageGraftTopicIDFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlMessage.ControlMessageGraftTopicIDFieldEvent.html",
|
|
50
|
+
"ControlMessageIdontwantMessageIDsFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlMessage.ControlMessageIdontwantMessageIDsFieldEvent.html",
|
|
51
|
+
"ControlMessageIhaveMessageIDsFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlMessage.ControlMessageIhaveMessageIDsFieldEvent.html",
|
|
52
|
+
"ControlMessageIhaveTopicIDFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlMessage.ControlMessageIhaveTopicIDFieldEvent.html",
|
|
53
|
+
"ControlMessageIwantMessageIDsFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlMessage.ControlMessageIwantMessageIDsFieldEvent.html",
|
|
54
|
+
"ControlMessagePruneBackoffFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlMessage.ControlMessagePruneBackoffFieldEvent.html",
|
|
55
|
+
"ControlMessagePrunePeersPeerIDFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlMessage.ControlMessagePrunePeersPeerIDFieldEvent.html",
|
|
56
|
+
"ControlMessagePrunePeersSignedPeerRecordFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlMessage.ControlMessagePrunePeersSignedPeerRecordFieldEvent.html",
|
|
57
|
+
"ControlMessagePruneTopicIDFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlMessage.ControlMessagePruneTopicIDFieldEvent.html",
|
|
58
|
+
"ControlPruneBackoffFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlPrune.ControlPruneBackoffFieldEvent.html",
|
|
59
|
+
"ControlPrunePeersPeerIDFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlPrune.ControlPrunePeersPeerIDFieldEvent.html",
|
|
60
|
+
"ControlPrunePeersSignedPeerRecordFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlPrune.ControlPrunePeersSignedPeerRecordFieldEvent.html",
|
|
61
|
+
"ControlPruneTopicIDFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlPrune.ControlPruneTopicIDFieldEvent.html",
|
|
62
|
+
"MessageDataFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.Message.MessageDataFieldEvent.html",
|
|
63
|
+
"MessageFromFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.Message.MessageFromFieldEvent.html",
|
|
64
|
+
"MessageKeyFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.Message.MessageKeyFieldEvent.html",
|
|
65
|
+
"MessageSeqnoFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.Message.MessageSeqnoFieldEvent.html",
|
|
66
|
+
"MessageSignatureFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.Message.MessageSignatureFieldEvent.html",
|
|
67
|
+
"MessageTopicFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.Message.MessageTopicFieldEvent.html",
|
|
68
|
+
"PeerInfoPeerIDFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.PeerInfo.PeerInfoPeerIDFieldEvent.html",
|
|
69
|
+
"PeerInfoSignedPeerRecordFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.PeerInfo.PeerInfoSignedPeerRecordFieldEvent.html",
|
|
70
|
+
"SubOptsSubscribeFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.SubOpts.SubOptsSubscribeFieldEvent.html",
|
|
71
|
+
"SubOptsTopicFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.SubOpts.SubOptsTopicFieldEvent.html",
|
|
72
|
+
"ControlGraft": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlGraft.html",
|
|
73
|
+
"ControlIDontWant": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlIDontWant.html",
|
|
74
|
+
"ControlIHave": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlIHave.html",
|
|
75
|
+
"ControlIWant": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlIWant.html",
|
|
76
|
+
"ControlMessage": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlMessage.html",
|
|
77
|
+
"ControlPrune": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.ControlPrune.html",
|
|
78
|
+
"PeerInfo": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.PeerInfo.html",
|
|
79
|
+
"RPCControlGraftTopicIDFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.RPCControlGraftTopicIDFieldEvent.html",
|
|
80
|
+
"RPCControlIdontwantMessageIDsFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.RPCControlIdontwantMessageIDsFieldEvent.html",
|
|
81
|
+
"RPCControlIhaveMessageIDsFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.RPCControlIhaveMessageIDsFieldEvent.html",
|
|
82
|
+
"RPCControlIhaveTopicIDFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.RPCControlIhaveTopicIDFieldEvent.html",
|
|
83
|
+
"RPCControlIwantMessageIDsFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.RPCControlIwantMessageIDsFieldEvent.html",
|
|
84
|
+
"RPCControlPruneBackoffFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.RPCControlPruneBackoffFieldEvent.html",
|
|
85
|
+
"RPCControlPrunePeersPeerIDFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.RPCControlPrunePeersPeerIDFieldEvent.html",
|
|
86
|
+
"RPCControlPrunePeersSignedPeerRecordFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.RPCControlPrunePeersSignedPeerRecordFieldEvent.html",
|
|
87
|
+
"RPCControlPruneTopicIDFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.RPCControlPruneTopicIDFieldEvent.html",
|
|
88
|
+
"RPCMessagesDataFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.RPCMessagesDataFieldEvent.html",
|
|
89
|
+
"RPCMessagesFromFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.RPCMessagesFromFieldEvent.html",
|
|
90
|
+
"RPCMessagesKeyFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.RPCMessagesKeyFieldEvent.html",
|
|
91
|
+
"RPCMessagesSeqnoFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.RPCMessagesSeqnoFieldEvent.html",
|
|
92
|
+
"RPCMessagesSignatureFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.RPCMessagesSignatureFieldEvent.html",
|
|
93
|
+
"RPCMessagesTopicFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.RPCMessagesTopicFieldEvent.html",
|
|
94
|
+
"RPCSubscriptionsSubscribeFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.RPCSubscriptionsSubscribeFieldEvent.html",
|
|
95
|
+
"RPCSubscriptionsTopicFieldEvent": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.RPCSubscriptionsTopicFieldEvent.html",
|
|
96
|
+
"SubOpts": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.SubOpts.html",
|
|
97
|
+
"RPC": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.message.RPC.html",
|
|
98
|
+
"ChurnReason": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.metrics.ChurnReason.html",
|
|
99
|
+
"./metrics:ChurnReason": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.metrics.ChurnReason.html",
|
|
100
|
+
"IHaveIgnoreReason": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.metrics.IHaveIgnoreReason.html",
|
|
101
|
+
"./metrics:IHaveIgnoreReason": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.metrics.IHaveIgnoreReason.html",
|
|
102
|
+
"InclusionReason": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.metrics.InclusionReason.html",
|
|
103
|
+
"./metrics:InclusionReason": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.metrics.InclusionReason.html",
|
|
104
|
+
"MessageSource": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.metrics.MessageSource.html",
|
|
105
|
+
"./metrics:MessageSource": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.metrics.MessageSource.html",
|
|
106
|
+
"ScorePenalty": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.metrics.ScorePenalty.html",
|
|
107
|
+
"./metrics:ScorePenalty": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.metrics.ScorePenalty.html",
|
|
108
|
+
"ScoreThreshold": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.metrics.ScoreThreshold.html",
|
|
109
|
+
"./metrics:ScoreThreshold": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.metrics.ScoreThreshold.html",
|
|
110
|
+
"AvgMinMax": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.metrics.AvgMinMax.html",
|
|
111
|
+
"./metrics:AvgMinMax": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.metrics.AvgMinMax.html",
|
|
112
|
+
"Gauge": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.metrics.Gauge.html",
|
|
113
|
+
"./metrics:Gauge": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.metrics.Gauge.html",
|
|
114
|
+
"Histogram": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.metrics.Histogram.html",
|
|
115
|
+
"./metrics:Histogram": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.metrics.Histogram.html",
|
|
116
|
+
"MetricsRegister": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.metrics.MetricsRegister.html",
|
|
117
|
+
"./metrics:MetricsRegister": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.metrics.MetricsRegister.html",
|
|
118
|
+
"ScoreWeights": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.metrics.ScoreWeights.html",
|
|
119
|
+
"./metrics:ScoreWeights": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.metrics.ScoreWeights.html",
|
|
120
|
+
"ToAddGroupCount": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.metrics.ToAddGroupCount.html",
|
|
121
|
+
"./metrics:ToAddGroupCount": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.metrics.ToAddGroupCount.html",
|
|
122
|
+
"TopicScoreWeights": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.metrics.TopicScoreWeights.html",
|
|
123
|
+
"./metrics:TopicScoreWeights": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.metrics.TopicScoreWeights.html",
|
|
124
|
+
"ToSendGroupCount": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.metrics.ToSendGroupCount.html",
|
|
125
|
+
"./metrics:ToSendGroupCount": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.metrics.ToSendGroupCount.html",
|
|
126
|
+
"AvgMinMaxConfig": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.metrics.AvgMinMaxConfig.html",
|
|
127
|
+
"./metrics:AvgMinMaxConfig": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.metrics.AvgMinMaxConfig.html",
|
|
128
|
+
"GaugeConfig": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.metrics.GaugeConfig.html",
|
|
129
|
+
"./metrics:GaugeConfig": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.metrics.GaugeConfig.html",
|
|
130
|
+
"HistogramConfig": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.metrics.HistogramConfig.html",
|
|
131
|
+
"./metrics:HistogramConfig": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.metrics.HistogramConfig.html",
|
|
132
|
+
"Metrics": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.metrics.Metrics.html",
|
|
133
|
+
"./metrics:Metrics": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.metrics.Metrics.html",
|
|
134
|
+
"PeersByScoreThreshold": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.metrics.PeersByScoreThreshold.html",
|
|
135
|
+
"./metrics:PeersByScoreThreshold": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.metrics.PeersByScoreThreshold.html",
|
|
136
|
+
"PromiseDeliveredStats": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.metrics.PromiseDeliveredStats.html",
|
|
137
|
+
"./metrics:PromiseDeliveredStats": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.metrics.PromiseDeliveredStats.html",
|
|
138
|
+
"TopicLabel": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.metrics.TopicLabel.html",
|
|
139
|
+
"./metrics:TopicLabel": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.metrics.TopicLabel.html",
|
|
140
|
+
"TopicStrToLabel": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.metrics.TopicStrToLabel.html",
|
|
141
|
+
"./metrics:TopicStrToLabel": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.metrics.TopicStrToLabel.html",
|
|
142
|
+
"getMetrics": "https://libp2p.github.io/js-libp2p/functions/_libp2p_gossipsub.metrics.getMetrics.html",
|
|
143
|
+
"./metrics:getMetrics": "https://libp2p.github.io/js-libp2p/functions/_libp2p_gossipsub.metrics.getMetrics.html",
|
|
144
|
+
"PeerScore": "https://libp2p.github.io/js-libp2p/classes/_libp2p_gossipsub.score.PeerScore.html",
|
|
145
|
+
"PeerScoreParams": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.score.PeerScoreParams.html",
|
|
146
|
+
"PeerScoreThresholds": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.score.PeerScoreThresholds.html",
|
|
147
|
+
"TopicScoreParams": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.score.TopicScoreParams.html",
|
|
148
|
+
"PeerScoreStatsDump": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.score.PeerScoreStatsDump.html",
|
|
149
|
+
"defaultPeerScoreParams": "https://libp2p.github.io/js-libp2p/variables/_libp2p_gossipsub.score.defaultPeerScoreParams.html",
|
|
150
|
+
"defaultPeerScoreThresholds": "https://libp2p.github.io/js-libp2p/variables/_libp2p_gossipsub.score.defaultPeerScoreThresholds.html",
|
|
151
|
+
"defaultTopicScoreParams": "https://libp2p.github.io/js-libp2p/variables/_libp2p_gossipsub.score.defaultTopicScoreParams.html",
|
|
152
|
+
"createPeerScoreParams": "https://libp2p.github.io/js-libp2p/functions/_libp2p_gossipsub.score.createPeerScoreParams.html",
|
|
153
|
+
"createPeerScoreThresholds": "https://libp2p.github.io/js-libp2p/functions/_libp2p_gossipsub.score.createPeerScoreThresholds.html",
|
|
154
|
+
"createTopicScoreParams": "https://libp2p.github.io/js-libp2p/functions/_libp2p_gossipsub.score.createTopicScoreParams.html",
|
|
155
|
+
"validatePeerScoreParams": "https://libp2p.github.io/js-libp2p/functions/_libp2p_gossipsub.score.validatePeerScoreParams.html",
|
|
156
|
+
"validatePeerScoreThresholds": "https://libp2p.github.io/js-libp2p/functions/_libp2p_gossipsub.score.validatePeerScoreThresholds.html",
|
|
157
|
+
"validateTopicScoreParams": "https://libp2p.github.io/js-libp2p/functions/_libp2p_gossipsub.score.validateTopicScoreParams.html",
|
|
158
|
+
"MessageStatus": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.types.MessageStatus.html",
|
|
159
|
+
"./types:MessageStatus": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.types.MessageStatus.html",
|
|
160
|
+
"PublishConfigType": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.types.PublishConfigType.html",
|
|
161
|
+
"./types:PublishConfigType": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.types.PublishConfigType.html",
|
|
162
|
+
"RejectReason": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.types.RejectReason.html",
|
|
163
|
+
"./types:RejectReason": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.types.RejectReason.html",
|
|
164
|
+
"./types:SignaturePolicy": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.types.SignaturePolicy.html",
|
|
165
|
+
"ValidateError": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.types.ValidateError.html",
|
|
166
|
+
"./types:ValidateError": "https://libp2p.github.io/js-libp2p/enums/_libp2p_gossipsub.types.ValidateError.html",
|
|
167
|
+
"AddrInfo": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.types.AddrInfo.html",
|
|
168
|
+
"./types:AddrInfo": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.types.AddrInfo.html",
|
|
169
|
+
"DataTransform": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.types.DataTransform.html",
|
|
170
|
+
"./types:DataTransform": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.types.DataTransform.html",
|
|
171
|
+
"FastMsgIdFn": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.types.FastMsgIdFn.html",
|
|
172
|
+
"./types:FastMsgIdFn": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.types.FastMsgIdFn.html",
|
|
173
|
+
"MessageId": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.types.MessageId.html",
|
|
174
|
+
"./types:MessageId": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.types.MessageId.html",
|
|
175
|
+
"MsgIdFn": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.types.MsgIdFn.html",
|
|
176
|
+
"./types:MsgIdFn": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.types.MsgIdFn.html",
|
|
177
|
+
"MsgIdToStrFn": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.types.MsgIdToStrFn.html",
|
|
178
|
+
"./types:MsgIdToStrFn": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.types.MsgIdToStrFn.html",
|
|
179
|
+
"PublishOpts": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.types.PublishOpts.html",
|
|
180
|
+
"./types:PublishOpts": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_gossipsub.types.PublishOpts.html",
|
|
181
|
+
"IPStr": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.types.IPStr.html",
|
|
182
|
+
"./types:IPStr": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.types.IPStr.html",
|
|
183
|
+
"MsgIdStr": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.types.MsgIdStr.html",
|
|
184
|
+
"./types:MsgIdStr": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.types.MsgIdStr.html",
|
|
185
|
+
"PeerIdStr": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.types.PeerIdStr.html",
|
|
186
|
+
"./types:PeerIdStr": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.types.PeerIdStr.html",
|
|
187
|
+
"PublishConfig": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.types.PublishConfig.html",
|
|
188
|
+
"./types:PublishConfig": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.types.PublishConfig.html",
|
|
189
|
+
"RejectReasonObj": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.types.RejectReasonObj.html",
|
|
190
|
+
"./types:RejectReasonObj": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.types.RejectReasonObj.html",
|
|
191
|
+
"TopicStr": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.types.TopicStr.html",
|
|
192
|
+
"./types:TopicStr": "https://libp2p.github.io/js-libp2p/types/_libp2p_gossipsub.types.TopicStr.html",
|
|
193
|
+
"rejectReasonFromAcceptance": "https://libp2p.github.io/js-libp2p/functions/_libp2p_gossipsub.types.rejectReasonFromAcceptance.html",
|
|
194
|
+
"./types:rejectReasonFromAcceptance": "https://libp2p.github.io/js-libp2p/functions/_libp2p_gossipsub.types.rejectReasonFromAcceptance.html"
|
|
195
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/gossipsub",
|
|
3
|
-
"version": "16.0
|
|
3
|
+
"version": "16.1.0",
|
|
4
4
|
"description": "A typescript implementation of gossipsub",
|
|
5
5
|
"files": [
|
|
6
6
|
"src",
|
|
@@ -79,11 +79,11 @@
|
|
|
79
79
|
},
|
|
80
80
|
"homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/gossipsub#readme",
|
|
81
81
|
"dependencies": {
|
|
82
|
-
"@libp2p/crypto": "5.1.21
|
|
83
|
-
"@libp2p/interface": "3.2.5
|
|
84
|
-
"@libp2p/interface-internal": "3.1.
|
|
85
|
-
"@libp2p/peer-id": "6.0.
|
|
86
|
-
"@libp2p/utils": "7.3.
|
|
82
|
+
"@libp2p/crypto": "^5.1.21",
|
|
83
|
+
"@libp2p/interface": "^3.2.5",
|
|
84
|
+
"@libp2p/interface-internal": "^3.1.10",
|
|
85
|
+
"@libp2p/peer-id": "^6.0.13",
|
|
86
|
+
"@libp2p/utils": "^7.3.1",
|
|
87
87
|
"@multiformats/multiaddr": "^13.0.3",
|
|
88
88
|
"denque": "^2.1.0",
|
|
89
89
|
"it-length-prefixed": "^11.0.1",
|
|
@@ -96,9 +96,9 @@
|
|
|
96
96
|
},
|
|
97
97
|
"devDependencies": {
|
|
98
98
|
"@chainsafe/as-sha256": "^1.2.0",
|
|
99
|
-
"@libp2p/floodsub": "11.0.
|
|
100
|
-
"@libp2p/logger": "6.2.
|
|
101
|
-
"@libp2p/peer-store": "12.0.
|
|
99
|
+
"@libp2p/floodsub": "^11.0.27",
|
|
100
|
+
"@libp2p/logger": "^6.2.11",
|
|
101
|
+
"@libp2p/peer-store": "^12.0.25",
|
|
102
102
|
"@types/benchmark": "^2.1.5",
|
|
103
103
|
"@types/sinon": "^22.0.0",
|
|
104
104
|
"abortable-iterator": "^5.1.0",
|
package/src/gossipsub.ts
CHANGED
|
@@ -972,6 +972,8 @@ export class GossipSub extends TypedEventEmitter<GossipSubEvents> implements Typ
|
|
|
972
972
|
// update peer subscriptions
|
|
973
973
|
|
|
974
974
|
const subscriptions: Array<{ topic: TopicStr, subscribe: boolean }> = []
|
|
975
|
+
const fromStr = from.toString()
|
|
976
|
+
const graftTopics: TopicStr[] = []
|
|
975
977
|
|
|
976
978
|
rpc.subscriptions.forEach((subOpt) => {
|
|
977
979
|
const topic = subOpt.topic
|
|
@@ -986,10 +988,21 @@ export class GossipSub extends TypedEventEmitter<GossipSubEvents> implements Typ
|
|
|
986
988
|
|
|
987
989
|
this.handleReceivedSubscription(from, topic, subscribe)
|
|
988
990
|
|
|
991
|
+
// graft the peer into the mesh now rather than waiting for the next
|
|
992
|
+
// heartbeat, so a message published right after subscribing is not dropped
|
|
993
|
+
if (subscribe && this.graftOnSubscribe(fromStr, topic)) {
|
|
994
|
+
graftTopics.push(topic)
|
|
995
|
+
}
|
|
996
|
+
|
|
989
997
|
subscriptions.push({ topic, subscribe })
|
|
990
998
|
}
|
|
991
999
|
})
|
|
992
1000
|
|
|
1001
|
+
// send one batched GRAFT covering every topic grafted while handling this RPC
|
|
1002
|
+
if (graftTopics.length > 0) {
|
|
1003
|
+
this.sendGraft(fromStr, graftTopics)
|
|
1004
|
+
}
|
|
1005
|
+
|
|
993
1006
|
this.safeDispatchEvent<SubscriptionChangeData>('subscription-change', {
|
|
994
1007
|
detail: { peerId: from, subscriptions }
|
|
995
1008
|
})
|
|
@@ -1539,10 +1552,7 @@ export class GossipSub extends TypedEventEmitter<GossipSubEvents> implements Typ
|
|
|
1539
1552
|
// valid graft
|
|
1540
1553
|
} else {
|
|
1541
1554
|
this.log('GRAFT: Add mesh link from %s in %s', id, topicID)
|
|
1542
|
-
this.
|
|
1543
|
-
peersInMesh.add(id)
|
|
1544
|
-
|
|
1545
|
-
this.metrics?.onAddToMesh(topicID, InclusionReason.Subscribed, 1)
|
|
1555
|
+
this.addToMesh(id, topicID, InclusionReason.Subscribed)
|
|
1546
1556
|
}
|
|
1547
1557
|
|
|
1548
1558
|
this.safeDispatchEvent<MeshPeer>('gossipsub:graft', { detail: { peerId: id, topic: topicID, direction: 'inbound' } })
|
|
@@ -1877,7 +1887,7 @@ export class GossipSub extends TypedEventEmitter<GossipSubEvents> implements Typ
|
|
|
1877
1887
|
|
|
1878
1888
|
toAdd.forEach((id) => {
|
|
1879
1889
|
this.log('JOIN: Add mesh link to %s in %s', id, topic)
|
|
1880
|
-
this.sendGraft(id, topic)
|
|
1890
|
+
this.sendGraft(id, [topic])
|
|
1881
1891
|
|
|
1882
1892
|
// rust-libp2p
|
|
1883
1893
|
// - peer_score.graft()
|
|
@@ -2276,16 +2286,55 @@ export class GossipSub extends TypedEventEmitter<GossipSubEvents> implements Typ
|
|
|
2276
2286
|
/**
|
|
2277
2287
|
* Sends a GRAFT message to a peer
|
|
2278
2288
|
*/
|
|
2279
|
-
private sendGraft (id: PeerIdStr,
|
|
2280
|
-
const graft =
|
|
2281
|
-
{
|
|
2282
|
-
topicID: topic
|
|
2283
|
-
}
|
|
2284
|
-
]
|
|
2289
|
+
private sendGraft (id: PeerIdStr, topics: string[]): void {
|
|
2290
|
+
const graft = topics.map((topicID) => ({ topicID }))
|
|
2285
2291
|
const out = createGossipRpc([], { graft })
|
|
2286
2292
|
this.sendRpc(id, out)
|
|
2287
2293
|
}
|
|
2288
2294
|
|
|
2295
|
+
/**
|
|
2296
|
+
* Add a peer to a topic mesh, updating peer score, mesh membership and metrics.
|
|
2297
|
+
* Sending the GRAFT is left to the caller: the heartbeat and graft-on-subscribe
|
|
2298
|
+
* send one, which dispatches the outbound gossipsub:graft event via sendRpc,
|
|
2299
|
+
* while the inbound GRAFT handler sends none and dispatches its own event.
|
|
2300
|
+
*/
|
|
2301
|
+
private addToMesh (id: PeerIdStr, topic: TopicStr, reason: InclusionReason): void {
|
|
2302
|
+
this.score.graft(id, topic)
|
|
2303
|
+
this.mesh.get(topic)?.add(id)
|
|
2304
|
+
this.metrics?.onAddToMesh(topic, reason, 1)
|
|
2305
|
+
}
|
|
2306
|
+
|
|
2307
|
+
/**
|
|
2308
|
+
* When a peer subscribes to a topic we are meshed on, graft it into the mesh
|
|
2309
|
+
* immediately if there is room, instead of waiting for the next heartbeat.
|
|
2310
|
+
* Without this, a message published before the mesh has formed is forwarded to
|
|
2311
|
+
* nobody and silently dropped. Returns true if the peer was grafted, so the
|
|
2312
|
+
* caller can send one batched GRAFT for every topic grafted from an RPC.
|
|
2313
|
+
*/
|
|
2314
|
+
private graftOnSubscribe (id: PeerIdStr, topic: TopicStr): boolean {
|
|
2315
|
+
const mesh = this.mesh.get(topic)
|
|
2316
|
+
|
|
2317
|
+
// only fill a mesh we belong to, and only while it is below the low-water mark
|
|
2318
|
+
if (mesh == null || mesh.has(id) || mesh.size >= this.opts.Dlo) {
|
|
2319
|
+
return false
|
|
2320
|
+
}
|
|
2321
|
+
|
|
2322
|
+
// require an outbound stream on one of our protocols, the same check the
|
|
2323
|
+
// heartbeat applies when selecting mesh peers
|
|
2324
|
+
const peerStreams = this.streamsOutbound.get(id)
|
|
2325
|
+
if (peerStreams == null || !this.protocols.includes(peerStreams.protocol)) {
|
|
2326
|
+
return false
|
|
2327
|
+
}
|
|
2328
|
+
|
|
2329
|
+
// do not graft direct peers, negatively scored peers or backed off peers
|
|
2330
|
+
if (this.direct.has(id) || this.score.score(id) < 0 || (this.backoff.get(topic)?.has(id) ?? false)) {
|
|
2331
|
+
return false
|
|
2332
|
+
}
|
|
2333
|
+
|
|
2334
|
+
this.addToMesh(id, topic, InclusionReason.Subscribed)
|
|
2335
|
+
return true
|
|
2336
|
+
}
|
|
2337
|
+
|
|
2289
2338
|
/**
|
|
2290
2339
|
* Sends a PRUNE message to a peer
|
|
2291
2340
|
*/
|
|
@@ -2752,13 +2801,9 @@ export class GossipSub extends TypedEventEmitter<GossipSubEvents> implements Typ
|
|
|
2752
2801
|
|
|
2753
2802
|
const graftPeer = (id: PeerIdStr, reason: InclusionReason): void => {
|
|
2754
2803
|
this.log('HEARTBEAT: Add mesh link to %s in %s', id, topic)
|
|
2755
|
-
|
|
2756
|
-
this.score.graft(id, topic)
|
|
2757
|
-
// add peer to mesh
|
|
2758
|
-
peers.add(id)
|
|
2804
|
+
this.addToMesh(id, topic, reason)
|
|
2759
2805
|
// when we add a new mesh peer, we don't want to gossip messages to it
|
|
2760
2806
|
peersToGossip.delete(id)
|
|
2761
|
-
this.metrics?.onAddToMesh(topic, reason, 1)
|
|
2762
2807
|
// add to tograft
|
|
2763
2808
|
const topics = tograft.get(id)
|
|
2764
2809
|
if (topics == null) {
|