libp2p / specs

Technical specifications for the libp2p networking stack
https://libp2p.io
1.58k stars 275 forks source link

Specify transport interface #182

Open yusefnapora opened 5 years ago

yusefnapora commented 5 years ago

Right now we don't really have a spec for the transport interface. The archived original spec linked to the interface-transport repo, but that repo is quite javascript-focused, with Go marked as WIP.

I'd like to write up a minimal definition of a transport in a platform-agnostic way, which is something I'm not quite sure how to do yet. The go and js interfaces diverge a bit (for example, go has a CanDial method that js lacks), and it's likely that no single API will feel idiomatic in all languages libp2p is implemented in.

However, it seems like it should be possible to spec out the required capabilities of a transport, either as pseudo-code or by just enumerating them and describing in prose.

This doc could also be a place to precisely define the "connection" and "stream" abstractions, and a future work section could mention message-orientation and discussions around supporting unreliable transports.