@alexander Thanks!
Hi, I am working on an open source IoT project written in python, and will be happy to share it when the solution comes. Please keep this going!
Did you happen to find an answer this this? I’m just stumbling across the same problem, and haven’t found a solution yet.
I’m curious if anyone has generated the same hashes as ipfs add
in Go without running a daemon.
Hey @josselinchevalay, correct me if I’m wrong, but I was thinking multihash isn’t enough. To get the output from ipfs add
you need to chunk the file, build a dag and hash it. A wrapper is added around files as well I believe.
Here’s the code for add
.
hi,
yep you have reason
Hi all, I solved this a while ago with go-ipfs so I’d figure I will share it here:
dstore := datastore.NewMapDatastore() bstore := blockstore.NewBlockstore(dstore) bserv := blockservice.New(bstore, offline.Exchange(bstore)) dserv := merkledag.NewDAGService(bserv)
n := &core.IpfsNode{ Blockstore: blockstore.NewGCBlockstore(bstore, blockstore.NewGCLocker()), Pinning: pin.NewPinner(dstore, dserv, dserv), DAG: dserv, }
r, err := os.Open(filename) if err != nil { return err }
// key is the hash from ipfs add. key, err := coreunix.Add(n, r) if err != nil { return err }
Just curious…
Is there a way to differentiate or recognize the folder from a file by the encoding done using Multihash?
@flyingzumwalt or anyone can probably help me answer that question.
TIA!
I would appreciate if someone test my little example project producing CID out of the raw data:
We have discussed it with the guys here, and it seems working.