Skip to content

Commit c6d694a

Browse files
Merge pull request #4 from dipdup-io/8.3-update
2 parents 8e45c99 + 41595de commit c6d694a

18 files changed

+1860
-3465
lines changed

Makefile

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# generated by DipDup 8.3.2
12
.PHONY: $(MAKECMDGOALS)
23
MAKEFLAGS += --no-print-directory
34
##
@@ -11,34 +12,22 @@ help: ## Show this help (default)
1112
@grep -Fh "##" $(MAKEFILE_LIST) | grep -Fv grep -F | sed -e 's/\\$$//' | sed -e 's/##//'
1213

1314
all: ## Run an entire CI pipeline
14-
make format lint
15+
make install format lint
1516

1617
##
1718

1819
install: ## Install dependencies
19-
poetry install
20-
20+
uv sync --all-extras --all-groups --link-mode symlink --locked
2121

2222
update: ## Update dependencies
23-
poetry update
2423
dipdup self update -q
24+
uv sync --all-extras --all-groups --link-mode symlink -U
2525

26+
format: ## Format code with ruff
27+
ruff format .
2628

27-
format: ## Format with all tools
28-
make black
29-
30-
lint: ## Lint with all tools
31-
make ruff mypy
32-
33-
##
34-
35-
black: ## Format with black
36-
black .
37-
38-
ruff: ## Lint with ruff
29+
lint: ## Lint code with ruff and mypy
3930
ruff check --fix .
40-
41-
mypy: ## Lint with mypy
4231
mypy .
4332

4433
##

README.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ A blockchain indexer built with DipDup
66

