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

deps: bump @libp2p/interface-peer-store from 1.2.9 to 2.0.0 #201

Merged
6 changes: 3 additions & 3 deletions packages/libp2p-daemon-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@
"@libp2p/interface-connection": "^5.0.1",
"@libp2p/interface-peer-id": "^2.0.0",
"@libp2p/interface-peer-info": "^1.0.1",
"@libp2p/interface-transport": "^3.0.0",
"@libp2p/interface-transport": "^4.0.0",
"@libp2p/interfaces": "^3.2.0",
"@libp2p/logger": "^2.0.0",
"@libp2p/peer-id": "^2.0.0",
"@libp2p/tcp": "^7.0.0",
"@libp2p/tcp": "^7.0.1",
"@multiformats/multiaddr": "^12.0.0",
"it-stream-types": "^2.0.1",
"multiformats": "^11.0.0",
Expand All @@ -152,7 +152,7 @@
"@libp2p/daemon-server": "^5.0.0",
"@libp2p/interface-dht": "^2.0.0",
"@libp2p/interface-mocks": "^11.0.0",
"@libp2p/interface-peer-store": "^1.0.0",
"@libp2p/interface-peer-store": "^2.0.0",
"@libp2p/interface-pubsub": "^4.0.0",
"aegir": "^38.1.6",
"it-all": "^3.0.1",
Expand Down
3 changes: 1 addition & 2 deletions packages/libp2p-daemon-client/test/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { StubbedInstance, stubInterface } from 'sinon-ts'
import { isPeerId } from '@libp2p/interface-peer-id'
import { peerIdFromString } from '@libp2p/peer-id'
import { mockConnection, mockDuplex, mockMultiaddrConnection } from '@libp2p/interface-mocks'
import type { PeerStore, AddressBook } from '@libp2p/interface-peer-store'
import type { PeerStore } from '@libp2p/interface-peer-store'

const defaultMultiaddr = multiaddr('/ip4/0.0.0.0/tcp/0')

Expand All @@ -23,7 +23,6 @@ describe('daemon client', function () {
beforeEach(async function () {
libp2p = stubInterface<Libp2p>()
libp2p.peerStore = stubInterface<PeerStore>()
libp2p.peerStore.addressBook = stubInterface<AddressBook>()

server = createServer(defaultMultiaddr, libp2p)

Expand Down
3 changes: 1 addition & 2 deletions packages/libp2p-daemon-client/test/stream.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { multiaddr } from '@multiformats/multiaddr'
import { StubbedInstance, stubInterface } from 'sinon-ts'
import { peerIdFromString } from '@libp2p/peer-id'
import { mockRegistrar, connectionPair } from '@libp2p/interface-mocks'
import type { PeerStore, AddressBook } from '@libp2p/interface-peer-store'
import type { PeerStore } from '@libp2p/interface-peer-store'
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
import { toString as uint8ArrayToString } from 'uint8arrays/to-string'
import all from 'it-all'
Expand All @@ -26,7 +26,6 @@ describe('daemon stream client', function () {
beforeEach(async function () {
libp2p = stubInterface<Libp2p>()
libp2p.peerStore = stubInterface<PeerStore>()
libp2p.peerStore.addressBook = stubInterface<AddressBook>()

server = createServer(defaultMultiaddr, libp2p)

Expand Down
2 changes: 1 addition & 1 deletion packages/libp2p-daemon-protocol/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"release": "aegir release"
},
"dependencies": {
"@libp2p/interface-transport": "^3.0.0",
"@libp2p/interface-transport": "^4.0.0",
"it-handshake": "^4.0.0",
"protons-runtime": "^5.0.0",
"uint8arraylist": "^2.3.2"
Expand Down
6 changes: 3 additions & 3 deletions packages/libp2p-daemon-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,14 @@
"@libp2p/interface-connection": "^5.0.1",
"@libp2p/interface-dht": "^2.0.0",
"@libp2p/interface-peer-id": "^2.0.0",
"@libp2p/interface-peer-store": "^1.2.8",
"@libp2p/interface-peer-store": "^2.0.0",
"@libp2p/interface-pubsub": "^4.0.0",
"@libp2p/interface-registrar": "^2.0.1",
"@libp2p/interface-transport": "^3.0.0",
"@libp2p/interface-transport": "^4.0.0",
"@libp2p/interfaces": "^3.2.0",
"@libp2p/logger": "^2.0.0",
"@libp2p/peer-id": "^2.0.0",
"@libp2p/tcp": "^7.0.0",
"@libp2p/tcp": "^7.0.1",
"@multiformats/multiaddr": "^12.0.0",
"it-drain": "^3.0.1",
"it-length-prefixed": "^9.0.0",
Expand Down
4 changes: 3 additions & 1 deletion packages/libp2p-daemon-server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ export class Server implements Libp2pServer {
const addrs = request.connect.addrs.map((a) => multiaddr(a))
const peerId = peerIdFromBytes(peer)

await this.libp2p.peerStore.addressBook.set(peerId, addrs)
await this.libp2p.peerStore.merge(peerId, {
multiaddrs: addrs
})
return await this.libp2p.dial(peerId)
}

Expand Down