akashgoswami / ipm

IOTA node peer manager. Useful for monitoring IOTA peers
MIT License
72 stars 24 forks source link

Not working with IRI 1.4.1 #21

Closed jjmiranda closed 6 years ago

jjmiranda commented 6 years ago

Thrown this error: Error: Request Error: Invalid API Version at Object.requestError (/usr/lib/node_modules/iota-pm/node_modules/iota.lib.js/lib/errors/requestErrors.js:11:12)

Thanks for your time on this wonderful tool. Send to you more MIOTAS for your excellent work!

jjmiranda commented 6 years ago

I think the problem is this new header: 'X-IOTA-API-Version: 1.4.1' This version thrown the error: curl -s http://localhost:14265 -X POST -H 'Content-Type: application/json' -d '{"command": "getNodeInfo"}' {"error":"Invalid API Version","duration":0} This version its OK: curl -s http://localhost:14265 -X POST -H 'X-IOTA-API-Version: 1.4.1' -H 'Content-Type: application/json' -d '{"command": "getNodeInfo"}'

Thanks for your time to implement this solution!

jjmiranda commented 6 years ago

The problem is not here man :) ! The problem is here: https://github.com/iotaledger/iota.lib.js/blob/master/lib/utils/makeRequest.js add "request.setRequestHeader('X-IOTA-API-Version','1.4.1');" at line 34 👍

akashgoswami commented 6 years ago

Hi Juan,

So is this a problem with iota.lib.js? Could you please raise the issue there and close this one?

BR Akash

medisoft commented 6 years ago

Hi! How to apply the fix? Should I reinstall ipm from the git instead from npmjs?

akashgoswami commented 6 years ago

Just published the latest version. Please uninstall the previous version before updating the newer. sudo npm uninstall iota-pm && sudo npm install -g iota-pm

jojoCoWorker commented 6 years ago

same (problem) on version 1.4.2.1, here is what works fine : curl -s http://localhost:14265 -X POST -H 'X-IOTA-API-Version: 1.4.2.1' -H 'Content-Type: application/json' -d '{"command": "getNodeInfo"}'