libp2p / go-libp2p-pubsub

The PubSub implementation for go-libp2p
https://github.com/libp2p/specs/tree/master/pubsub
Other
322 stars 187 forks source link

Questions about RPC #193

Open rairyx opened 5 years ago

rairyx commented 5 years ago

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?

Stebalien commented 5 years ago

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

rairyx commented 5 years ago

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?

Stebalien commented 5 years ago

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.

rairyx commented 5 years ago

@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.