Skip to content

Commit

Permalink
feat: code handles CELESTIA_HOME directly
Browse files Browse the repository at this point in the history
Signed-off-by: Smuu <18609909+Smuu@users.noreply.github.com>
  • Loading branch information
smuu committed Mar 14, 2023
1 parent ebe2e97 commit b41b2e4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,20 @@ func init() {
if err != nil {
panic(err)
}
// Try to get CELESTIA_HOME env variable, if not set, use user home dir
userHomeDir = getEnv("CELESTIA_HOME", userHomeDir)

DefaultNodeHome = filepath.Join(userHomeDir, "."+Name)
}

// Get environment variable or fallback to default value
func getEnv(key, fallback string) string {
if value, ok := os.LookupEnv(key); ok {
return value
}
return fallback
}

// App extends an ABCI application, but with most of its parameters exported.
// They are exported for convenience in creating helper functions, as object
// capabilities aren't needed for testing.
Expand Down
2 changes: 1 addition & 1 deletion docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ then
EOF
fi

/bin/celestia-appd --home ${CELESTIA_HOME} $@
/bin/celestia-appd $@

0 comments on commit b41b2e4

Please sign in to comment.