pallas/examples/crawler
Pi Lanningham e1504a2463
feat: add a simple Crawler example (#453)
While working on Amaru, we'll likely want to grab lots of example data. This adds a small utility to easily grab one block, one tx, or blocks/txs matching some predicate
2024-05-08 20:11:13 -03:00
..
src feat: add a simple Crawler example (#453) 2024-05-08 20:11:13 -03:00
.gitignore feat: add a simple Crawler example (#453) 2024-05-08 20:11:13 -03:00
Cargo.toml feat: add a simple Crawler example (#453) 2024-05-08 20:11:13 -03:00
README.md feat: add a simple Crawler example (#453) 2024-05-08 20:11:13 -03:00

Crawler

This small example serves both as an example for consuming the chainsync protocol, and a small utility you can customize for one-off crawling tasks.

By filling in the implementaiton of block_matches or tx_matches, you can easily save any blocks or txs that match some predicate.

The provided example saves any blocks that have a protocol update request, either at the block level (in byron eras) or the transaction level (in later eras). This was useful in acquiring test data from different environments for Amaru development, for example.

By replacing that predicate, or implementing the tx predicate, you can crawl the chain for your own needs.