arionum/node

ENHANCEMENT: move initial/boot peers list to config

Closed this issue · 1 comments

PROBLEM:
sanity.php ...
$f = file("https://www.arionum.com/peers.txt");

This makes the peers list dependent on a central domain arionum.com. The nodes should not be dependent on any calls to arionum.com.

SOLUTION:
Create an array in the main config file to allow someone to enter a list of known/custom peers. The sample config would have whats listed in https://www.arionum.com/peers.txt but would allow a user to change them.

CAVEATS:
Since users configs are not overwritten by updates, i think it does make sense to use https://www.arionum.com/peers.txt for now as the backup for a user that does not have this new config array set. The default should be to use the central domain but allow user to override it in config with custom list.

Starting development on this.

Relevant lines:

node/sanity.php

Lines 268 to 277 in 754017f

if ($total_peers == 0 && $_config['testnet'] == false) {
$i = 0;
echo "No peers found. Attempting to get peers from arionum.com\n";
$f = file("https://www.arionum.com/peers.txt");
shuffle($f);
// we can't connect to arionum.com
if (count($f) < 2) {
@unlink("tmp/sanity-lock");
die("Could not connect to arionum.com! Will try later!\n");
}