Skip to content

Latest commit

 

History

History
37 lines (25 loc) · 886 Bytes

v0.40-v0.41.md

File metadata and controls

37 lines (25 loc) · 886 Bytes

Migrating to libp2p@41

A migration guide for refactoring your application code from libp2p v0.40.x to v0.41.0.

Table of Contents

Metrics

libp2p no longer ships a built-in metrics object, allowing the user to configure an implemnetation of their choice or not at all.

Currently an implementation exists for Prometheus/Graphana, others may follow.

Before

import { createLibp2p } from 'libp2p'

const node = await createLibp2p({
  metrics: {
    enabled: true,
    // ... other options
  }
})

After

import { createLibp2p } from 'libp2p'
import { prometheusMetrics } from '@libp2p/prometheus-metrics'

const node = await createLibp2p({
  metrics: prometheusMetrics()
})