Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!: move autonat into separate package #2107

Merged
merged 8 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 92 additions & 7 deletions doc/migrations/v0.46-v1.0.0.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,101 @@
<!--Specify versions for migration below-->
# Migrating to libp2p@1.0.0 <!-- omit in toc -->

A migration guide for refactoring your application code from libp2p `v0.46` to `v1.0.0`.
A migration guide for refactoring your application code from libp2p v0.46 to v1.0.0.
maschad marked this conversation as resolved.
Show resolved Hide resolved
wemeetagain marked this conversation as resolved.
Show resolved Hide resolved

## Table of Contents <!-- omit in toc -->

- [New features](#new-features)
- [Breaking changes](#breaking-changes)
- [API](#api)
- [Module Updates](#module-updates)
- [Metrics](#metrics)
maschad marked this conversation as resolved.
Show resolved Hide resolved

## New features
## API

...
<!--Describe breaking APIs with examples for Before and After
Example:

## Breaking changes
### Peer Discovery

...
__Describe__

**Before**

```js

```

**After**

```js

```

-->

### KeyChain
maschad marked this conversation as resolved.
Show resolved Hide resolved

The KeyChain object is no longer included on Libp2p and must be instantiated explicitly if desired.

**Before**

```ts
import type { KeyChain } from '@libp2p/interface/keychain'

const libp2p = await createLibp2p(...)

const keychain: KeyChain = libp2p.keychain
```

**After**

```ts
import { DefaultKeyChain } from '@libp2p/keychain'
import type { KeyChain } from '@libp2p/interface/keychain'

const libp2p = await createLibp2p({
...
services: {
keychain: (components) => new DefaultKeyChain(components, {
...DefaultKeyChain.generateOptions()
})
}
})

const keychain: KeyChain = libp2p.services.keychain
```

### AutoNAT
maschad marked this conversation as resolved.
Show resolved Hide resolved

The AutoNAT service is now published in its own package.

**Before**

```ts
import { autoNATService } from 'libp2p/autonat'
```

**After**

```ts
import { autoNATService } from '@libp2p/autonat'
```

## Module Updates

With this release you should update the following libp2p modules if you are relying on them:

<!--Specify module versions in JSON for migration below.
It's recommended to check package.json changes for this:
`git diff <release> <prev> -- package.json`
-->

```json

```
maschad marked this conversation as resolved.
Show resolved Hide resolved

## Metrics

The following metrics were renamed:

`libp2p_dialler_pending_dials` => `libp2p_dial_queue_pending_dials`
`libp2p_dialler_in_progress_dials` => `libp2p_dial_queue_in_progress_dials`
101 changes: 0 additions & 101 deletions doc/migrations/v0.46-v1.0.md

This file was deleted.

Loading