0g-chain/x/metrics/abci.go
2024-08-02 19:26:37 +08:00

13 lines
302 B
Go

package metrics
import (
"github.com/0glabs/0g-chain/x/metrics/types"
sdk "github.com/cosmos/cosmos-sdk/types"
)
// BeginBlocker publishes metrics at the start of each block.
func BeginBlocker(ctx sdk.Context, metrics *types.Metrics) {
metrics.LatestBlockHeight.Set(float64(ctx.BlockHeight()))
}