Skip to content

Commit 04b68c1

Browse files
committed
prepared for umbel deployment
1 parent 02290a3 commit 04b68c1

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
FROM golang as buildstage
32

43
RUN mkdir /app
@@ -14,5 +13,4 @@ COPY --from=buildstage /app/main .
1413

1514
# CA certificates
1615
COPY --from=buildstage /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
17-
RUN mkdir "logs"
1816
CMD ["./main"]

blindbit.example.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ tweaks_full_with_dust_filter = 0
4545
# This index applies cut-through and dust filtering.
4646
# Beware that it will be stored in addition to any full index (with or without dust) if activated.
4747
# It has more storage requirements than the simple indices.
48-
# Currently still requires tweaks_only=1.
48+
# Currently still requires tweaks_only=0.
4949
# default: 0
5050
tweaks_cut_through_with_dust_filter = 0

src/common/config.go

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ func LoadConfigs(pathToConfig string) {
1313

1414
// Handle errors reading the config file
1515
if err := viper.ReadInConfig(); err != nil {
16-
ErrorLogger.Println("No config file detected", err.Error())
17-
return
16+
WarningLogger.Println("No config file detected", err.Error())
1817
}
1918

2019
/* set defaults */
@@ -32,6 +31,22 @@ func LoadConfigs(pathToConfig string) {
3231
viper.SetDefault("tweaks_full_with_dust_filter", false)
3332
viper.SetDefault("tweaks_cut_through_with_dust_filter", false)
3433

34+
// Bind viper keys to environment variables (optional, for backup)
35+
viper.AutomaticEnv()
36+
viper.BindEnv("host", "HOST")
37+
viper.BindEnv("chain", "CHAIN")
38+
viper.BindEnv("rpc_endpoint", "RPC_ENDPOINT")
39+
viper.BindEnv("cookie_path", "COOKIE_PATH")
40+
viper.BindEnv("rpc_pass", "RPC_PASS")
41+
viper.BindEnv("rpc_user", "RPC_USER")
42+
viper.BindEnv("sync_start_height", "SYNC_START_HEIGHT")
43+
viper.BindEnv("max_parallel_requests", "MAX_PARALLEL_REQUESTS")
44+
viper.BindEnv("max_parallel_tweak_computations", "MAX_PARALLEL_TWEAK_COMPUTATIONS")
45+
viper.BindEnv("tweaks_only", "TWEAKS_ONLY")
46+
viper.BindEnv("tweaks_full_basic", "TWEAKS_FULL_BASIC")
47+
viper.BindEnv("tweaks_full_with_dust_filter", "TWEAKS_FULL_WITH_DUST_FILTER")
48+
viper.BindEnv("tweaks_cut_through_with_dust_filter", "TWEAKS_CUT_THROUGH_WITH_DUST_FILTER")
49+
3550
/* read and set config variables */
3651
// General
3752
SyncStartHeight = viper.GetUint32("sync_start_height")
@@ -80,7 +95,7 @@ func LoadConfigs(pathToConfig string) {
8095
}
8196

8297
if TweaksCutThroughWithDust && TweaksOnly {
83-
err := errors.New("cut through requires tweaks_only to be set to 1")
98+
err := errors.New("cut through requires tweaks_only to be set to 0")
8499
ErrorLogger.Println(err)
85100
os.Exit(1)
86101
}

0 commit comments

Comments
 (0)