Skip to content

Commit

Permalink
fix: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
remoterami committed Mar 6, 2025
1 parent ea7aa59 commit d828e20
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 429 deletions.
14 changes: 9 additions & 5 deletions backend/cmd/misc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ var opts = struct {
* By default, all commands that are not in the REQUIRES_LIST will automatically require everything.
*/
var REQUIRES_LIST = map[string]misctypes.Requires{
"app-bundle": (&commands.AppBundleCommand{}).Requires(),
"app-bundle": (&commands.AppBundleCommand{}).Requires(),
"initBigtableSchema": {Bigtable: true},
"applyDbSchema": {NetworkDBs: true, Clickhouse: true},
}

func Run() {
Expand Down Expand Up @@ -148,6 +150,7 @@ func Run() {
ElNode: true,
UserDBs: true,
NetworkDBs: true,
Clickhouse: true,
}
}

Expand Down Expand Up @@ -198,10 +201,11 @@ func Run() {
defer db.FrontendWriterDB.Close()
}

// clickhouse
db.ClickHouseWriter, db.ClickHouseReader = db.MustInitDB(&cfg.ClickHouse.WriterDatabase, &cfg.ClickHouse.ReaderDatabase, "clickhouse", "clickhouse")
defer db.ClickHouseReader.Close()
defer db.ClickHouseWriter.Close()
if requires.Clickhouse {
db.ClickHouseWriter, db.ClickHouseReader = db.MustInitDB(&cfg.ClickHouse.WriterDatabase, &cfg.ClickHouse.ReaderDatabase, "clickhouse", "clickhouse")
defer db.ClickHouseReader.Close()
defer db.ClickHouseWriter.Close()
}

// Initialize the persistent redis client
if requires.Redis {
Expand Down
1 change: 1 addition & 0 deletions backend/cmd/misc/misctypes/requires.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ type Requires struct {
ElNode bool
NetworkDBs bool
UserDBs bool
Clickhouse bool
}
10 changes: 7 additions & 3 deletions backend/local_deployment/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,18 @@ services:
<<: *default-service
command: go run ./cmd api -config /app/backend/local_deployment/config.yml
frontend:
image: ghcr.io/gobitfly/beaconchain_frontend:staging
network_mode: "host"
# latest staging
# image: ghcr.io/gobitfly/beaconchain_frontend:staging
# local frontend
volumes:
- ../../.:/app
build: ../../frontend/
environment:
- NUXT_PUBLIC_API_CLIENT="http://local.beaconcha.in:8080/api/i/"
- NUXT_PUBLIC_LEGACY_API_CLIENT="http://local.beaconcha.in:8080/"
- NUXT_PRIVATE_API_SERVER="http://local.beaconcha.in:8080/api/i/"
- NUXT_PRIVATE_LEGACY_API_SERVER="http://local.beaconcha.in:8080/"
- NUXT_PUBLIC_API_KEY="xxx"
- NUXT_PUBLIC_X_USER_ID=1
- NODE_TLS_REJECT_UNAUTHORIZED=0
- NUXT_HOST=local.beaconcha.in
- NUXT_PUBLIC_CHAIN_ID_BY_DEFAULT=3151908
2 changes: 1 addition & 1 deletion backend/local_deployment/main.star
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def run(plan, args):
),
# Add a Clickhouse server
"clickhouse": ServiceConfig(
image = "clickhouse/clickhouse-server:24.5",
image = "clickhouse/clickhouse-server:24.10",
ports = {
CLICKHOUSE_PORT_ID: PortSpec(9000, application_protocol = "clickhouse"),
CLICKHOUSE_PORT_ID_HTTP: PortSpec(8123),
Expand Down
2 changes: 1 addition & 1 deletion backend/local_deployment/network-params.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"eth1_follow_distance": 16,
"genesis_delay": 10,
"deneb_fork_epoch": 0,
"electra_fork_epoch": 1,
"electra_fork_epoch": 100000,
"prefunded_accounts": '{
"0x8943545177806ED17B9F23F0a21ee5948eCaa776": {"balance": "10000ETH"},
"0xE25583099BA105D9ec0A67f5Ae86D90e50036425": {"balance": "10000ETH"}
Expand Down
7 changes: 6 additions & 1 deletion backend/pkg/commons/db/clickhouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ func MustInitClickhouseNative(writer *types.DatabaseConfig) ch.Conn {
}
}

var tlsConfig *tls.Config
if writer.SSL {
tlsConfig = &tls.Config{InsecureSkipVerify: false, MinVersion: tls.VersionTLS12}
}

log.Infof("initializing clickhouse native writer db connection to %v/%v with %v/%v conn limit", hosts, writer.Name, writer.MaxIdleConns, writer.MaxOpenConns)
dbWriter, err := ch.Open(&ch.Options{
MaxOpenConns: writer.MaxOpenConns,
Expand All @@ -53,7 +58,7 @@ func MustInitClickhouseNative(writer *types.DatabaseConfig) ch.Conn {
Database: writer.Name,
},
Debug: false,
TLS: &tls.Config{InsecureSkipVerify: false, MinVersion: tls.VersionTLS12},
TLS: tlsConfig,
// this gets only called when debug is true
Debugf: func(s string, p ...interface{}) {
log.Debugf("CH NATIVE WRITER: "+s, p...)
Expand Down
Loading

0 comments on commit d828e20

Please sign in to comment.