PEER PEER
|| ||
||------- handshake offer -----> ||
|| ||
|| <----- handshake offer ----||
|| ||
|| ||
|| ||
||------- handshake accept -----> ||
|| ||
|| <----- handshake accept ----||
|| ||
|| ||
|| ||
||------- open multiplexed stream -----> ||
|| ||
|| <----- open multiplexed stream ----||
|| ||
|| ||
||--MULTIFEED-/-HYPERCORE--|| ||--------BLOB-SYNC---------||
|| || || ||
||---HAVES--> || ||---HAVES--> ||
|| || || ||
|| <--HAVES---|| || <--HAVES---||
|| || || ||
||---WANTS--> || ||---WANTS--> ||
|| || || ||
|| <--WANTS---|| || <--WANTS---||
|| || || ||
||---DATA--> || ||---DATA--> ||
|| || || ||
|| <--DATA---|| || <--DATA---||
|| || || ||
|| .... || || ..... ||
|| || || ||
||---DATA--> || ||---DATA--> ||
|| || || ||
|| <--DATA---|| || <--DATA---||
|| || || ||
||-----------FIN-----------|| ||-----------FIN------------||
|| ||
||----------------------------FIN-----------------------------||
PEER PEER
|| ||
||------- handshake offer -----> ||
|| ||
|| <----- handshake offer ----||
|| ||
|| ||
|| ||
||------- handshake accept -----> ||
|| ||
|| <----- handshake accept ----||
|| ||
|| ||
|| ||
||------- open multiplexed stream -----> ||
|| ||
|| <----- open multiplexed stream ----||
|| ||
|| ||
||----------------------------RPC-----------------------------||
|| ||
||---QUERY-BLOBS--> ||
|| ||
|| <--BLOB-HAVES---||
|| ||
|| ... ||
|| ||
|| <--QUERY-BLOB---||
||---BLOBS-HAVES--> ||
|| ||
|| ... ||
|| ||
||---OPEN-MULTIFEED-STREAM--> ||
|| ||
|| <--ACCEPT---||
|| ||
|| (both sides open an additional stream ||
|| in addition to RPC stream) ||
|| ||
|| ||
||--MULTIFEED-/-HYPERCORE--|| ||-----------RPC------------||
|| || || || <-- regular RPC channel continues to function
||---HAVES--> || ||---QUERY-BLOBS--> ||
|| || || ||
|| <--HAVES---|| || <--BLOB-HAVES---||
|| || || ||
|| || || ... ||
||---WANTS--> || || ||
|| || ||---GET-BLOB--> ||
|| <--WANTS---|| || ||
|| || || <--DATA---||
||---DATA--> || || ||
|| || || ... ||
|| <--DATA---|| || ||
|| || ||---QUERY-BLOBS--> ||
|| .... || || ||
|| || || <--BLOB-HAVES---||
||---DATA--> || || ||
|| || || ... ||
|| <--DATA---|| || ||
|| || || <--GET-BLOB---||
||-----------FIN-----------|| || ||
||---DATA--> ||
|| ||
|| ... ||
|| ||
||-----STREAM KEPT OPEN-----||
^^^^ as many RPCs as the ^^^^
^^^^ peer wants, in both ^^^^
^^^^ directions ^^^^
^^^^ (no auto stream end) ^^^^
^^^^ (could open other ^^^^
^^^^ streams like blob ^^^^
^^^^ sync or another hyp- ^^^^
^^^^ -ercore sync ^^^^