Skip to content

Commit

Permalink
fix: use /api/v0/routing instead of deprecated /api/v0/dht (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
hacdias authored Feb 6, 2024
1 parent 4e779a6 commit 7725de3
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/dht/find-peer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/dht/find-provs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
2 changes: 1 addition & 1 deletion src/dht/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion src/dht/provide.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down
2 changes: 1 addition & 1 deletion src/dht/put.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 7725de3

Please sign in to comment.