go-libp2p-pubsub icon indicating copy to clipboard operation
go-libp2p-pubsub copied to clipboard

Questions about RPC

Open rairyx opened this issue 6 years ago • 4 comments

Regarding the RPC structure https://github.com/libp2p/specs/tree/master/pubsub#Implementations In what case would an RPC message include multiple content messages from multiple sources? How can one know the original sender of the RPC?

rairyx avatar Jul 04 '19 17:07 rairyx

Each Message in the RPC includes the peer ID of the peer that sent the message and a signature.

Stebalien avatar Jul 04 '19 20:07 Stebalien

Thanks @Stebalien I want to do some routing based on RPC instead Message before applying floodsub/gossipsub, is it possible? Sometimes the Message doesn't contain from field(omitted by the sender), how to distinguish different messages/RPC in this case?

rairyx avatar Jul 05 '19 18:07 rairyx

Thanks @Stebalien I want to do some routing based on RPC instead Message before applying floodsub/gossipsub, is it possible?

Yes? I'm not sure what you're asking.

Sometimes the Message doesn't contain from field(omitted by the sender), how to distinguish different messages/RPC in this case?

Messages must contain the from field.

Stebalien avatar Jul 05 '19 21:07 Stebalien

@Stebalien

Yes? I'm not sure what you're asking.

I'm wondering if one can relay the RPC message in whole to one random peer before publish the messages inside the RPC one by one to multiple peers as floodsub/gossipsub do.

Messages must contain the from field.

Isn't the from field optional as defined in rpc.proto? In case the sender want to hide its ID.

rairyx avatar Jul 06 '19 01:07 rairyx