Skip to content

Commit

Permalink
add more db config
Browse files Browse the repository at this point in the history
  • Loading branch information
rchaing-figure committed Jan 31, 2023
1 parent fb58fd3 commit 9d1ccc4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions common/src/main/kotlin/tech/figure/aggregate/common/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ data class DBConfig(
val dbUri: String,
val dbUser: String,
val dbPassword: String,
val dbName: String,
val dbSchema: String,
val cacheUri: String,
val cacheCheckpoint: String,
val cacheTable: String,
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/tech/figure/aggregate/service/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ fun main(args: Array<String>) {
withManagedChannelConfig(config.blockApi.maxBlockSize)
)

Database.connect("jdbc:postgresql://${config.dbConfig.dbUri}/postgresdb", "org.postgresql.Driver", config.dbConfig.dbUser, config.dbConfig.dbPassword)
Database.connect("jdbc:postgresql://${config.dbConfig.dbUri}/${config.dbConfig.dbName}", "org.postgresql.Driver", config.dbConfig.dbUser, config.dbConfig.dbPassword)

val dbClient = DBClient()
val ravenClient = RavenDB(config.dbConfig)
Expand Down
4 changes: 3 additions & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ msg_fee_height: ${MSG_FEE_HEIGHT}
dbConfig:
dbUri: ${DB_URI}
dbUser: ${DB_USER}
dbPassword: ${DB_PASSWORD}
dbPassword: ${DB_PASS}
dbName: ${DB_NAME}
dbSchema: ${DB_SCHEMA}
cacheUri: ${CACHE_URI}
cacheCheckpoint: ${CACHE_CHECKPOINT}
cacheTable: ${CACHE_TABLE}
Expand Down
4 changes: 3 additions & 1 deletion src/main/resources/local.env.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ BATCH_SIZE=10
WS_NODE=http://34.148.31.174:26657
DB_URI=localhost:5432
DB_USER=postgres
DB_PASSWORD=password1
DB_PASS=password1
DB_NAME=aggregatordb
DB_SCHEMA=aggregator
CACHE_URI=http://localhost:8080
CACHE_CHECKPOINT=Aggregator-Checkpoint
CACHE_TABLE=Aggregator-Cache
Expand Down

0 comments on commit 9d1ccc4

Please sign in to comment.