Skip to content

Commit

Permalink
deps!: update libp2p daemon to use libp2p v1 (#139)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: updates to libp2p v1
  • Loading branch information
achingbrain authored Nov 30, 2023
1 parent 37804b1 commit 357b5f8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,13 @@
"docs": "aegir docs"
},
"dependencies": {
"@libp2p/daemon-client": "^7.0.0",
"@libp2p/interface-peer-id": "^2.0.1",
"@libp2p/interface-peer-info": "^1.0.7",
"@libp2p/daemon-client": "^8.0.0",
"@libp2p/interface": "^1.0.0",
"@multiformats/multiaddr": "^12.0.0",
"delay": "^6.0.0",
"it-all": "^3.0.1",
"it-first": "^3.0.1",
"it-handshake": "^4.1.2",
"it-length-prefixed-stream": "^1.1.4",
"it-pipe": "^3.0.0",
"it-protobuf-stream": "^1.0.0",
"it-stream-types": "^2.0.1",
Expand Down
2 changes: 1 addition & 1 deletion src/dht/peer-routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { expect } from 'aegir/chai'
import pRetry from 'p-retry'
import type { Daemon, DaemonFactory, NodeType, SpawnOptions } from '../index.js'
import type { PeerInfo } from '@libp2p/interface-peer-info'
import type { PeerInfo } from '@libp2p/interface'

export function peerRoutingTests (factory: DaemonFactory): void {
const nodeTypes: NodeType[] = ['js', 'go']
Expand Down
8 changes: 4 additions & 4 deletions src/relay/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type Multiaddr, multiaddr } from '@multiformats/multiaddr'
import { expect } from 'aegir/chai'
import { handshake } from 'it-handshake'
import { lpStream } from 'it-length-prefixed-stream'
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
import { Status } from './pb/index.js'
import { echoHandler, reserve } from './util.js'
Expand Down Expand Up @@ -67,9 +67,9 @@ function relayTest (factory: DaemonFactory, aType: NodeType, bType: NodeType, re

// send some data, read the response
const input = uint8ArrayFromString('test')
const shake = handshake(stream)
shake.write(input)
const output = await shake.read()
const lp = lpStream(stream)
await lp.write(input)
const output = await lp.read()

expect(output?.subarray()).to.deep.equal(input)
})
Expand Down
2 changes: 1 addition & 1 deletion src/relay/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { pipe } from 'it-pipe'
import { pbStream } from 'it-protobuf-stream'
import { HopMessage } from './pb/index.js'
import type { Daemon } from '../index.js'
import type { PeerId } from '@libp2p/interface-peer-id'
import type { PeerId } from '@libp2p/interface'
import type { Duplex, Source } from 'it-stream-types'
import type { Uint8ArrayList } from 'uint8arraylist'

Expand Down

0 comments on commit 357b5f8

Please sign in to comment.