mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-04-16 12:06:43 +08:00
* Atlas nodes are a lot like BitTorrent nodes, where the blockchain gets used to encode the sequence of zonefiles (chunks) a peer goes and fetches. * Atlas nodes discover each other from a set of seed nodes, and try to construct a K-regular network graph using a random walk through the peers neighbor relations. * Atlas nodes propagate peer information to each other in a "K-rarest known peers that are alive" fashion, to encourage even peer mixing. * Atlas nodes maintain a bitwise big-endian "zonefile inventory vector" where bit i is set if the ith NAME_UPDATE's associated zonefile has been obtained. * Atlas nodes exchange zonefile inventory vectors amongst their neighbors in an effort to find missing zonefiles. They obtain zonefiles in a rarest-first fashion--i.e. the first missing zonefile to fetch should be the one known by the least amount of neighbors. * Atlas nodes occasionally refresh inventory vectors with neighbors to ensure that knowledge of a zonefile propagates through the network. This is mostly untested code, save for what the unit tests at the end of the file cover. TODO: integrate with CircleCI