Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Indexer Services #160

Merged
merged 7 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,29 @@ extract:
docker compose run extractors uv run python main.py configs/arbitrum_mainnet.yaml
docker compose run extractors uv run python main.py configs/arbitrum_sepolia.yaml

index:
docker compose run indexer --network_name base_mainnet --protocol_name synthetix
docker compose run indexer --network_name arbitrum_mainnet --protocol_name synthetix
listener-start:
docker compose up -d indexer-listener

listener-stop:
docker compose down indexer-listener

index-start:
docker compose -f docker-compose.indexers.yml up -d

index-stop:
docker compose -f docker-compose.indexers.yml down

synths:
docker compose run transformer python scripts/get_synths.py
docker compose run transformer uv run python scripts/get_synths.py

dbt: build
docker compose run transformer dbt run --target prod --profiles-dir profiles --profile synthetix
docker compose run transformer dbt run --target prod --profiles-dir profiles --profile clickhouse

seed-prod: build
docker compose run transformer dbt seed --target prod --profiles-dir profiles --profile synthetix
docker compose run transformer dbt seed --target prod --profiles-dir profiles --profile clickhouse

seed-dev: build
docker compose run transformer dbt seed --target dev --profiles-dir profiles --profile synthetix
docker compose run transformer dbt seed --target dev --profiles-dir profiles --profile clickhouse

dbt-op: build
docker compose run transformer dbt run --target prod-op --profiles-dir profiles --profile synthetix
docker compose run transformer dbt run --target prod-op --profiles-dir profiles --profile clickhouse
37 changes: 37 additions & 0 deletions docker-compose.indexers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
services:
indexer-eth-mainnet-synthetix:
build:
context: ./indexers
dockerfile: Dockerfile
restart: always
networks:
- data
env_file:
- .env
environment:
- NETWORK_NAME=eth_mainnet
- PROTOCOL_NAME=synthetix
volumes:
- ./parquet-data:/parquet-data
- ./indexers/logs/indexer-gen/eth-mainnet/synthetix:/app/logs

indexer-base-mainnet-synthetix:
build:
context: ./indexers
dockerfile: Dockerfile
restart: always
networks:
- data
env_file:
- .env
environment:
- NETWORK_NAME=base_mainnet
- PROTOCOL_NAME=synthetix
volumes:
- ./parquet-data:/parquet-data
- ./indexers/logs/indexer-gen/base-mainnet/synthetix:/app/logs

networks:
data:
name: data_data
external: true
19 changes: 2 additions & 17 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ services:
limits:
cpus: "4.0"
memory: 8192M

db:
image: ghcr.io/synthetixio/data/postgres:${VERSION}
restart: always
Expand All @@ -42,22 +43,6 @@ services:
cpus: "4.0"
memory: 8192M

indexer:
build:
context: ./indexers
dockerfile: Dockerfile
networks:
- data
restart: always
env_file:
- .env
environment:
NETWORK_NAME: base_mainnet
PROTOCOL_NAME: synthetix
volumes:
- ./parquet-data:/parquet-data
- ./indexers/logs/indexer:/app/logs

indexer-listener:
build:
context: ./indexers
Expand All @@ -69,7 +54,7 @@ services:
PYTHONUNBUFFERED: 1
volumes:
- ./parquet-data:/parquet-data
- ./indexers/logs/listener:/app/logs
- ./indexers/logs/indexer-listener:/app/logs

transformer:
image: ghcr.io/synthetixio/data/transformer:${VERSION}
Expand Down
4 changes: 2 additions & 2 deletions indexers/networks/eth_mainnet/network_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ network:
network_id: 1
archive_url: "https://v2.archive.subsquid.io/network/ethereum-mainnet"

configs:
protocols:
synthetix:
range:
from: 20000000
Expand All @@ -17,7 +17,7 @@ configs:
contracts_from_abi:
- name: LegacyMarketProxy
address: "0x3AcF163B9E6a384D539e10dAc7e11213c638b2f5"
abi: ./abi/LegacyMarketProxy.json
abi: LegacyMarketProxy.json
cannon_config:
package: "synthetix-omnibus"
version: "latest"
Expand Down
Loading