After I add a file to ipfs using ipfs add hello
- how to do I retrieve the hash for the file if I lose it?
I guess I'm expecting ipfs info <filepath>
or something similar?
Alternatively, you can access IPFS content from any browser by using a public gateway such as https://ipfs.io or https://cloudflare-ipfs.com. A gateway will automatically route you to IPFS content using the link, and there's a long list of alternative gateways available.
IPFS is fundamentally a Distributed Hash Table (DHT) Open external link which maps from CIDs to people who have the content addressed by that CID. The hash table is distributed because no single node in the network holds the entire table.
IPFS is a decentralized, peer-to-peer file sharing protocol. The IPFS network runs on the web and uses content-addressed storage (CAS) to store data and retrieve it based on its content, not its location. IPFS uses this method to uniquely identify and fetch the data in question.
If you want to see what the hash of a file would be, without actually uploading it to IPFS, you can run ipfs add --only-hash
, or ipfs add -n
for short.
just run ipfs add hello
again...
Make sure ipfs daemon
is running before proceeding.
ipfs get theHashOfTheItem
in the command line will print out the raw data/ text of the block corresponding to that particular hash
To get a list of objects with the hash that is hosted on your computer, you may run the daemon using ipfs daemon
followed by going to and checking under Files.
http://localhost:5001/webui
I remember reading a way to get the list of hashes via the command line, but I can't seem to remember it. Once I get it, I shall post the details about that here as well.
Not ideal, but checking the information each hash stores, either by using the command shared on top or clicking on the files itself within the browser should let you find the hash you are looking for.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With