https://github.com/realazthat/dfuse_firehose_python_example
https://github.com/realazthat/dfuse_firehose_python_example
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/realazthat/dfuse_firehose_python_example
- Owner: realazthat
- License: cc0-1.0
- Created: 2021-03-26T03:23:08.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-03-26T09:13:37.000Z (about 4 years ago)
- Last Synced: 2025-01-17T21:08:05.542Z (5 months ago)
- Language: Python
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Prerequisites
* bash, unix-like environment.
* python with asyncio at least.
* docker (for protoc).
* git (to get proto files).## Running the example
1. Start a virtual environment.
```bash
virtualenv .venv
```
2. Enter the virtual environment.```bash
source .venv/bin/activate
```
3. Install requirements.```bash
pip install -r requirements.txt
```
4. Generate protobuf python files.```bash
bash scripts/generate-protos.sh
```
5. Run the example.* Note that the example will create a directory `$PWD/cache`, which you should delete if you want to reset the example.
* Note that `$PWD/blocks/` and `$PWD/db_ops/` will grow extremely large with all the data.
```bash
FIREHOSE_AUTHPOINT=...
FIREHOSE_ENDPOINT=...
FIREHOSE_API_KEY=...
GRAPHQL_AUTHPOINT=...
GRAPHQL_ENDPOINT=...
GRAPHQL_API_KEY=...
PYTHONPATH=$PWD/src/python python -m dfuse_example \
--firehose_authpoint "$FIREHOSE_AUTHPOINT" \
--firehose_endpoint "$FIREHOSE_ENDPOINT" \
--firehose_api_key "$FIREHOSE_API_KEY" \
--graphql_authpoint "$GRAPHQL_AUTHPOINT" \
--graphql_endpoint "$GRAPHQL_ENDPOINT" \
--graphql_api_key "$GRAPHQL_API_KEY" \
--start_block_num 170843515 \
--accounts "playuplandme,upxtokenacct,communityupx"
```## Other things
* `bash scripts/format.sh` to format