Skip to content

Commit 327e215

Browse files
committed
SQLite deployment action
1 parent 3d64539 commit 327e215

File tree

5 files changed

+27
-21
lines changed

5 files changed

+27
-21
lines changed

src/main/kotlin/io/openfuture/chain/network/component/ChannelsHolder.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ class ChannelsHolder(
107107
val connectedNodesInfo = getNodesInfo()
108108
val regularAddresses = addressesHolder.getRandomList(exclude = connectedNodesInfo).map { it.address }
109109
val bootAddresses = nodeProperties.getRootAddresses().asSequence()
110-
.minus(connectedNodesInfo.map { it.address })
111-
.minus(regularAddresses)
110+
.minus(connectedNodesInfo.map { it.address }.toSet())
111+
.minus(regularAddresses.toSet())
112112
val addresses = regularAddresses.plus(bootAddresses).shuffled()
113113
for (address in addresses) {
114114
val connected = connectionService.connect(address, Consumer {
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# DATABASE
2-
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
3-
spring.datasource.url=jdbc:mysql://localhost:3308/chain_1?allowPublicKeyRetrieval=true&useSSL=false
4-
spring.datasource.username=root
5-
spring.datasource.password=123456
2+
spring.datasource.driver-class-name=org.sqlite.JDBC
3+
spring.datasource.url=jdbc:sqlite:./db/chain_1
4+
spring.datasource.username=admin
5+
spring.datasource.password=admin
66
spring.jpa.open-in-view=true
7+
spring.jpa.database-platform=org.hibernate.dialect.SQLiteDialect
8+
spring.jpa.hibernate.ddl-auto=update
79

810
# Logging
911
logging.level.io.openfuture.chain=INFO
@@ -13,6 +15,6 @@ server.port=8081
1315

1416
# NODE
1517
node.port=9191
16-
node.root-nodes=localhost:9192,localhost:9193,localhost:9194,localhost:9195
18+
node.root-nodes=localhost:9192,localhost:9193
1719

1820
node.config-path=config-1.json
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# DATABASE
2-
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
3-
spring.datasource.url=jdbc:mysql://localhost:3308/chain_2?allowPublicKeyRetrieval=true&useSSL=false
4-
spring.datasource.username=root
5-
spring.datasource.password=123456
2+
spring.datasource.driver-class-name=org.sqlite.JDBC
3+
spring.datasource.url=jdbc:sqlite:./db/chain_2
4+
spring.datasource.username=admin
5+
spring.datasource.password=admin
66
spring.jpa.open-in-view=true
7+
spring.jpa.database-platform=org.hibernate.dialect.SQLiteDialect
8+
spring.jpa.hibernate.ddl-auto=update
79

810
# Logging
911
logging.level.io.openfuture.chain=INFO
@@ -13,6 +15,6 @@ server.port=8082
1315

1416
# NODE
1517
node.port=9192
16-
node.root-nodes=localhost:9191,localhost:9193,localhost:9194,localhost:9195
18+
node.root-nodes=localhost:9191,localhost:9193
1719

1820
node.config-path=config-2.json
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# DATABASE
2-
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
3-
spring.datasource.url=jdbc:mysql://localhost:3308/chain_3?allowPublicKeyRetrieval=true&useSSL=false
4-
spring.datasource.username=root
5-
spring.datasource.password=123456
2+
spring.datasource.driver-class-name=org.sqlite.JDBC
3+
spring.datasource.url=jdbc:sqlite:./db/chain_3
4+
spring.datasource.username=admin
5+
spring.datasource.password=admin
66
spring.jpa.open-in-view=true
7+
spring.jpa.database-platform=org.hibernate.dialect.SQLiteDialect
8+
spring.jpa.hibernate.ddl-auto=update
79

810
# Logging
911
logging.level.io.openfuture.chain=INFO
@@ -13,6 +15,6 @@ server.port=8083
1315

1416
# NODE
1517
node.port=9193
16-
node.root-nodes=localhost:9191,localhost:9192,localhost:9194,localhost:9195
18+
node.root-nodes=localhost:9191,localhost:9192
1719

1820
node.config-path=config-3.json

src/main/resources/application.properties

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# DATABASE
22
spring.datasource.driverClassName=org.sqlite.JDBC
3-
spring.datasource.url=jdbc:sqlite:./db/chain_1
3+
spring.datasource.url=jdbc:sqlite:./db/chain
44
spring.datasource.username=admin
55
spring.datasource.password=admin
66
spring.jpa.open-in-view=true
@@ -32,10 +32,10 @@ node.peer-penalty=3600000
3232
node.expiry=10000
3333
node.sync-expiry=10000
3434
node.sync-batch-size=22
35-
node.ntp-offset-threshold=100
35+
node.ntp-offset-threshold=1000
3636
# CONSENSUS
3737
consensus.epoch-height=21
38-
consensus.delegates-count=21
38+
consensus.delegates-count=3
3939
consensus.block-capacity=10000
4040
consensus.time-slot-duration=50000
4141
consensus.time-slot-interval=15000
@@ -61,7 +61,7 @@ management.metrics.export.prometheus.step=15s
6161
#spring.jpa.properties.hibernate.generate_statistics=true
6262

6363
### HIKARI
64-
spring.datasource.hikari.maximum-pool-size=500
64+
spring.datasource.hikari.maximum-pool-size=50
6565
spring.datasource.hikari.connectionTimeout=30000
6666
spring.datasource.hikari.idleTimeout=600000
6767
spring.datasource.hikari.maxLifetime=1800000

0 commit comments

Comments
 (0)