Skip to content
This repository has been archived by the owner. It is now read-only.

How to get file uploaded via ipfs ? #243

Closed
baimurzin opened this issue Mar 26, 2017 · 4 comments
Closed

How to get file uploaded via ipfs ? #243

baimurzin opened this issue Mar 26, 2017 · 4 comments

Comments

@baimurzin
Copy link

baimurzin commented Mar 26, 2017

Hello! I had uploaded a file using js-ipfs and the I have a trouble with getting this file?
I used something like that
node.files.add(fileToAdd, cb...)
Then got following output:

PFS Version: 0.23.0
Swarm listening on /ip4/127.0.0.1/tcp/4003/ws/ipfs/Qmd7K8fTVyQDnzJKPNNEiRALmt2zgcKSvWaGvZG1Xf3E2R
Swarm listening on /ip4/127.0.0.1/tcp/4002/ipfs/Qmd7K8fTVyQDnzJKPNNEiRALmt2zgcKSvWaGvZG1Xf3E2R
Swarm listening on /ip4/192.168.1.129/tcp/4002/ipfs/Qmd7K8fTVyQDnzJKPNNEiRALmt2zgcKSvWaGvZG1Xf3E2R
Swarm listening on /ip4/10.8.0.94/tcp/4002/ipfs/Qmd7K8fTVyQDnzJKPNNEiRALmt2zgcKSvWaGvZG1Xf3E2R

Node is now ready and online

Added file:
{ path: 'hello.txt',
  hash: 'QmXPGDVpD5AsPx6F5aZrv5EQK2zt5CnMg1GzDLN9Z9mvvk',
  size: 12 }

And now question is how I can get this file? I tried to make get request to ipfs.io/ipfs/{hash_here_QmXPGDV....}

And second question what are all of those links:
"Swarm listening on /ip4/..." ?

@kevinsimper
Copy link

kevinsimper commented Mar 27, 2017

Hi @baimurzin

Yes, that is correct, however information will take some time to propagate to ipfs.io, that can be 30 seconds to 5 mins depending on how you are connected.

Those Swarm is what ip's you are listening on, you can see you are listening both on /ws/ which is websockets, ipfs which is standard, both on you localhost 127.0.0.1, then 192.168.1.129 which is your local lan ip and then the last would be another public or private ip ipfs will respond on.

@daviddias
Copy link

daviddias commented Mar 29, 2017

@kevinsimper did you run that in the browser or in Node.js? Can you do a node.swarm.peers and see what comes out?

@baimurzin
Copy link
Author

baimurzin commented Mar 29, 2017

@kevinsimper @diasdavid So, to request a uploaded file, I just need make get request to this address in browser? 192.168.1.129:4002/{hash}
Or I should implement it first?

@flyingzumwalt
Copy link
Contributor

flyingzumwalt commented May 23, 2017

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

No branches or pull requests

4 participants