feat(gl): add immutable postgres ledger storage

This commit is contained in:
2026-08-14 19:00:45 +03:30
parent b1e0b01598
commit 0b3eaa0c3d
14 changed files with 1139 additions and 1 deletions
+13 -1
View File
@@ -10,6 +10,7 @@ import (
"gl/application/health"
"gl/infrastructure/config"
"gl/infrastructure/postgres"
grpcadapter "gl/interface/grpc"
)
@@ -26,7 +27,18 @@ func main() {
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
defer stop()
handler := grpcadapter.NewHealthHandler(health.NewService(nil))
database, err := postgres.Open(ctx, cfg.Database)
if err != nil {
slog.Error("open GL database", "error", err)
os.Exit(1)
}
defer database.Close()
if err := postgres.Migrate(ctx, database); err != nil {
slog.Error("migrate GL database", "error", err)
os.Exit(1)
}
handler := grpcadapter.NewHealthHandler(health.NewService(database))
slog.Info("starting GL gRPC service", "host", cfg.GRPC.Host, "port", cfg.GRPC.Port)
serverConfig := grpcadapter.ServerConfig{
Host: cfg.GRPC.Host,