Skip to content

Commit

Permalink
enable Light node pruner service
Browse files Browse the repository at this point in the history
  • Loading branch information
walldiss committed Jun 3, 2024
1 parent fbed869 commit 2ecb679
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions nodebuilder/pruner/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package pruner

import (
"context"
"github.com/celestiaorg/celestia-node/libs/fxutil"

"go.uber.org/fx"

Expand All @@ -11,7 +12,6 @@ import (
"github.com/celestiaorg/celestia-node/pruner/archival"
"github.com/celestiaorg/celestia-node/pruner/full"
"github.com/celestiaorg/celestia-node/pruner/light"
"github.com/celestiaorg/celestia-node/share/eds"
)

func ConstructModule(tp node.Type, cfg *Config) fx.Option {
Expand Down Expand Up @@ -48,16 +48,13 @@ func ConstructModule(tp node.Type, cfg *Config) fx.Option {
}
return fx.Module("prune",
baseComponents,
fx.Provide(light.NewPruner),
)
case node.Full:
if cfg.EnableService {
return fx.Module("prune",
baseComponents,
prunerService,
fx.Provide(func(store *eds.Store) pruner.Pruner {
return full.NewPruner(store)
}),
fxutil.ProvideAs(full.NewPruner, new(pruner.Pruner)),
)
}
return fx.Module("prune", baseComponents)
Expand All @@ -66,9 +63,7 @@ func ConstructModule(tp node.Type, cfg *Config) fx.Option {
return fx.Module("prune",
baseComponents,
prunerService,
fx.Provide(func(store *eds.Store) pruner.Pruner {
return full.NewPruner(store)
}),
fxutil.ProvideAs(full.NewPruner, new(pruner.Pruner)),
fx.Provide(func(window pruner.AvailabilityWindow) []core.Option {
return []core.Option{core.WithAvailabilityWindow(window)}
}),
Expand Down

0 comments on commit 2ecb679

Please sign in to comment.