forked from TheBlueMatt/dnsseed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.txt
60 lines (48 loc) · 2.28 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
DB
--
The PDNS DB should be the default one according to the PDNS docs
http://doc.powerdns.com/generic-mypgsql-backends.html
Additionally, a low query-cache should be set so that new nodes are always
being returned, and gmysql-any-query should be set to
select content,ttl,prio,type,domain_id,name from records where name='%s' order by rand() limit 10
The bitcoin db should be as follows:
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
-- Database: `bitcoin`
CREATE TABLE IF NOT EXISTS `nodes` (
`ipv4` int(11) NOT NULL,
`port` smallint(5) unsigned NOT NULL DEFAULT '8333',
`last_check` timestamp NULL DEFAULT NULL,
`accepts_incoming` bit(1) NOT NULL DEFAULT b'0',
`version` int(11) DEFAULT NULL,
`last_seen` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`first_up` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`ipv4`,`port`),
KEY `last_check` (`last_check`),
KEY `last_seen` (`last_seen`)
);
Running
-------
To bootstrap call php bitcoin-scan.php (the ip of a known-good node)
ie
php bitcoin-scan.php `dig +short bluematt.me`
warning: this node will end up in the database, so call a node by its public ip
followed by repeated calls to php bitcoin-scan-net.php which will fill the dbs
quite quickly.
bitcoin-scan-net.php should also be put on an appropriate cron job, checking
to make sure it isnt already running (which would just duplicate effort)
Bugs/Todo/etc
-------------
TODO: I didnt bother with setting up PDNS to simply pull from the bitcoin db, which
is probably more ideal than its own separate db simply becaues I already have a pdns
db and server configured.
This could be achieved using the appropriate gmysql-*-query settings in pdns.conf