move reprovider out of exchange directory

License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
This commit is contained in:
Łukasz Magiera 2019-04-23 14:41:00 +02:00
parent fc4dbb638a
commit 14866308c7
6 changed files with 13 additions and 15 deletions

View File

@ -19,7 +19,6 @@ import (
"github.com/ipfs/go-ipfs/core/bootstrap"
"github.com/ipfs/go-ipfs/core/node"
"github.com/ipfs/go-ipfs/core/node/libp2p"
rp "github.com/ipfs/go-ipfs/exchange/reprovide"
"github.com/ipfs/go-ipfs/filestore"
"github.com/ipfs/go-ipfs/fuse/mount"
"github.com/ipfs/go-ipfs/namesys"
@ -28,6 +27,7 @@ import (
"github.com/ipfs/go-ipfs/pin"
"github.com/ipfs/go-ipfs/provider"
"github.com/ipfs/go-ipfs/repo"
rp "github.com/ipfs/go-ipfs/reprovide"
bserv "github.com/ipfs/go-blockservice"
bstore "github.com/ipfs/go-ipfs-blockstore"
@ -69,9 +69,9 @@ type IpfsNode struct {
Repo repo.Repo
// Local node
Pinning pin.Pinner // the pinning manager
Mounts Mounts `optional:"true"` // current mount state, if any.
PrivateKey ic.PrivKey // the local node's private Key
Pinning pin.Pinner // the pinning manager
Mounts Mounts `optional:"true"` // current mount state, if any.
PrivateKey ic.PrivKey // the local node's private Key
PNetFingerprint libp2p.PNetFingerprint `optional:"true"` // fingerprint of private network
// Services

View File

@ -119,4 +119,3 @@ func Files(mctx helpers.MetricsCtx, lc fx.Lifecycle, repo repo.Repo, dag format.
return root, err
}

View File

@ -11,10 +11,10 @@ import (
"go.uber.org/fx"
"github.com/ipfs/go-ipfs/core/node/helpers"
"github.com/ipfs/go-ipfs/exchange/reprovide"
"github.com/ipfs/go-ipfs/pin"
"github.com/ipfs/go-ipfs/provider"
"github.com/ipfs/go-ipfs/repo"
"github.com/ipfs/go-ipfs/reprovide"
)
const kReprovideFrequency = time.Hour * 12

View File

@ -3,13 +3,13 @@ package reprovide
import (
"context"
pin "github.com/ipfs/go-ipfs/pin"
"github.com/ipfs/go-ipfs/pin"
cid "github.com/ipfs/go-cid"
cidutil "github.com/ipfs/go-cidutil"
"github.com/ipfs/go-cid"
"github.com/ipfs/go-cidutil"
blocks "github.com/ipfs/go-ipfs-blockstore"
ipld "github.com/ipfs/go-ipld-format"
merkledag "github.com/ipfs/go-merkledag"
"github.com/ipfs/go-merkledag"
)
// NewBlockstoreProvider returns key provider using bstore.AllKeysChan

View File

@ -2,6 +2,7 @@ package reprovide_test
import (
"context"
"github.com/ipfs/go-ipfs"
"testing"
blocks "github.com/ipfs/go-block-format"
@ -10,9 +11,7 @@ import (
blockstore "github.com/ipfs/go-ipfs-blockstore"
mock "github.com/ipfs/go-ipfs-routing/mock"
pstore "github.com/libp2p/go-libp2p-peerstore"
testutil "github.com/libp2p/go-testutil"
. "github.com/ipfs/go-ipfs/exchange/reprovide"
"github.com/libp2p/go-testutil"
)
func TestReprovide(t *testing.T) {
@ -35,8 +34,8 @@ func TestReprovide(t *testing.T) {
t.Fatal(err)
}
keyProvider := NewBlockstoreProvider(bstore)
reprov := NewReprovider(ctx, clA, keyProvider)
keyProvider := ipfs.NewBlockstoreProvider(bstore)
reprov := ipfs.NewReprovider(ctx, clA, keyProvider)
err = reprov.Reprovide()
if err != nil {
t.Fatal(err)