Skip to content

Commit

Permalink
Merge pull request #10868 from filecoin-project/feat/add-legacy-marke…
Browse files Browse the repository at this point in the history
…ts-alert

feat: alerts: Add lotus-miner legacy-markets alert
  • Loading branch information
magik6k authored May 16, 2023
2 parents bc60171 + 7519f9f commit 34ebb25
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions node/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ const (

// health checks
CheckFDLimit
LegacyMarketsEOL

// libp2p
PstoreAddSelfKeysKey
Expand Down
4 changes: 4 additions & 0 deletions node/builder_miner.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ func ConfigStorageMiner(c interface{}) Option {
),

If(cfg.Subsystems.EnableMarkets,

// Alert that legacy-markets is being deprecated
Override(LegacyMarketsEOL, modules.LegacyMarketsEOL),

// Markets
Override(new(dtypes.StagingBlockstore), modules.StagingBlockstore),
Override(new(dtypes.StagingGraphsync), modules.StagingGraphsync(cfg.Dealmaking.SimultaneousTransfersForStorage, cfg.Dealmaking.SimultaneousTransfersForStoragePerClient, cfg.Dealmaking.SimultaneousTransfersForRetrieval)),
Expand Down
10 changes: 10 additions & 0 deletions node/modules/alerts.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ func CheckFdLimit(min uint64) func(al *alerting.Alerting) {
}
}

func LegacyMarketsEOL(al *alerting.Alerting) {
// Add alert if lotus-miner legacy markets subsystem is still in use
alert := al.AddAlertType("system", "EOL")

// Alert with a message to migrate to Boost or similar markets subsystems
al.Raise(alert, map[string]string{
"message": "The lotus-miner legacy markets subsystem is deprecated and will be removed in a future release. Please migrate to [Boost](https://boost.filecoin.io) or similar markets subsystems.",
})
}

// TODO: More things:
// * Space in repo dirs (taking into account mounts)
// * Miner
Expand Down

0 comments on commit 34ebb25

Please sign in to comment.