Skip to content

Commit

Permalink
enforce metrics order through fx
Browse files Browse the repository at this point in the history
  • Loading branch information
walldiss committed Sep 19, 2024
1 parent bc4e6c5 commit e756b0f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions nodebuilder/p2p/bitswap.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
routinghelpers "github.com/libp2p/go-libp2p-routing-helpers"
hst "github.com/libp2p/go-libp2p/core/host"
"github.com/libp2p/go-libp2p/core/protocol"
"github.com/prometheus/client_golang/prometheus"
"go.uber.org/fx"

"github.com/celestiaorg/celestia-node/share/eds"
Expand All @@ -29,6 +30,7 @@ const (

// dataExchange provides a constructor for IPFS block's DataExchange over BitSwap.
func dataExchange(params bitSwapParams) exchange.Interface {
fmt.Println("START BITSWAP")
prefix := protocolID(params.Net)
net := network.NewFromIpfsHost(params.Host, &routinghelpers.Null{}, network.Prefix(prefix))

Expand Down Expand Up @@ -83,6 +85,9 @@ type bitSwapParams struct {
Net Network
Host hst.Host
Bs blockstore.Blockstore
// Registerer is unused, it is in dependency graph to ensure that prometheus metrics are enabled before bitswap
// is started.
Registerer prometheus.Registerer `optional:"true"`
}

func protocolID(network Network) protocol.ID {
Expand Down

0 comments on commit e756b0f

Please sign in to comment.