@@ -68,6 +68,11 @@ type Service interface {
6868 Publish (ctx context.Context , topic string , msg any )
6969
7070 // RegisterHandler registers a message handler for the specified runtime and topic kind.
71+ //
72+ // In addition, it triggers advertisement of the host's readiness to serve the specified topic,
73+ // allowing remote peers without existing connection to discover it.
74+ //
75+ // Ensure your server is indeed ready, to avoid advertising prematurely.
7176 RegisterHandler (topic string , handler Handler )
7277
7378 // BlockPeer blocks a specific peer from being used by the local node.
@@ -84,14 +89,11 @@ type Service interface {
8489
8590 // RegisterProtocolServer registers a protocol server for the given protocol.
8691 //
87- // Normally, registered protocol server should be also advertised (AdvertiseProtocol),
88- // so that remote peers find the host node.
89- RegisterProtocolServer (srv rpc.Server )
90-
91- // AdvertiseProtocol starts advertising the host as available for serving the specified protocol.
92+ // In addition, it triggers advertisement of the host's readiness to serve the specified protocol,
93+ // allowing remote peers without existing connection to discover it.
9294 //
93- // It should be called only after the protocol server is running and ready to serve .
94- AdvertiseProtocol ( p core. ProtocolID )
95+ // Ensure your server is indeed ready, to avoid advertising prematurely .
96+ RegisterProtocolServer ( srv rpc. Server )
9597
9698 // GetMinRepublishInterval returns the minimum republish interval that needs to be respected by
9799 // the caller when publishing the same message. If Publish is called for the same message more
0 commit comments