dsfx/cmd/dsfxnode/main.go

31 lines
666 B
Go
Raw Normal View History

2025-03-08 15:07:27 -05:00
package main
import (
"context"
"log/slog"
"koti.casa/numenor-labs/dsfx/cmd/dsfxnode/node"
"koti.casa/numenor-labs/dsfx/pkg/disk"
"koti.casa/numenor-labs/dsfx/pkg/storage/scoped"
"koti.casa/numenor-labs/dsfx/pkg/system"
2025-03-08 15:07:27 -05:00
)
func main() {
ctx := context.Background()
sys := system.Default()
2025-03-08 15:07:27 -05:00
configDir := sys.GetEnv("DSFXNODE_CONFIG_DIR")
if configDir == "" {
configDir = "/etc/dsfxnode/config"
2025-03-08 15:07:27 -05:00
}
configScope := scoped.New(disk.Default(), configDir)
2025-03-08 15:07:27 -05:00
err := node.New(configScope, sys).Run(ctx)
2025-03-08 15:07:27 -05:00
if err != nil {
// Log the error and exit with a non-zero status code.
slog.Error("Error running dsfxnode", slog.Any("error", err))
sys.Exit(1)
2025-03-08 15:07:27 -05:00
}
2025-03-10 19:53:10 -04:00
}