Closed hoh closed 2 years ago
No, this publishes, but on the receiving part we need to store who the emitter is.
The adress already get saved in the peers collections, in the format it has been passed as is (regular or multi addr).
e.g from my peer collections:
{ "_id" : ObjectId("5fda0af9ed41e3a6fc16d192"), "address" : "/ip4/51.159.57.71/tcp/4025/p2p/QmZkurbY2G2hWay59yiTgQNaQxHSNzKZFt2jbnwJhQcKgV", "type" : "P2P", "last_seen" : ISODate("2020-12-16T13:26:17.101Z") }
{ "_id" : ObjectId("5fda0af9ed41e3a6fc16d194"), "address" : "http://51.159.57.71:4024", "type" : "HTTP", "last_seen" : ISODate("2020-12-16T13:26:17.104Z") }
{ "_id" : ObjectId("5fda0ed9ed41e3a6fc19fe56"), "address" : "/ip4/35.210.233.95/tcp/4025/p2p/QmX8QLU4WsxJmSe3HT2kLqLrLWDLgMUPXHXw8jHNBkcYGX", "type" : "P2P", "last_seen" : ISODate("2020-12-16T13:42:49.294Z") }
{ "_id" : ObjectId("5fda0ed9ed41e3a6fc19fe58"), "address" : "http://35.210.233.95:4024", "type" : "HTTP", "last_seen" : ISODate("2020-12-16T13:42:49.298Z") }
@moshemalawach Did I misunderstood? did you want it saved somewhere else? Do we need to convert the type http to a multi address?
Yes, but it's not the emitter. And not necessarily for the http peers. We need to store the actual emitter on the pubsub side to verify:
@moshemalawach So the peer from the "from" field in the message. e.g: QmZkurbY2G2hWay59yiTgQNaQxHSNzKZFt2jbnwJhQcKgV. In multiaddr format: /p2/QmZkurbY2G2hWay59yiTgQNaQxHSNzKZFt2jbnwJhQcKgV
did I understood correctly?
Should I also save it in the peer collections? as the field 'from' or 'emitter' ?
This issue has been resolved a while ago I think.
When receiving an alive message from an node, it's multi-address should be kept in order to know what is published by what node.