77
This project is based on [DipDup](https://dipdup.io), a framework for building featureful dapps.
88

9-
You need a Linux/macOS system with Python 3.12 installed. To install DipDup with pipx or use our installer:
9+
You need a Linux/macOS system with Python 3.12 installed. To install DipDup use `uv tool` or our installer script:
1010

1111
```shell
12-
curl -Lsf https://dipdup.io/install.py | python3.12
12+
curl -Lsf https://dipdup.io/install.py | python3
1313
```
1414

1515
See the [Installation](https://dipdup.io/docs/installation) page for all options.
@@ -22,28 +22,27 @@ Run the indexer in memory:
2222
dipdup run
2323
```
2424

25-
Store data in SQLite database:
25+
Store data in SQLite database (defaults to /tmp, set `SQLITE_PATH` env variable):
2626

2727
```shell
28-
dipdup -c . -c configs/dipdup.sqlite.yaml run
28+
dipdup -C sqlite run
2929
```
3030

3131
Or spawn a Compose stack with PostgreSQL and Hasura:
3232

3333
```shell
34-
cd deploy
35-
cp .env.default .env
34+
cp deploy/.env.default deploy/.env
3635
# Edit .env file before running
37-
docker-compose up
36+
make up
3837
```
3938

4039
## Development setup
4140

4241
To set up the development environment:
4342

4443
```shell
45-
poetry install
46-
poetry shell
44+
make install
45+
source .venv/bin/activate
4746
```
4847

4948
Run `make all` to run full CI check or `make help` to see other available commands.

configs/dipdup.compose.yaml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,29 @@ database:
33
host: ${POSTGRES_HOST:-db}
44
port: 5432
55
user: ${POSTGRES_USER:-dipdup}
6-
password: ${POSTGRES_PASSWORD}
6+
password: ${POSTGRES_PASSWORD:-changeme}
77
database: ${POSTGRES_DB:-dipdup}
88

99
hasura:
1010
url: http://${HASURA_HOST:-hasura}:8080
11-
admin_secret: ${HASURA_SECRET}
11+
admin_secret: ${HASURA_SECRET:-changeme}
1212
allow_aggregations: ${HASURA_ALLOW_AGGREGATIONS:-true}
1313
select_limit: ${HASURA_SELECT_LIMIT:-10000}
14-
camel_case: false
14+
camel_case: ${HASURA_CAMEL_CASE:-true}
1515

1616
sentry:
1717
dsn: ${SENTRY_DSN:-''}
1818
environment: ${SENTRY_ENVIRONMENT:-''}
1919

2020
prometheus:
2121
host: 0.0.0.0
22+
port: 8000
2223

2324
api:
24-
host: 0.0.0.0
25+
host: 0.0.0.0
26+
port: 46339
27+
28+
mcp:
29+
host: 0.0.0.0
30+
port: 9999
31+
api_url: http://dipdup:46339

configs/dipdup.sqlite.yaml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
11
database:
22
kind: sqlite
3-
path: ${SQLITE_PATH:-/tmp/manutd_indexer.sqlite}
3+
path: ${SQLITE_PATH:-/tmp/manutd_indexer.sqlite}
4+
5+
sentry:
6+
dsn: ${SENTRY_DSN:-''}
7+
environment: ${SENTRY_ENVIRONMENT:-''}
8+
9+
prometheus:
10+
host: 0.0.0.0
11+
port: 8000
12+
13+
api:
14+
host: 0.0.0.0
15+
port: 46339
16+
17+
mcp:
18+
host: 0.0.0.0
19+
port: 9999
20+
api_url: http://0.0.0.0:46339

configs/dipdup.swarm.yaml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,31 @@
11
database:
22
kind: postgres
3-
host: ${POSTGRES_HOST:-db}
3+
host: ${POSTGRES_HOST:-manutd_indexer_db}
44
port: 5432
55
user: ${POSTGRES_USER:-dipdup}
6-
password: ${POSTGRES_PASSWORD}
6+
password: ${POSTGRES_PASSWORD:-changeme}
77
database: ${POSTGRES_DB:-dipdup}
88

99
hasura:
10-
url: http://${HASURA_HOST:-hasura}:8080
11-
admin_secret: ${HASURA_SECRET}
10+
url: http://${HASURA_HOST:-manutd_indexer_hasura}:8080
11+
admin_secret: ${HASURA_SECRET:-changeme}
1212
allow_aggregations: ${HASURA_ALLOW_AGGREGATIONS:-false}
1313
select_limit: ${HASURA_SELECT_LIMIT:-100}
14-
camel_case: false
14+
camel_case: ${HASURA_CAMEL_CASE:-true}
1515

1616
sentry:
1717
dsn: ${SENTRY_DSN:-''}
1818
environment: ${SENTRY_ENVIRONMENT:-''}
1919

2020
prometheus:
2121
host: 0.0.0.0
22+
port: 8000
2223

2324
api:
24-
host: 0.0.0.0
25+
host: 0.0.0.0
26+
port: 46339
27+
28+
mcp:
29+
host: 0.0.0.0
30+
port: 9999
31+
api_url: http://dipdup:46339

configs/replay.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ replay:
1515
postgres_data_path: /home/postgres/pgdata/data
1616
hasura_image: hasura/graphql-engine:latest
1717
line_length: 140
18-
package_manager: poetry
18+
package_manager: uv

deploy/.env.default

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
CONTRACT_GHOSTNET=
55
CONTRACT_MAINNET=
66
HASURA_ALLOW_AGGREGATIONS=true
7-
HASURA_CAMEL_CASE=false
7+
HASURA_CAMEL_CASE=true
88
HASURA_HOST=hasura
9-
HASURA_SECRET=
9+
HASURA_SECRET=changeme
1010
HASURA_SELECT_LIMIT=10000
1111
POSTGRES_DB=dipdup
1212
POSTGRES_HOST=db
13-
POSTGRES_PASSWORD=
13+
POSTGRES_PASSWORD=changeme
1414
POSTGRES_USER=dipdup
1515
SENTRY_DSN=''
1616
SENTRY_ENVIRONMENT=''

deploy/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# FROM dipdup/dipdup:8
1+
FROM dipdup/dipdup:8
22
# FROM ghcr.io/dipdup-io/dipdup:8
3-
FROM ghcr.io/dipdup-io/dipdup:aux-8.0.0
3+
# FROM ghcr.io/dipdup-io/dipdup:next
44

55
# COPY --chown=dipdup pyproject.toml README.md .
66
# RUN pip install .

deploy/compose.mcp.yaml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: manutd_indexer
2+
3+
services:
4+
dipdup:
5+
build:
6+
context: ..
7+
dockerfile: deploy/Dockerfile
8+
restart: always
9+
env_file: .env
10+
ports:
11+
- 46339
12+
- 9000
13+
command: ["-C", "compose", "run"]
14+
depends_on:
15+
- db
16+
- hasura
17+
18+
db:
19+
image: timescale/timescaledb-ha:pg15
20+
ports:
21+
- "${POSTGRES_HOST_PORT:-5432}:5432"
22+
volumes:
23+
- db:/home/postgres/pgdata/data
24+
restart: always
25+
env_file: .env
26+
environment:
27+
- POSTGRES_USER=dipdup
28+
- POSTGRES_DB=dipdup
29+
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
30+
healthcheck:
31+
test: ["CMD-SHELL", "pg_isready -U dipdup"]
32+
interval: 10s
33+
timeout: 5s
34+
retries: 5
35+
36+
hasura:
37+
image: hasura/graphql-engine:latest
38+
ports:
39+
- "${HASURA_HOST_PORT:-8080}:8080"
40+
depends_on:
41+
- db
42+
restart: always
43+
environment:
44+
- HASURA_GRAPHQL_DATABASE_URL=postgres://dipdup:${POSTGRES_PASSWORD}@db:5432/dipdup
45+
- HASURA_GRAPHQL_ADMIN_SECRET=${HASURA_SECRET}
46+
- HASURA_GRAPHQL_ENABLE_CONSOLE=true
47+
- HASURA_GRAPHQL_DEV_MODE=true
48+
- HASURA_GRAPHQL_LOG_LEVEL=info
49+
- HASURA_GRAPHQL_ENABLE_TELEMETRY=false
50+
- HASURA_GRAPHQL_UNAUTHORIZED_ROLE=user
51+
- HASURA_GRAPHQL_STRINGIFY_NUMERIC_TYPES=true
52+
53+
mcp:
54+
build:
55+
context: ..
56+
dockerfile: deploy/Dockerfile
57+
restart: always
58+
env_file: .env
59+
ports:
60+
- 9999
61+
command: ["-C", "compose", "mcp", "run"]
62+
depends_on:
63+
- db
64+
- hasura
65+
66+
volumes:
67+
db:

deploy/compose.sqlite.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services:
55
build:
66
context: ..
77
dockerfile: deploy/Dockerfile
8-
command: ["-c", "dipdup.yaml", "-c", "configs/dipdup.sqlite.yaml", "run"]
8+
command: ["-C", "sqlite", "run"]
99
restart: always
1010
env_file: .env
1111
ports:

0 commit comments

Comments
 (0)