Skip to content

Commit

Permalink
Update project template (#1201)
Browse files Browse the repository at this point in the history
  • Loading branch information
droserasprout authored Jan 29, 2025
1 parent 798c5d2 commit e452452
Show file tree
Hide file tree
Showing 199 changed files with 402 additions and 414 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ Releases prior to 7.0 has been removed from this file to declutter search result

## [Unreleased]

### Changed

- project: Set default PostgreSQL password and Hasura secret (both are `changeme`) for new projects.
- project: Use PostgreSQL 16 image for new projects.

### Deprecated

- package: DipDup packages are expected to have `pyproject.toml` and `dipdup.yaml` files in the root directory. This will become a requirement in 9.0.
Expand Down
3 changes: 3 additions & 0 deletions docs/9.release-notes/_8.0_changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
- deps: Python 3.12 is now required to run DipDup.
- performance: All time intervals are now measured in seconds.
- performance: Several metrics have been renamed and new ones have been added.
- project: Set default PostgreSQL password and Hasura secret (both are `changeme`) for new projects.
- project: Use PostgreSQL 16 image for new projects.

### Deprecated

Expand All @@ -89,4 +91,5 @@
- deps: `sentry-sdk` updated to 2.1.
- deps: `tortoise-orm` updated to 0.20.1.
- deps: `tortoise-orm` updated to 0.21.2.
- deps: `tortoise-orm` updated to 0.24.0.
- deps: `web3` updated to 6.18.
7 changes: 3 additions & 4 deletions src/demo_blank/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,15 @@ dipdup run
Store data in SQLite database (defaults to /tmp, set `SQLITE_PATH` env variable):

```shell
dipdup -c . -c configs/dipdup.sqlite.yaml run
dipdup -C sqlite run
```

Or spawn a Compose stack with PostgreSQL and Hasura:

```shell
cd deploy
cp .env.default .env
cp deploy/.env.default deploy/.env
# Edit .env file before running
docker-compose up
make up
```

## Development setup
Expand Down
4 changes: 2 additions & 2 deletions src/demo_blank/configs/dipdup.compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ database:
host: ${POSTGRES_HOST:-db}
port: 5432
user: ${POSTGRES_USER:-dipdup}
password: ${POSTGRES_PASSWORD}
password: ${POSTGRES_PASSWORD:-changeme}
database: ${POSTGRES_DB:-dipdup}

hasura:
url: http://${HASURA_HOST:-hasura}:8080
admin_secret: ${HASURA_SECRET}
admin_secret: ${HASURA_SECRET:-changeme}
allow_aggregations: ${HASURA_ALLOW_AGGREGATIONS:-true}
select_limit: ${HASURA_SELECT_LIMIT:-10000}
camel_case: ${HASURA_CAMEL_CASE:-true}
Expand Down
4 changes: 2 additions & 2 deletions src/demo_blank/configs/dipdup.swarm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ database:
host: ${POSTGRES_HOST:-demo_blank_db}
port: 5432
user: ${POSTGRES_USER:-dipdup}
password: ${POSTGRES_PASSWORD}
password: ${POSTGRES_PASSWORD:-changeme}
database: ${POSTGRES_DB:-dipdup}

hasura:
url: http://${HASURA_HOST:-demo_blank_hasura}:8080
admin_secret: ${HASURA_SECRET}
admin_secret: ${HASURA_SECRET:-changeme}
allow_aggregations: ${HASURA_ALLOW_AGGREGATIONS:-false}
select_limit: ${HASURA_SELECT_LIMIT:-100}
camel_case: ${HASURA_CAMEL_CASE:-true}
Expand Down
2 changes: 1 addition & 1 deletion src/demo_blank/configs/replay.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ replay:
license: MIT
name: John Doe
email: [email protected]
postgres_image: postgres:15
postgres_image: postgres:16
postgres_data_path: /var/lib/postgresql/data
hasura_image: hasura/graphql-engine:latest
line_length: 120
Expand Down
4 changes: 2 additions & 2 deletions src/demo_blank/deploy/.env.default
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
HASURA_ALLOW_AGGREGATIONS=true
HASURA_CAMEL_CASE=true
HASURA_HOST=hasura
HASURA_SECRET=
HASURA_SECRET=changeme
HASURA_SELECT_LIMIT=10000
POSTGRES_DB=dipdup
POSTGRES_HOST=db
POSTGRES_PASSWORD=
POSTGRES_PASSWORD=changeme
POSTGRES_USER=dipdup
SENTRY_DSN=''
SENTRY_ENVIRONMENT=''
2 changes: 1 addition & 1 deletion src/demo_blank/deploy/compose.sqlite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
build:
context: ..
dockerfile: deploy/Dockerfile
command: ["-c", "dipdup.yaml", "-c", "configs/dipdup.sqlite.yaml", "run"]
command: ["-C", "sqlite", "run"]
restart: always
env_file: .env
ports:
Expand Down
4 changes: 2 additions & 2 deletions src/demo_blank/deploy/compose.swarm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
depends_on:
- db
- hasura
command: ["-c", "dipdup.yaml", "-c", "configs/dipdup.swarm.yaml", "run"]
command: ["-C", "swarm", "run"]
env_file: .env
networks:
- internal
Expand All @@ -28,7 +28,7 @@ services:
tag: "\{\{.Name\}\}.\{\{.ImageID\}\}"

db:
image: postgres:15
image: postgres:16
volumes:
- db:/var/lib/postgresql/data
env_file: .env
Expand Down
4 changes: 2 additions & 2 deletions src/demo_blank/deploy/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ services:
ports:
- 46339
- 9000
command: ["-c", "dipdup.yaml", "-c", "configs/dipdup.compose.yaml", "run"]
command: ["-C", "compose", "run"]
depends_on:
- db
- hasura

db:
image: postgres:15
image: postgres:16
ports:
- "${POSTGRES_HOST_PORT:-5432}:5432"
volumes:
Expand Down
4 changes: 2 additions & 2 deletions src/demo_blank/deploy/swarm.env.default
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
HASURA_ALLOW_AGGREGATIONS=false
HASURA_CAMEL_CASE=true
HASURA_HOST=demo_blank_hasura
HASURA_SECRET=
HASURA_SECRET=changeme
HASURA_SELECT_LIMIT=100
POSTGRES_DB=dipdup
POSTGRES_HOST=demo_blank_db
POSTGRES_PASSWORD=
POSTGRES_PASSWORD=changeme
POSTGRES_USER=dipdup
SENTRY_DSN=''
SENTRY_ENVIRONMENT=''
6 changes: 3 additions & 3 deletions src/demo_blank/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ dependencies = [

[dependency-groups]
dev = [
"black",
"ruff",
"mypy",
"black>=24.10.0",
"ruff>=0.9.2",
"mypy>=1.14.1",
]

[tool.black]
Expand Down
7 changes: 3 additions & 4 deletions src/demo_evm_events/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,15 @@ dipdup run
Store data in SQLite database (defaults to /tmp, set `SQLITE_PATH` env variable):

```shell
dipdup -c . -c configs/dipdup.sqlite.yaml run
dipdup -C sqlite run
```

Or spawn a Compose stack with PostgreSQL and Hasura:

```shell
cd deploy
cp .env.default .env
cp deploy/.env.default deploy/.env
# Edit .env file before running
docker-compose up
make up
```

## Development setup
Expand Down
4 changes: 2 additions & 2 deletions src/demo_evm_events/configs/dipdup.compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ database:
host: ${POSTGRES_HOST:-db}
port: 5432
user: ${POSTGRES_USER:-dipdup}
password: ${POSTGRES_PASSWORD}
password: ${POSTGRES_PASSWORD:-changeme}
database: ${POSTGRES_DB:-dipdup}

hasura:
url: http://${HASURA_HOST:-hasura}:8080
admin_secret: ${HASURA_SECRET}
admin_secret: ${HASURA_SECRET:-changeme}
allow_aggregations: ${HASURA_ALLOW_AGGREGATIONS:-true}
select_limit: ${HASURA_SELECT_LIMIT:-10000}
camel_case: ${HASURA_CAMEL_CASE:-true}
Expand Down
4 changes: 2 additions & 2 deletions src/demo_evm_events/configs/dipdup.swarm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ database:
host: ${POSTGRES_HOST:-demo_evm_events_db}
port: 5432
user: ${POSTGRES_USER:-dipdup}
password: ${POSTGRES_PASSWORD}
password: ${POSTGRES_PASSWORD:-changeme}
database: ${POSTGRES_DB:-dipdup}

hasura:
url: http://${HASURA_HOST:-demo_evm_events_hasura}:8080
admin_secret: ${HASURA_SECRET}
admin_secret: ${HASURA_SECRET:-changeme}
allow_aggregations: ${HASURA_ALLOW_AGGREGATIONS:-false}
select_limit: ${HASURA_SELECT_LIMIT:-100}
camel_case: ${HASURA_CAMEL_CASE:-true}
Expand Down
2 changes: 1 addition & 1 deletion src/demo_evm_events/configs/replay.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ replay:
license: MIT
name: John Doe
email: [email protected]
postgres_image: postgres:15
postgres_image: postgres:16
postgres_data_path: /var/lib/postgresql/data
hasura_image: hasura/graphql-engine:latest
line_length: 120
Expand Down
4 changes: 2 additions & 2 deletions src/demo_evm_events/deploy/.env.default
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ ETHERSCAN_URL=https://api.etherscan.io/api
HASURA_ALLOW_AGGREGATIONS=true
HASURA_CAMEL_CASE=true
HASURA_HOST=hasura
HASURA_SECRET=
HASURA_SECRET=changeme
HASURA_SELECT_LIMIT=10000
NODE_API_KEY=''
NODE_URL=https://eth-mainnet.g.alchemy.com/v2
NODE_WS_URL=wss://eth-mainnet.g.alchemy.com/v2
POSTGRES_DB=dipdup
POSTGRES_HOST=db
POSTGRES_PASSWORD=
POSTGRES_PASSWORD=changeme
POSTGRES_USER=dipdup
SENTRY_DSN=''
SENTRY_ENVIRONMENT=''
Expand Down
2 changes: 1 addition & 1 deletion src/demo_evm_events/deploy/compose.sqlite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
build:
context: ..
dockerfile: deploy/Dockerfile
command: ["-c", "dipdup.yaml", "-c", "configs/dipdup.sqlite.yaml", "run"]
command: ["-C", "sqlite", "run"]
restart: always
env_file: .env
ports:
Expand Down
4 changes: 2 additions & 2 deletions src/demo_evm_events/deploy/compose.swarm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
depends_on:
- db
- hasura
command: ["-c", "dipdup.yaml", "-c", "configs/dipdup.swarm.yaml", "run"]
command: ["-C", "swarm", "run"]
env_file: .env
networks:
- internal
Expand All @@ -28,7 +28,7 @@ services:
tag: "\{\{.Name\}\}.\{\{.ImageID\}\}"

db:
image: postgres:15
image: postgres:16
volumes:
- db:/var/lib/postgresql/data
env_file: .env
Expand Down
4 changes: 2 additions & 2 deletions src/demo_evm_events/deploy/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ services:
ports:
- 46339
- 9000
command: ["-c", "dipdup.yaml", "-c", "configs/dipdup.compose.yaml", "run"]
command: ["-C", "compose", "run"]
depends_on:
- db
- hasura

db:
image: postgres:15
image: postgres:16
ports:
- "${POSTGRES_HOST_PORT:-5432}:5432"
volumes:
Expand Down
4 changes: 2 additions & 2 deletions src/demo_evm_events/deploy/swarm.env.default
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ ETHERSCAN_URL=https://api.etherscan.io/api
HASURA_ALLOW_AGGREGATIONS=false
HASURA_CAMEL_CASE=true
HASURA_HOST=demo_evm_events_hasura
HASURA_SECRET=
HASURA_SECRET=changeme
HASURA_SELECT_LIMIT=100
NODE_API_KEY=''
NODE_URL=https://eth-mainnet.g.alchemy.com/v2
NODE_WS_URL=wss://eth-mainnet.g.alchemy.com/v2
POSTGRES_DB=dipdup
POSTGRES_HOST=demo_evm_events_db
POSTGRES_PASSWORD=
POSTGRES_PASSWORD=changeme
POSTGRES_USER=dipdup
SENTRY_DSN=''
SENTRY_ENVIRONMENT=''
Expand Down
6 changes: 3 additions & 3 deletions src/demo_evm_events/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ dependencies = [

[dependency-groups]
dev = [
"black",
"ruff",
"mypy",
"black>=24.10.0",
"ruff>=0.9.2",
"mypy>=1.14.1",
]

[tool.black]
Expand Down
7 changes: 3 additions & 4 deletions src/demo_evm_transactions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,15 @@ dipdup run
Store data in SQLite database (defaults to /tmp, set `SQLITE_PATH` env variable):

```shell
dipdup -c . -c configs/dipdup.sqlite.yaml run
dipdup -C sqlite run
```

Or spawn a Compose stack with PostgreSQL and Hasura:

```shell
cd deploy
cp .env.default .env
cp deploy/.env.default deploy/.env
# Edit .env file before running
docker-compose up
make up
```

## Development setup
Expand Down
4 changes: 2 additions & 2 deletions src/demo_evm_transactions/configs/dipdup.compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ database:
host: ${POSTGRES_HOST:-db}
port: 5432
user: ${POSTGRES_USER:-dipdup}
password: ${POSTGRES_PASSWORD}
password: ${POSTGRES_PASSWORD:-changeme}
database: ${POSTGRES_DB:-dipdup}

hasura:
url: http://${HASURA_HOST:-hasura}:8080
admin_secret: ${HASURA_SECRET}
admin_secret: ${HASURA_SECRET:-changeme}
allow_aggregations: ${HASURA_ALLOW_AGGREGATIONS:-true}
select_limit: ${HASURA_SELECT_LIMIT:-10000}
camel_case: ${HASURA_CAMEL_CASE:-true}
Expand Down
4 changes: 2 additions & 2 deletions src/demo_evm_transactions/configs/dipdup.swarm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ database:
host: ${POSTGRES_HOST:-demo_evm_transactions_db}
port: 5432
user: ${POSTGRES_USER:-dipdup}
password: ${POSTGRES_PASSWORD}
password: ${POSTGRES_PASSWORD:-changeme}
database: ${POSTGRES_DB:-dipdup}

hasura:
url: http://${HASURA_HOST:-demo_evm_transactions_hasura}:8080
admin_secret: ${HASURA_SECRET}
admin_secret: ${HASURA_SECRET:-changeme}
allow_aggregations: ${HASURA_ALLOW_AGGREGATIONS:-false}
select_limit: ${HASURA_SELECT_LIMIT:-100}
camel_case: ${HASURA_CAMEL_CASE:-true}
Expand Down
2 changes: 1 addition & 1 deletion src/demo_evm_transactions/configs/replay.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ replay:
license: MIT
name: John Doe
email: [email protected]
postgres_image: postgres:15
postgres_image: postgres:16
postgres_data_path: /var/lib/postgresql/data
hasura_image: hasura/graphql-engine:latest
line_length: 120
Expand Down
4 changes: 2 additions & 2 deletions src/demo_evm_transactions/deploy/.env.default
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ ETHERSCAN_URL=https://api.etherscan.io/api
HASURA_ALLOW_AGGREGATIONS=true
HASURA_CAMEL_CASE=true
HASURA_HOST=hasura
HASURA_SECRET=
HASURA_SECRET=changeme
HASURA_SELECT_LIMIT=10000
NODE_API_KEY=''
NODE_URL=https://eth-mainnet.g.alchemy.com/v2
NODE_WS_URL=wss://eth-mainnet.g.alchemy.com/v2
POSTGRES_DB=dipdup
POSTGRES_HOST=db
POSTGRES_PASSWORD=
POSTGRES_PASSWORD=changeme
POSTGRES_USER=dipdup
SENTRY_DSN=''
SENTRY_ENVIRONMENT=''
Expand Down
Loading

0 comments on commit e452452

Please sign in to comment.