Skip to content

Commit 2261d9c

Browse files
committed
Update package documentation
1 parent e93debb commit 2261d9c

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

substreams_firehose/__init__.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@
6565
with a substream you must first provide the right package file for that substream** (which is usually bundled in the releases \
6666
of the source code repo).
6767
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 \
7070
(see [`substreams_firehose/proto`](https://github.com/pinax-network/substreams_firehose/tree/main/substreams_firehose/proto)).
7171
7272
# Using the substreams_firehose CLI tool
@@ -266,7 +266,13 @@ def ethereum_processor(data: Message) -> Iterator[dict]:
266266
A utility function called `_filter_data` is available for applying the output fields filter set in the stub configuration file passed \
267267
as CLI argument.
268268
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:
270276
```json
271277
{
272278
"hash": "0x953ea1d1f6a0cf140b66645379859c6766f1a863eb75aa6b4c4045dfa434c6f3",
@@ -295,7 +301,9 @@ def ethereum_processor(data: Message) -> Iterator[dict]:
295301
[here](https://cointelegraph.com/news/wormhole-hacker-moves-another-46m-of-stolen-funds) \
296302
if you're interested ;)*
297303
304+
// TODO: talk about turning block processors into substreams
305+
298306
# Using substreams_firehose as a library
299307
300-
*TODO: talk about block extractors / processors*
308+
// TODO: talk about block extractors / processors
301309
"""

0 commit comments

Comments
 (0)