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

findprovs returns invalid JSON when using the API #1851

Closed
victorb opened this issue Oct 17, 2015 · 2 comments
Closed

findprovs returns invalid JSON when using the API #1851

victorb opened this issue Oct 17, 2015 · 2 comments

Comments

@victorb
Copy link
Member

victorb commented Oct 17, 2015

The CLI command findprovs works perfectly fine. Example output:

> $ ipfs dht findprovs QmXFmCEhamPHvpbzQ3HMFABrpAXgE7D9jzp6QtvyC8Xp55                                                                ⬡ 4.0.0 
QmNnCaT1sa8zAwpnqDARwhXWZgXQ452EVWvRJg9WkwVnUN
QmWuZGboBP9fpoFvFZ1H9mEKcor5Uz8vk76eib9ssvCpvW
QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd

However, when using the API and making the following request:

curl localhost:5001/api/v0/dht/findprovs?arg=QmXFmCEhamPHvpbzQ3HMFABrpAXgE7D9jzp6QtvyC8Xp55

Returns the following invalid JSON https://gist.github.com/VictorBjelkholm/1c459d6710c4e3a762f6

First, all the objects needs to be wrapper in an array. Secondly, between the objects, there has to be a comma.

A third, possibly unrelated issue, is that the response always seems to end with:

{
  "Extra": "routing: not found",
  "ID": "",
  "Responses": null,
  "Type": 3
}
@victorb victorb changed the title findprovs returns invalid JSON findprovs returns invalid JSON when using the API Oct 17, 2015
@victorb
Copy link
Member Author

victorb commented Oct 18, 2015

Closing this since seems to be a bug in the node-library
ipfs-inactive/js-ipfs-http-client#76

@victorb victorb closed this as completed Oct 18, 2015
@jbenet
Copy link
Member

jbenet commented Oct 18, 2015

try using curl on the API directly, if still not sure if it's in go-ipfs or node-ipfs-api

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants