moonstream/crawlers/mooncrawl
Andrey Dolgolev b548a5d19c Add correct datetime formating on dashboard worker. 2021-11-16 00:15:42 +02:00
..
mooncrawl Add correct datetime formating on dashboard worker. 2021-11-16 00:15:42 +02:00
.gitignore
.isort.cfg try except for init py to ignore humbug import 2021-11-09 10:22:13 +00:00
README.md
dev.sh dev.sh file for dev server api testing 2021-11-13 15:54:37 +00:00
mypy.ini
sample.env Service files for stats_worker.dashboard generate command 2021-11-14 18:44:58 +00:00
setup.py API endpoint for crawlers 2021-11-13 15:51:32 +00:00

README.md

Moonstream Crawlers

Installation

(Use Python 3)

pip install -e .

Database access and environment variables

Make sure that the MOONSTREAM_DB_URI environment variable is set as a Postgres connection string.

For a sample, view sample.env.

Crawlers

Ethereum Signature Database

This crawler retrieves Ethereum function signatures from the Ethereum Signature Database at https://4byte.directory.

Crawling ESD function signatures

python -m mooncrawl.esd --interval 0.3 functions

Crawling ESD event signatures

python -m mooncrawl.esd --interval 0.3 events

Ethereum contract registrar

This crawler scans new transactions for smart contract deployments and retrieves their deployment addresses from transaction receipts.

To run this crawler:

python -m mooncrawl.cli ethcrawler contracts update

Output is JSON list of pairs [..., (<transaction_hash>, <contract_address>), ...], so you can pipe to jq:

python -m mooncrawl.cli ethcrawler contracts update | jq .

You can also specify an output file:

python -m mooncrawl.cli ethcrawler contracts update -o new_contracts.json