Closed wanderingbort closed 1 year ago
This is quite awesome!
I spent some time this morning before my first meeting just experimenting with the code and connecting with our public p2p nodes. I managed to get connected, handshaking, then syncing/deserializing a handful of blocks in less than 30 minutes.
The possibilities this sort of connectivity offers from a JS context has my head spinning a bit, in the best way possible! Look forward to reviewing this more, and getting @jnordberg's perspective on it as well.
Thanks for the pointer to the browser tests @jnordberg they are green now 😄
I see the prettier failures... on it
Still had some Buffer references left, took the liberty to fix them. This is good to merge once you merge in my PR to your PR :D https://github.com/wanderingbort/eosio-core/pull/1
Published in version 0.6.9
This PR adds the wire types for the antelope P2P protocol as well as a basic client that can send P2P messages and an automated heartbeat (if desired).
Since there is no shared "socket" implementation between browsers and node environments, the client expects implementors to provide an implementation for the P2PProvider interface. This interface matches the node Socket type. However, the antelope P2P protocol over a TCP connection can arrive in-order but fragmented. There is a utility class provided that accepts/produces envelopes in the antelope P2P over TCP format and handles re-assembly.
A node specific example looks like this :