Commit 293234ae authored by Henry's avatar Henry

InitializeKeyspace doesnt care about fuse

parent 66f1035d
// +build nofuse
package ipns
import (
"errors"
"github.com/jbenet/go-ipfs/core"
mdag "github.com/jbenet/go-ipfs/merkledag"
nsys "github.com/jbenet/go-ipfs/namesys"
ci "github.com/jbenet/go-ipfs/p2p/crypto"
ft "github.com/jbenet/go-ipfs/unixfs"
)
// InitializeKeyspace sets the ipns record for the given key to
// point to an empty directory.
func InitializeKeyspace(n *core.IpfsNode, key ci.PrivKey) error {
// emptyDir := &mdag.Node{Data: ft.FolderPBData()}
// nodek, err := n.DAG.Add(emptyDir)
// if err != nil {
// return err
// }
// err = n.Pinning.Pin(emptyDir, false)
// if err != nil {
// return err
// }
// err = n.Pinning.Flush()
// if err != nil {
// return err
// }
// pub := nsys.NewRoutingPublisher(n.Routing)
// err = pub.Publish(n.Context(), key, nodek)
// if err != nil {
// return err
// }
return errors.New("how is this fuse related?")
emptyDir := &mdag.Node{Data: ft.FolderPBData()}
nodek, err := n.DAG.Add(emptyDir)
if err != nil {
return err
}
err = n.Pinning.Pin(emptyDir, false)
if err != nil {
return err
}
err = n.Pinning.Flush()
if err != nil {
return err
}
pub := nsys.NewRoutingPublisher(n.Routing)
err = pub.Publish(n.Context(), key, nodek)
if err != nil {
return err
}
return nil
}
......@@ -20,7 +20,6 @@ import (
core "github.com/jbenet/go-ipfs/core"
chunk "github.com/jbenet/go-ipfs/importer/chunk"
mdag "github.com/jbenet/go-ipfs/merkledag"
nsys "github.com/jbenet/go-ipfs/namesys"
ci "github.com/jbenet/go-ipfs/p2p/crypto"
path "github.com/jbenet/go-ipfs/path"
ft "github.com/jbenet/go-ipfs/unixfs"
......@@ -39,34 +38,6 @@ var (
longRepublishTimeout = time.Millisecond * 500
)
// InitializeKeyspace sets the ipns record for the given key to
// point to an empty directory.
func InitializeKeyspace(n *core.IpfsNode, key ci.PrivKey) error {
emptyDir := &mdag.Node{Data: ft.FolderPBData()}
nodek, err := n.DAG.Add(emptyDir)
if err != nil {
return err
}
err = n.Pinning.Pin(emptyDir, false)
if err != nil {
return err
}
err = n.Pinning.Flush()
if err != nil {
return err
}
pub := nsys.NewRoutingPublisher(n.Routing)
err = pub.Publish(n.Context(), key, nodek)
if err != nil {
return err
}
return nil
}
// FileSystem is the readwrite IPNS Fuse Filesystem.
type FileSystem struct {
Ipfs *core.IpfsNode
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment