|
65 | 65 | with a substream you must first provide the right package file for that substream** (which is usually bundled in the releases \
|
66 | 66 | of the source code repo).
|
67 | 67 |
|
68 |
| -In both cases, you still need to have the `.proto` files definitions to be able to make requests and parse responses when communicating \ |
69 |
| -with an endpoint. A set of default *protobufs* are included with the tool to be used with the default endpoints provided \ |
| 68 | +In *Firehose*'s case, you still need to have the `.proto` files definitions to be able to make requests and parse responses when \ |
| 69 | +communicating with an endpoint. A set of default *protobufs* are included with the tool to be used with the default endpoints provided \ |
70 | 70 | (see [`substreams_firehose/proto`](https://github.com/pinax-network/substreams_firehose/tree/main/substreams_firehose/proto)).
|
71 | 71 |
|
72 | 72 | # Using the substreams_firehose CLI tool
|
@@ -266,7 +266,13 @@ def ethereum_processor(data: Message) -> Iterator[dict]:
|
266 | 266 | A utility function called `_filter_data` is available for applying the output fields filter set in the stub configuration file passed \
|
267 | 267 | as CLI argument.
|
268 | 268 |
|
269 |
| -Finally, we get the data that we want with the following format: |
| 269 | +To use our new block processor function with the tool, simply pass its name with the `--custom-processor` or `-p` argument: |
| 270 | +```console |
| 271 | +(.venv) $ python -m substreams_firehose 14128200 14128299 -g eth_mainnet -o eth.jsonl -s substreams_firehose/config/firehose/eth.hjson \ |
| 272 | +-p ethereum_processor |
| 273 | +``` |
| 274 | +
|
| 275 | +Finally, we get the data that we want in our `eth.jsonl` with the following format: |
270 | 276 | ```json
|
271 | 277 | {
|
272 | 278 | "hash": "0x953ea1d1f6a0cf140b66645379859c6766f1a863eb75aa6b4c4045dfa434c6f3",
|
@@ -295,7 +301,9 @@ def ethereum_processor(data: Message) -> Iterator[dict]:
|
295 | 301 | [here](https://cointelegraph.com/news/wormhole-hacker-moves-another-46m-of-stolen-funds) \
|
296 | 302 | if you're interested ;)*
|
297 | 303 |
|
| 304 | +// TODO: talk about turning block processors into substreams |
| 305 | +
|
298 | 306 | # Using substreams_firehose as a library
|
299 | 307 |
|
300 |
| -*TODO: talk about block extractors / processors* |
| 308 | +// TODO: talk about block extractors / processors |
301 | 309 | """
|
0 commit comments