@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!