Re:Learn Blockchains by Building One
by kexari on Saturday September 30, 2017 @02:39PM
(#15374333)
Thanks for this. Any idea how to build a simple p2p network though (over the internet not local host) and make it decentralized? That’s the hardest part :p
[ Parent
| on HN ]
It's actually not that hard. Most blockchains use a variation of Gossip, which is quite trivial to implement. On startup, your nodes get a list of seed nodes, recursively ask for peer lists until they can connect to some "max peer count."
When they receive transactions (from a client, or a peer), they simply forward them to all other peers (if it's the first time they've seen them.)
That's basically it. :-)