diff --git a/src/dht/find-peer.js b/src/dht/find-peer.js index 328c2683e..f7868be72 100644 --- a/src/dht/find-peer.js +++ b/src/dht/find-peer.js @@ -7,7 +7,7 @@ export const createFindPeer = configure(api => { * @type {import('../types').DHTAPI["findPeer"]} */ async function * findPeer (peerId, options = {}) { - const res = await api.post('dht/findpeer', { + const res = await api.post('routing/findpeer', { signal: options.signal, searchParams: toUrlSearchParams({ arg: peerId, diff --git a/src/dht/find-provs.js b/src/dht/find-provs.js index 6479f8d73..55820fdff 100644 --- a/src/dht/find-provs.js +++ b/src/dht/find-provs.js @@ -7,7 +7,7 @@ export const createFindProvs = configure(api => { * @type {import('../types.js').DHTAPI["findProvs"]} */ async function * findProvs (cid, options = {}) { - const res = await api.post('dht/findprovs', { + const res = await api.post('routing/findprovs', { signal: options.signal, searchParams: toUrlSearchParams({ arg: cid.toString(), diff --git a/src/dht/get.js b/src/dht/get.js index 03d60d0db..255be7188 100644 --- a/src/dht/get.js +++ b/src/dht/get.js @@ -8,7 +8,7 @@ export const createGet = configure(api => { * @type {import('../types').DHTAPI["get"]} */ async function * get (key, options = {}) { - const res = await api.post('dht/get', { + const res = await api.post('routing/get', { signal: options.signal, searchParams: toUrlSearchParams({ // arg: base36.encode(key), diff --git a/src/dht/provide.js b/src/dht/provide.js index e63ce938f..924faf514 100644 --- a/src/dht/provide.js +++ b/src/dht/provide.js @@ -10,7 +10,7 @@ export const createProvide = configure(api => { /** @type {import('../types').CID[]} */ const cidArr = Array.isArray(cids) ? cids : [cids] - const res = await api.post('dht/provide', { + const res = await api.post('routing/provide', { signal: options.signal, searchParams: toUrlSearchParams({ arg: cidArr.map(cid => cid.toString()), diff --git a/src/dht/put.js b/src/dht/put.js index 15dc6b66f..db72fa8b7 100644 --- a/src/dht/put.js +++ b/src/dht/put.js @@ -14,7 +14,7 @@ export const createPut = configure(api => { const controller = new AbortController() const signal = abortSignal(controller.signal, options.signal) - const res = await api.post('dht/put', { + const res = await api.post('routing/put', { signal, searchParams: toUrlSearchParams({ arg: key instanceof Uint8Array ? uint8ArrayToString(key) : key.toString(),