-
Notifications
You must be signed in to change notification settings - Fork 1.2k
ECONNREFUSED 127.0.0.1:5002 #1269
Comments
@Willzyc you are trying to connect to an IPFS instance (aka not a daemon). To Start an IPFS daemon use http://github.com/ipfs/js-ipfsd-ctl/ |
Have you managed to solve your problem yet? then ${package_name} is the name of the package you download, which will depend on your architecture: the 32 or 64 bit version. tar xvzf ${package_name} |
Would someone be able to help me understand the distinction between starting a |
Ah! An IPFS instance (whether in Go or JS) is a library or program that is able to communicate with other IPFS instances (or daemons, or whatever) using bitswap, to trade data back and forth. An IPFS daemon is a specific program that is packaged with both go-ipfs and js-ipfs that runs an IPFS instance, an HTTP API server, and an HTTP gateway server together, so you can control it externally and use it to load data in a browser (by browsing to the gateway). If you are running IPFS inside your own program as a package or library, you probably just want to run an instance (because you don’t need to control it externally). That’s what you get when you: const IPFS = require('ipfs')
const instance = new IPFS({ /* options */ }) BUT you can also start the HTTP API server or the gateway server in your process if you like, too (although it would probably be unusual).
One important thing to understand here is that
So |
Also, to clarify, when interacting with a daemon using |
Very helpful and thorough explanation! |
@Willzyc has that answered you question? |
Reopen if needed :) |
Uh oh!
There was an error while loading. Please reload this page.
Hello,
I tried to start developing with IPFS but I cannot get it working with the information provided by the documentation.
What I tried was starting a IPFS node and access it via the IPFS-API
My Script for starting the node is:
The terminal output was:
[14:27:56] Using gulpfile ~/Development/client/gulpfile.js
[14:27:56] Starting 'ipfs'...
[14:27:56] Finished 'ipfs' after 19 ms
Swarm listening on /ip4/127.0.0.1/tcp/4003/ws/ipfs/QmdKNWzEgeKdxrsgPu16U8fvAWU9AC8DjuAPoENAGSmfhC
Swarm listening on /ip4/127.0.0.1/tcp/4002/ipfs/QmdKNWzEgeKdxrsgPu16U8fvAWU9AC8DjuAPoENAGSmfhC
Swarm listening on /ip4/192.168.2.104/tcp/4002/ipfs/QmdKNWzEgeKdxrsgPu16U8fvAWU9AC8DjuAPoENAGSmfhC
Swarm listening on /ip4/10.8.8.2/tcp/4002/ipfs/QmdKNWzEgeKdxrsgPu16U8fvAWU9AC8DjuAPoENAGSmfhC
And then the API call with this script (I opened a new terminal, so the ipfs node keeps running):
Here I get the error:
{ Error: connect ECONNREFUSED 127.0.0.1:5002
at Object.exports._errnoException (util.js:1050:11)
at exports._exceptionWithHostPort (util.js:1073:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1093:14)
code: 'ECONNREFUSED',
errno: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 5002 }
The same with port 5001
I dont know if its an ipfs or ipfs-api issue, did I missed anything crucial?
I am running on Ubuntu 16.04
The text was updated successfully, but these errors were encountered: