Skip to content

Commit fbe080b

Browse files
authored
chore: Update docker compose files and Store dependency (#165)
* chore: Bump Store version (Utxo balance snapshot, Auto recovery) * chore: Added additional env variables * chore: Aggregation app specific properties * chore: Healthcheck and dependency added for postgres * chore: Create different docker compose files to reuse
1 parent f5f48f1 commit fbe080b

15 files changed

+229
-288
lines changed

aggregation-app/build.gradle

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,16 @@ plugins {
44

55
dependencies {
66
implementation 'org.springframework.boot:spring-boot-starter'
7-
implementation 'org.springframework.boot:spring-boot-starter-validation'
8-
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
9-
implementation 'org.springframework.boot:spring-boot-starter-webflux'
10-
implementation 'org.springframework.boot:spring-boot-configuration-processor'
7+
implementation 'org.springframework.boot:spring-boot-starter-web'
8+
implementation 'org.springframework.boot:spring-boot-starter-batch'
119
implementation 'org.springframework.boot:spring-boot-starter-actuator'
1210

1311
implementation(libs.yaci.store.starter)
1412
implementation(libs.yaci.store.utxo.starter)
1513
implementation(libs.yaci.store.account.starter)
14+
implementation(libs.yaci.store.admin.starter)
1615

1716
implementation project(':components:healthcheck')
18-
implementation project(':aggregates:account')
1917
runtimeOnly 'org.postgresql:postgresql'
2018

2119
compileOnly(libs.lombok)

aggregation-app/src/main/resources/application.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ spring:
1111
out-of-order: true
1212
datasource:
1313
hikari:
14-
maximum-pool-size: 30
14+
maximum-pool-size: 50
1515
minimum-idle: 5
1616
jpa:
1717
properties:
@@ -39,13 +39,17 @@ store:
3939
history-cleanup-enabled: false
4040
# 3 months
4141
balance-cleanup-slot-count: 7889238
42-
address-tx-amount-include-zero-amount: true
4342
api-enabled: true
4443
parallel-write: true
4544
write-thread-default-batch-size: 1000
4645
jooq-write-batch-size: 3000
4746
write-thread-count: 5
47+
save-address-tx-amount: true
48+
address-tx-amount-include-zero-amount: true
49+
utxo:
50+
save-address: true
4851
address-cache-enabled: true
52+
address-cache-size: 100000
4953
executor:
5054
enable-parallel-processing: true
5155
block-processing-threads: 15
@@ -54,6 +58,8 @@ store:
5458
blocks-partition-size: 10
5559
use-virtual-thread-for-batch-processing: false
5660
use-virtual-thread-for-event-processing: true
61+
admin:
62+
api-enabled: true
5763

5864
ledger-sync:
5965
healthcheck:

config/application.properties

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@ store.cardano.protocol-magic=1
2222
NETWORK=preprod
2323

2424
##################### Postgres DB #######################
25-
spring.datasource.url=jdbc:postgresql://localhost:5432/ledger_sync?currentSchema=cexplorer
25+
spring.datasource.url=jdbc:postgresql://localhost:5432/ledger_sync?currentSchema=ledger_sync
2626
spring.datasource.username=postgres
2727
spring.datasource.password=1
28+
29+
30+
################## Aggregation App Specific Properties ###########
31+
#store.account.initial-balance-snapshot-block=1950000
32+
33+
#store.account.balance-calc-job-batch-size=500
34+
#store.account.balance-calc-job-partition-size=5
35+
36+
#store.admin.health-check-interval=60
37+
#store.admin.auto-recovery-enabled=true

docker/aggr-app-compose.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
version: '3.9'
2+
3+
services:
4+
ledger-sync-aggregation:
5+
image: cardanofoundation/ledger-sync-aggregation:dev
6+
container_name: ledger-sync-aggregation-${NETWORK:-mainnet}
7+
# build:
8+
# context: .
9+
# dockerfile: Dockerfile
10+
# target: aggregation
11+
environment:
12+
- SPRING_DATASOURCE_URL=${SPRING_DATASOURCE_URL:-jdbc:postgresql://ledger-sync-postgres:5432/ledger_sync?currentSchema=aggregation}
13+
- SPRING_DATASOURCE_USERNAME=${SPRING_DATASOURCE_USERNAME:-cardano-master}
14+
- SPRING_DATASOURCE_PASSWORD=${SPRING_DATASOURCE_PASSWORD:-dbpass}
15+
- STORE_CARDANO_HOST=${STORE_CARDANO_HOST:-relays-new.cardano-mainnet.iohk.io}
16+
- STORE_CARDANO_PORT=${STORE_CARDANO_PORT:-3001}
17+
- STORE_CARDANO_PROTOCOLMAGIC=${STORE_CARDANO_PROTOCOLMAGIC:-764824073}
18+
- NETWORK=${NETWORK:-mainnet}
19+
- HEALTH_CHECK_ENABLED=${HEALTH_CHECK_ENABLED:-true}
20+
- EVENT_TIME_THRESHOLD_IN_SECOND=${EVENT_TIME_THRESHOLD_IN_SECOND:-600}
21+
- BLOCK_TIME_CHECK_ENABLED=${BLOCK_TIME_CHECK_ENABLED:-true}
22+
- BLOCK_TIME_THRESHOLD_IN_SECOND=${BLOCK_TIME_THRESHOLD_IN_SECOND:-180}
23+
- STORE_ACCOUNT_INITIALBALANCESNAPSHOTBLOCK=${STORE_ACCOUNT_INITIALBALANCESNAPSHOTBLOCK:-0}
24+
- STORE_ACCOUNT_BALANCECALCJOBBATCHSIZE=${STORE_ACCOUNT_BALANCECALCJOBBATCHSIZE:-500}
25+
- STORE_ACCOUNT_BALANCECALCJOBPARTITIONSIZE=${STORE_ACCOUNT_BALANCECALCJOBPARTITIONSIZE:-5}
26+
- STORE_ADMIN_HEALTHCHECKINTERVAL=${STORE_ADMIN_HEALTHCHECKINTERVAL:-120}
27+
- STORE_ADMIN_AUTORECOVERYENABLED=${STORE_ADMIN_AUTORECOVERYENABLED:-true}
28+
ports:
29+
- ${PORT:-8081}:8080
30+
volumes:
31+
- $PWD/logs:/app/logs
32+
33+
logging:
34+
driver: "json-file"
35+
options:
36+
max-size: "1m"
37+
max-file: "50"

docker/docker-compose-aggr-and-main.yml

Lines changed: 0 additions & 114 deletions
This file was deleted.

docker/docker-compose-aggr.yml

Lines changed: 0 additions & 76 deletions
This file was deleted.

docker/docker-compose-full.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
version: '3.9'
2+
3+
networks:
4+
ledger-sync-net:
5+
6+
services:
7+
ledger-sync-postgres:
8+
extends:
9+
file: postgres-compose.yml
10+
service: ledger-sync-postgres
11+
networks:
12+
- ledger-sync-net
13+
14+
ledger-sync:
15+
extends:
16+
file: main-app-compose.yml
17+
service: ledger-sync
18+
depends_on:
19+
ledger-sync-postgres:
20+
condition: service_healthy
21+
networks:
22+
- ledger-sync-net
23+
24+
ledger-sync-aggregation:
25+
extends:
26+
file: aggr-app-compose.yml
27+
service: ledger-sync-aggregation
28+
depends_on:
29+
ledger-sync-postgres:
30+
condition: service_healthy
31+
networks:
32+
- ledger-sync-net
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: '3.9'
2+
3+
networks:
4+
ledger-sync-net:
5+
6+
services:
7+
ledger-sync-postgres:
8+
extends:
9+
file: postgres-compose.yml
10+
service: ledger-sync-postgres
11+
networks:
12+
- ledger-sync-net
13+
14+
ledger-sync-aggregation:
15+
extends:
16+
file: aggr-app-compose.yml
17+
service: ledger-sync-aggregation
18+
depends_on:
19+
ledger-sync-postgres:
20+
condition: service_healthy
21+
networks:
22+
- ledger-sync-net
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: '3.9'
2+
3+
networks:
4+
ledger-sync-net:
5+
6+
services:
7+
ledger-sync-postgres:
8+
extends:
9+
file: postgres-compose.yml
10+
service: ledger-sync-postgres
11+
networks:
12+
- ledger-sync-net
13+
14+
ledger-sync:
15+
extends:
16+
file: main-app-compose.yml
17+
service: ledger-sync
18+
depends_on:
19+
ledger-sync-postgres:
20+
condition: service_healthy
21+
networks:
22+
- ledger-sync-net

0 commit comments

Comments
 (0)