Skip to content

Commit eb3d7dd

Browse files
committed
Remove InitializeKeyspace function from publisher
This is mostly go-ipfs specific and has been moved there. See ipfs/kubo#7984 This commit was moved from ipfs/go-namesys@67510bf
1 parent 99f7d76 commit eb3d7dd

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

namesys/publisher.go

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,9 @@ import (
99
proto "github.com/gogo/protobuf/proto"
1010
ds "github.com/ipfs/go-datastore"
1111
dsquery "github.com/ipfs/go-datastore/query"
12-
pin "github.com/ipfs/go-ipfs-pinner"
1312
ipns "github.com/ipfs/go-ipns"
1413
pb "github.com/ipfs/go-ipns/pb"
1514
path "github.com/ipfs/go-path"
16-
ft "github.com/ipfs/go-unixfs"
1715
ci "github.com/libp2p/go-libp2p-core/crypto"
1816
peer "github.com/libp2p/go-libp2p-core/peer"
1917
routing "github.com/libp2p/go-libp2p-core/routing"
@@ -294,27 +292,6 @@ func PublishEntry(ctx context.Context, r routing.ValueStore, ipnskey string, rec
294292
return r.PutValue(ctx, ipnskey, data)
295293
}
296294

297-
// InitializeKeyspace sets the ipns record for the given key to
298-
// point to an empty directory.
299-
// TODO: this doesnt feel like it belongs here
300-
func InitializeKeyspace(ctx context.Context, pub Publisher, pins pin.Pinner, key ci.PrivKey) error {
301-
emptyDir := ft.EmptyDirNode()
302-
303-
// pin recursively because this might already be pinned
304-
// and doing a direct pin would throw an error in that case
305-
err := pins.Pin(ctx, emptyDir, true)
306-
if err != nil {
307-
return err
308-
}
309-
310-
err = pins.Flush(ctx)
311-
if err != nil {
312-
return err
313-
}
314-
315-
return pub.Publish(ctx, key, path.FromCid(emptyDir.Cid()))
316-
}
317-
318295
// PkKeyForID returns the public key routing key for the given peer ID.
319296
func PkKeyForID(id peer.ID) string {
320297
return "/pk/" + string(id)

0 commit comments

Comments
 (0)