2014-04-18 23:30:19 -05:00
|
|
|
# btc-crawl
|
2014-04-18 23:07:31 -05:00
|
|
|
|
|
|
|
Bitcoin node network crawler (written in golang).
|
2014-04-18 23:26:47 -05:00
|
|
|
|
|
|
|
This is a for-fun project to explore the Bitcoin protocol and network.
|
|
|
|
|
2014-04-25 21:54:24 -05:00
|
|
|
Current status:
|
2014-05-14 17:49:32 -05:00
|
|
|
* JSON streaming is in place, and graceful shutdown.
|
|
|
|
* ~~It crawls with all kinds of nice parameters but stores everything in memory
|
|
|
|
until dumping a giant JSON blob at the end.~~
|
2014-04-25 21:54:45 -05:00
|
|
|
* ~~It crawls from hard-coded values and spits a bunch of stuff to
|
2014-04-25 21:54:24 -05:00
|
|
|
stdout.~~
|
2014-04-18 23:29:36 -05:00
|
|
|
|
2014-04-18 23:30:19 -05:00
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
2014-04-18 23:29:36 -05:00
|
|
|
```
|
|
|
|
$ go get github.com/shazow/btc-crawl
|
2014-04-25 22:00:45 -05:00
|
|
|
$ btc-crawl --help
|
|
|
|
...
|
2014-05-19 17:30:18 -05:00
|
|
|
$ btc-crawl \
|
|
|
|
--concurrency=100 \
|
|
|
|
--output="btc-crawl.json" \
|
|
|
|
--peer-age="24h" \
|
|
|
|
--user-agent="/batman:1.0/" \
|
|
|
|
--verbose
|
2014-04-18 23:29:36 -05:00
|
|
|
...
|
|
|
|
```
|
2014-04-18 23:30:19 -05:00
|
|
|
|
2014-04-25 22:02:09 -05:00
|
|
|
**Estimated crawl time:** Unknown.
|
2014-04-25 22:00:17 -05:00
|
|
|
|
|
|
|
There should be under 10,000 active network nodes at any given time, according
|
2014-04-25 22:00:57 -05:00
|
|
|
to [bitnodes.io](https://getaddr.bitnodes.io/). Each node returns around ~2,500
|
2014-04-25 22:00:17 -05:00
|
|
|
known nodes, but usually only several have timestamps within the last hour.
|
|
|
|
|
2014-04-18 23:30:19 -05:00
|
|
|
|
|
|
|
## Todo
|
|
|
|
|
2014-04-25 21:54:24 -05:00
|
|
|
(In approximate order of priority)
|
|
|
|
|
2014-05-14 17:49:32 -05:00
|
|
|
* Namespace useful sub-packages properly (outside of `main`)
|
2014-05-19 17:30:18 -05:00
|
|
|
* Fix `go build -race` race condition warnings. (Not sure if this is feasible. `golog` and other
|
2014-05-19 17:14:24 -05:00
|
|
|
fundamental pieces seem to trigger warnings possibly erroneously.)
|
2014-05-19 17:30:18 -05:00
|
|
|
* Tests would be nice.
|
2014-04-25 22:01:43 -05:00
|
|
|
|
|
|
|
|
|
|
|
## License
|
|
|
|
|
|
|
|
MIT (see LICENSE file).
|