Skip to content

Commit b71659a

Browse files
committedApr 12, 2024·
fix: code compatible with denpendencies upgrades
Signed-off-by: D4ryl00 <[email protected]>
1 parent 0e443eb commit b71659a

File tree

17 files changed

+60
-71
lines changed

17 files changed

+60
-71
lines changed
 

‎accesscontroller/ipfs/accesscontroller_ipfs.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
"berty.tech/go-orbit-db/iface"
1515
cid "github.com/ipfs/go-cid"
1616
cbornode "github.com/ipfs/go-ipld-cbor"
17-
coreapi "github.com/ipfs/interface-go-ipfs-core"
17+
coreiface "github.com/ipfs/kubo/core/coreiface"
1818
"github.com/polydawn/refmt/obj/atlas"
1919
"go.uber.org/zap"
2020
)
@@ -24,7 +24,7 @@ type cborWriteAccess struct {
2424
}
2525

2626
type ipfsAccessController struct {
27-
ipfs coreapi.CoreAPI
27+
ipfs coreiface.CoreAPI
2828
writeAccess []string
2929
muWriteAccess sync.RWMutex
3030
logger *zap.Logger

‎accesscontroller/manifest.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"berty.tech/go-ipfs-log/io"
1010
cid "github.com/ipfs/go-cid"
1111
cbornode "github.com/ipfs/go-ipld-cbor"
12-
coreapi "github.com/ipfs/interface-go-ipfs-core"
12+
coreiface "github.com/ipfs/kubo/core/coreiface"
1313
"github.com/polydawn/refmt/obj/atlas"
1414
"go.uber.org/zap"
1515
)
@@ -140,7 +140,7 @@ type ManifestParams interface {
140140
}
141141

142142
// CreateManifest Creates a new manifest and returns its CID
143-
func CreateManifest(ctx context.Context, ipfs coreapi.CoreAPI, controllerType string, params ManifestParams) (cid.Cid, error) {
143+
func CreateManifest(ctx context.Context, ipfs coreiface.CoreAPI, controllerType string, params ManifestParams) (cid.Cid, error) {
144144
if params.GetSkipManifest() {
145145
return params.GetAddress(), nil
146146
}
@@ -157,7 +157,7 @@ func CreateManifest(ctx context.Context, ipfs coreapi.CoreAPI, controllerType st
157157
}
158158

159159
// ResolveManifest Retrieves a manifest from its address
160-
func ResolveManifest(ctx context.Context, ipfs coreapi.CoreAPI, manifestAddress string, params ManifestParams) (*Manifest, error) {
160+
func ResolveManifest(ctx context.Context, ipfs coreiface.CoreAPI, manifestAddress string, params ManifestParams) (*Manifest, error) {
161161
if params.GetSkipManifest() {
162162
if params.GetType() == "" {
163163
return nil, fmt.Errorf("no manifest, access-controller type required")

‎baseorbitdb/orbitdb.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
datastore "github.com/ipfs/go-datastore"
2727
leveldb "github.com/ipfs/go-ds-leveldb"
2828
cbornode "github.com/ipfs/go-ipld-cbor"
29-
coreapi "github.com/ipfs/interface-go-ipfs-core"
29+
coreiface "github.com/ipfs/kubo/core/coreiface"
3030
"github.com/libp2p/go-libp2p/core/event"
3131
peer "github.com/libp2p/go-libp2p/core/peer"
3232
"github.com/libp2p/go-libp2p/p2p/host/eventbus"
@@ -98,7 +98,7 @@ type orbitDB struct {
9898
cancel context.CancelFunc
9999
storeTypes map[string]iface.StoreConstructor
100100
accessControllerTypes map[string]iface.AccessControllerConstructor
101-
ipfs coreapi.CoreAPI
101+
ipfs coreiface.CoreAPI
102102
identity *idp.Identity
103103
id peer.ID
104104
pubsub iface.PubSubInterface
@@ -136,7 +136,7 @@ func (o *orbitDB) Tracer() trace.Tracer {
136136
return o.tracer
137137
}
138138

139-
func (o *orbitDB) IPFS() coreapi.CoreAPI {
139+
func (o *orbitDB) IPFS() coreiface.CoreAPI {
140140
o.muIPFS.RLock()
141141
defer o.muIPFS.RUnlock()
142142

@@ -316,7 +316,7 @@ func (o *orbitDB) getStoreConstructor(s string) (iface.StoreConstructor, bool) {
316316
return constructor, ok
317317
}
318318

319-
func newOrbitDB(ctx context.Context, is coreapi.CoreAPI, identity *idp.Identity, options *NewOrbitDBOptions) (BaseOrbitDB, error) {
319+
func newOrbitDB(ctx context.Context, is coreiface.CoreAPI, identity *idp.Identity, options *NewOrbitDBOptions) (BaseOrbitDB, error) {
320320
if is == nil {
321321
return nil, fmt.Errorf("ipfs is a required argument")
322322
}
@@ -408,7 +408,7 @@ func newOrbitDB(ctx context.Context, is coreapi.CoreAPI, identity *idp.Identity,
408408
}
409409

410410
// NewOrbitDB Creates a new OrbitDB instance
411-
func NewOrbitDB(ctx context.Context, ipfs coreapi.CoreAPI, options *NewOrbitDBOptions) (BaseOrbitDB, error) {
411+
func NewOrbitDB(ctx context.Context, ipfs coreiface.CoreAPI, options *NewOrbitDBOptions) (BaseOrbitDB, error) {
412412
if ipfs == nil {
413413
return nil, fmt.Errorf("ipfs is a required argument")
414414
}
@@ -571,10 +571,10 @@ func (o *orbitDB) Open(ctx context.Context, dbAddress string, options *CreateDBO
571571
return nil, fmt.Errorf("'options.Create' set to 'false'. If you want to create a database, set 'options.Create' to 'true'")
572572
} else if *options.Create && (options.StoreType == nil || *options.StoreType == "") {
573573
return nil, fmt.Errorf("database type not provided! Provide a type with 'options.StoreType' (%s)", strings.Join(o.storeTypesNames(), "|"))
574-
} else {
575-
options.Overwrite = boolPtr(true)
576-
return o.Create(ctx, dbAddress, *options.StoreType, options)
577574
}
575+
576+
options.Overwrite = boolPtr(true)
577+
return o.Create(ctx, dbAddress, *options.StoreType, options)
578578
}
579579

580580
parsedDBAddress, err := address.Parse(dbAddress)

‎go.mod

+1-9
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ go 1.21
44

55
require (
66
berty.tech/go-ipfs-log v1.10.2
7+
github.com/ipfs/boxo v0.18.0
78
github.com/ipfs/go-cid v0.4.1
89
github.com/ipfs/go-datastore v0.6.0
910
github.com/ipfs/go-ds-leveldb v0.5.0
1011
github.com/ipfs/go-ipld-cbor v0.1.0
1112
github.com/ipfs/go-libipfs v0.6.2
12-
github.com/ipfs/interface-go-ipfs-core v0.11.1
1313
github.com/ipfs/kubo v0.27.0
1414
github.com/libp2p/go-libp2p v0.33.0
1515
github.com/libp2p/go-libp2p-pubsub v0.10.0
@@ -74,20 +74,16 @@ require (
7474
github.com/ipfs-shipyard/nopfs v0.0.12 // indirect
7575
github.com/ipfs-shipyard/nopfs/ipfs v0.13.2-0.20231027223058-cde3b5ba964c // indirect
7676
github.com/ipfs/bbloom v0.0.4 // indirect
77-
github.com/ipfs/boxo v0.18.0 // indirect
7877
github.com/ipfs/go-bitfield v1.1.0 // indirect
7978
github.com/ipfs/go-block-format v0.2.0 // indirect
80-
github.com/ipfs/go-blockservice v0.5.0 // indirect
8179
github.com/ipfs/go-cidutil v0.1.0 // indirect
8280
github.com/ipfs/go-ds-badger v0.3.0 // indirect
8381
github.com/ipfs/go-ds-flatfs v0.5.1 // indirect
8482
github.com/ipfs/go-ds-measure v0.2.0 // indirect
8583
github.com/ipfs/go-fs-lock v0.0.7 // indirect
86-
github.com/ipfs/go-ipfs-blockstore v1.3.0 // indirect
8784
github.com/ipfs/go-ipfs-cmds v0.10.0 // indirect
8885
github.com/ipfs/go-ipfs-delay v0.0.1 // indirect
8986
github.com/ipfs/go-ipfs-ds-help v1.1.0 // indirect
90-
github.com/ipfs/go-ipfs-exchange-interface v0.2.0 // indirect
9187
github.com/ipfs/go-ipfs-pq v0.0.3 // indirect
9288
github.com/ipfs/go-ipfs-redirects-file v0.1.1 // indirect
9389
github.com/ipfs/go-ipfs-util v0.0.3 // indirect
@@ -96,12 +92,9 @@ require (
9692
github.com/ipfs/go-ipld-legacy v0.2.1 // indirect
9793
github.com/ipfs/go-log v1.0.5 // indirect
9894
github.com/ipfs/go-log/v2 v2.5.1 // indirect
99-
github.com/ipfs/go-merkledag v0.11.0 // indirect
10095
github.com/ipfs/go-metrics-interface v0.0.1 // indirect
101-
github.com/ipfs/go-path v0.3.1 // indirect
10296
github.com/ipfs/go-peertaskqueue v0.8.1 // indirect
10397
github.com/ipfs/go-unixfsnode v1.9.0 // indirect
104-
github.com/ipfs/go-verifcid v0.0.2 // indirect
10598
github.com/ipld/go-car/v2 v2.13.1 // indirect
10699
github.com/ipld/go-codec-dagpb v1.6.0 // indirect
107100
github.com/ipld/go-ipld-prime v0.21.0 // indirect
@@ -197,7 +190,6 @@ require (
197190
go.opentelemetry.io/otel/metric v1.22.0 // indirect
198191
go.opentelemetry.io/otel/sdk v1.21.0 // indirect
199192
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
200-
go.uber.org/atomic v1.11.0 // indirect
201193
go.uber.org/dig v1.17.1 // indirect
202194
go.uber.org/fx v1.20.1 // indirect
203195
go.uber.org/mock v0.4.0 // indirect

‎go.sum

-8
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,6 @@ github.com/ipfs/boxo v0.18.0 h1:MOL9/AgoV3e7jlVMInicaSdbgralfqSsbkc31dZ9tmw=
277277
github.com/ipfs/boxo v0.18.0/go.mod h1:pIZgTWdm3k3pLF9Uq6MB8JEcW07UDwNJjlXW1HELW80=
278278
github.com/ipfs/go-bitfield v1.1.0 h1:fh7FIo8bSwaJEh6DdTWbCeZ1eqOaOkKFI74SCnsWbGA=
279279
github.com/ipfs/go-bitfield v1.1.0/go.mod h1:paqf1wjq/D2BBmzfTVFlJQ9IlFOZpg422HL0HqsGWHU=
280-
github.com/ipfs/go-bitswap v0.11.0 h1:j1WVvhDX1yhG32NTC9xfxnqycqYIlhzEzLXG/cU1HyQ=
281-
github.com/ipfs/go-bitswap v0.11.0/go.mod h1:05aE8H3XOU+LXpTedeAS0OZpcO1WFsj5niYQH9a1Tmk=
282280
github.com/ipfs/go-block-format v0.0.3/go.mod h1:4LmD4ZUw0mhO+JSKdpWwrzATiEfM7WWgQ8H5l6P8MVk=
283281
github.com/ipfs/go-block-format v0.2.0 h1:ZqrkxBA2ICbDRbK8KJs/u0O3dlp6gmAuuXUJNiW1Ycs=
284282
github.com/ipfs/go-block-format v0.2.0/go.mod h1:+jpL11nFx5A/SPpsoBn6Bzkra/zaArfSmsknbPMYgzM=
@@ -333,8 +331,6 @@ github.com/ipfs/go-ipfs-pq v0.0.3 h1:YpoHVJB+jzK15mr/xsWC574tyDLkezVrDNeaalQBsTE
333331
github.com/ipfs/go-ipfs-pq v0.0.3/go.mod h1:btNw5hsHBpRcSSgZtiNm/SLj5gYIZ18AKtv3kERkRb4=
334332
github.com/ipfs/go-ipfs-redirects-file v0.1.1 h1:Io++k0Vf/wK+tfnhEh63Yte1oQK5VGT2hIEYpD0Rzx8=
335333
github.com/ipfs/go-ipfs-redirects-file v0.1.1/go.mod h1:tAwRjCV0RjLTjH8DR/AU7VYvfQECg+lpUy2Mdzv7gyk=
336-
github.com/ipfs/go-ipfs-routing v0.3.0 h1:9W/W3N+g+y4ZDeffSgqhgo7BsBSJwPMcyssET9OWevc=
337-
github.com/ipfs/go-ipfs-routing v0.3.0/go.mod h1:dKqtTFIql7e1zYsEuWLyuOU+E0WJWW8JjbTPLParDWo=
338334
github.com/ipfs/go-ipfs-util v0.0.1/go.mod h1:spsl5z8KUnrve+73pOhSVZND1SIxPW5RyBCNzQxlJBc=
339335
github.com/ipfs/go-ipfs-util v0.0.2/go.mod h1:CbPtkWJzjLdEcezDns2XYaehFVNXG9zrdrtMecczcsQ=
340336
github.com/ipfs/go-ipfs-util v0.0.3 h1:2RFdGez6bu2ZlZdI+rWfIdbQb1KudQp3VGwPtdNCmE0=
@@ -363,8 +359,6 @@ github.com/ipfs/go-merkledag v0.11.0 h1:DgzwK5hprESOzS4O1t/wi6JDpyVQdvm9Bs59N/jq
363359
github.com/ipfs/go-merkledag v0.11.0/go.mod h1:Q4f/1ezvBiJV0YCIXvt51W/9/kqJGH4I1LsA7+djsM4=
364360
github.com/ipfs/go-metrics-interface v0.0.1 h1:j+cpbjYvu4R8zbleSs36gvB7jR+wsL2fGD6n0jO4kdg=
365361
github.com/ipfs/go-metrics-interface v0.0.1/go.mod h1:6s6euYU4zowdslK0GKHmqaIZ3j/b/tL7HTWtJ4VPgWY=
366-
github.com/ipfs/go-path v0.3.1 h1:wkeaCWE/NTuuPGlEkLTsED5UkzfKYZpxaFFPgk8ZVLE=
367-
github.com/ipfs/go-path v0.3.1/go.mod h1:eNLsxJEEMxn/CDzUJ6wuNl+6No6tEUhOZcPKsZsYX0E=
368362
github.com/ipfs/go-peertaskqueue v0.8.1 h1:YhxAs1+wxb5jk7RvS0LHdyiILpNmRIRnZVztekOF0pg=
369363
github.com/ipfs/go-peertaskqueue v0.8.1/go.mod h1:Oxxd3eaK279FxeydSPPVGHzbwVeHjatZ2GA8XD+KbPU=
370364
github.com/ipfs/go-unixfs v0.4.5 h1:wj8JhxvV1G6CD7swACwSKYa+NgtdWC1RUit+gFnymDU=
@@ -373,8 +367,6 @@ github.com/ipfs/go-unixfsnode v1.9.0 h1:ubEhQhr22sPAKO2DNsyVBW7YB/zA8Zkif25aBvz8
373367
github.com/ipfs/go-unixfsnode v1.9.0/go.mod h1:HxRu9HYHOjK6HUqFBAi++7DVoWAHn0o4v/nZ/VA+0g8=
374368
github.com/ipfs/go-verifcid v0.0.2 h1:XPnUv0XmdH+ZIhLGKg6U2vaPaRDXb9urMyNVCE7uvTs=
375369
github.com/ipfs/go-verifcid v0.0.2/go.mod h1:40cD9x1y4OWnFXbLNJYRe7MpNvWlMn3LZAG5Wb4xnPU=
376-
github.com/ipfs/interface-go-ipfs-core v0.11.1 h1:xVW8DKzd230h8bPv+oC2fBjW4PtDGqGtvpX64/aBe48=
377-
github.com/ipfs/interface-go-ipfs-core v0.11.1/go.mod h1:xmnoccUXY7N/Q8AIx0vFqgW926/FAZ8+do/1NTEHKsU=
378370
github.com/ipfs/kubo v0.27.0 h1:rVWKI9VGYt8Eyr/4vflUbT6OrOgOWG0ddHeEAajKClA=
379371
github.com/ipfs/kubo v0.27.0/go.mod h1:7HMQUnD+S1q9P3G7iV3VfwHzukJ/PeUm4geYYDC+hx0=
380372
github.com/ipld/go-car/v2 v2.13.1 h1:KnlrKvEPEzr5IZHKTXLAEub+tPrzeAFQVRlSQvuxBO4=

‎iface/interface.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
"berty.tech/go-orbit-db/stores/replicator"
1717
cid "github.com/ipfs/go-cid"
1818
datastore "github.com/ipfs/go-datastore"
19-
coreapi "github.com/ipfs/interface-go-ipfs-core"
19+
coreiface "github.com/ipfs/kubo/core/coreiface"
2020
"github.com/libp2p/go-libp2p/core/event"
2121
peer "github.com/libp2p/go-libp2p/core/peer"
2222
"go.opentelemetry.io/otel/trace"
@@ -75,7 +75,7 @@ type DetermineAddressOptions struct {
7575
// BaseOrbitDB Provides the main OrbitDB interface used to open and create stores
7676
type BaseOrbitDB interface {
7777
// IPFS Returns the instance of the IPFS API used by the current DB
78-
IPFS() coreapi.CoreAPI
78+
IPFS() coreiface.CoreAPI
7979

8080
// Identity Returns the identity used by the current DB
8181
Identity() *identityprovider.Identity
@@ -220,7 +220,7 @@ type Store interface {
220220
OpLog() ipfslog.Log
221221

222222
// IPFS Returns the IPFS instance for the store
223-
IPFS() coreapi.CoreAPI
223+
IPFS() coreiface.CoreAPI
224224

225225
// DBName Returns the store name as a string
226226
DBName() string
@@ -378,7 +378,7 @@ type DirectChannelEmitter interface {
378378
type DirectChannelFactory func(ctx context.Context, emitter DirectChannelEmitter, opts *DirectChannelOptions) (DirectChannel, error)
379379

380380
// StoreConstructor Defines the expected constructor for a custom store
381-
type StoreConstructor func(coreapi.CoreAPI, *identityprovider.Identity, address.Address, *NewStoreOptions) (Store, error)
381+
type StoreConstructor func(coreiface.CoreAPI, *identityprovider.Identity, address.Address, *NewStoreOptions) (Store, error)
382382

383383
// IndexConstructor Defines the expected constructor for a custom index
384384
type IndexConstructor func(publicKey []byte) StoreIndex

‎orbitdb.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"context"
55
"fmt"
66

7-
coreapi "github.com/ipfs/interface-go-ipfs-core"
7+
coreiface "github.com/ipfs/kubo/core/coreiface"
88

99
"berty.tech/go-orbit-db/accesscontroller/ipfs"
1010
"berty.tech/go-orbit-db/accesscontroller/orbitdb"
@@ -63,7 +63,7 @@ type DetermineAddressOptions = iface.DetermineAddressOptions
6363
type NewOrbitDBOptions = baseorbitdb.NewOrbitDBOptions
6464

6565
// NewOrbitDB Creates a new OrbitDB instance with default access controllers and store types
66-
func NewOrbitDB(ctx context.Context, i coreapi.CoreAPI, options *NewOrbitDBOptions) (iface.OrbitDB, error) {
66+
func NewOrbitDB(ctx context.Context, i coreiface.CoreAPI, options *NewOrbitDBOptions) (iface.OrbitDB, error) {
6767
odb, err := baseorbitdb.NewOrbitDB(ctx, i, options)
6868

6969
if err != nil {

‎pubsub/oneonone/channel.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88
"sync"
99
"time"
1010

11-
coreapi "github.com/ipfs/interface-go-ipfs-core"
12-
"github.com/ipfs/interface-go-ipfs-core/options"
11+
coreiface "github.com/ipfs/kubo/core/coreiface"
12+
"github.com/ipfs/kubo/core/coreiface/options"
1313
peer "github.com/libp2p/go-libp2p/core/peer"
1414
"go.uber.org/zap"
1515

@@ -26,7 +26,7 @@ type channel struct {
2626
ctx context.Context
2727
cancel context.CancelFunc
2828
id string
29-
sub coreapi.PubSubSubscription
29+
sub coreiface.PubSubSubscription
3030
}
3131

3232
type channels struct {
@@ -37,7 +37,7 @@ type channels struct {
3737
emitter iface.DirectChannelEmitter
3838
ctx context.Context
3939
cancel context.CancelFunc
40-
ipfs coreapi.CoreAPI
40+
ipfs coreiface.CoreAPI
4141
logger *zap.Logger
4242
}
4343

@@ -133,7 +133,7 @@ func (c *channels) getChannelID(p peer.ID) string {
133133
return fmt.Sprintf("/%s/%s", PROTOCOL, strings.Join(channelIDPeers, "/"))
134134
}
135135

136-
func (c *channels) monitorTopic(ctx context.Context, sub coreapi.PubSubSubscription, p peer.ID) {
136+
func (c *channels) monitorTopic(ctx context.Context, sub coreiface.PubSubSubscription, p peer.ID) {
137137
for {
138138
msg, err := sub.Next(ctx)
139139
switch err {
@@ -173,7 +173,7 @@ func (c *channels) Close() error {
173173
}
174174

175175
// NewChannel Creates a new pubsub topic for communication between two peers
176-
func NewChannelFactory(ipfs coreapi.CoreAPI) iface.DirectChannelFactory {
176+
func NewChannelFactory(ipfs coreiface.CoreAPI) iface.DirectChannelFactory {
177177
return func(ctx context.Context, emitter iface.DirectChannelEmitter, opts *iface.DirectChannelOptions) (iface.DirectChannel, error) {
178178
ctx, cancel := context.WithCancel(ctx)
179179

‎pubsub/pubsubcoreapi/pubsub.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55
"sync"
66
"time"
77

8-
coreapi "github.com/ipfs/interface-go-ipfs-core"
9-
options "github.com/ipfs/interface-go-ipfs-core/options"
8+
coreiface "github.com/ipfs/kubo/core/coreiface"
9+
"github.com/ipfs/kubo/core/coreiface/options"
1010
"github.com/libp2p/go-libp2p/core/peer"
1111
"go.opentelemetry.io/otel/trace"
1212
"go.uber.org/zap"
@@ -141,7 +141,7 @@ func (p *psTopic) Topic() string {
141141
}
142142

143143
type coreAPIPubSub struct {
144-
api coreapi.CoreAPI
144+
api coreiface.CoreAPI
145145
logger *zap.Logger
146146
id peer.ID
147147
pollInterval time.Duration
@@ -166,7 +166,7 @@ func (c *coreAPIPubSub) TopicSubscribe(_ context.Context, topic string) (iface.P
166166
return c.topics[topic], nil
167167
}
168168

169-
func NewPubSub(api coreapi.CoreAPI, id peer.ID, pollInterval time.Duration, logger *zap.Logger, tracer trace.Tracer) iface.PubSubInterface {
169+
func NewPubSub(api coreiface.CoreAPI, id peer.ID, pollInterval time.Duration, logger *zap.Logger, tracer trace.Tracer) iface.PubSubInterface {
170170
if logger == nil {
171171
logger = zap.NewNop()
172172
}

‎stores/basestore/base_store.go

+11-6
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ import (
2323
"berty.tech/go-orbit-db/stores"
2424
"berty.tech/go-orbit-db/stores/operation"
2525
"berty.tech/go-orbit-db/stores/replicator"
26+
"github.com/ipfs/boxo/path"
2627
cid "github.com/ipfs/go-cid"
2728
datastore "github.com/ipfs/go-datastore"
2829
files "github.com/ipfs/go-libipfs/files"
29-
coreapi "github.com/ipfs/interface-go-ipfs-core"
30-
"github.com/ipfs/interface-go-ipfs-core/path"
30+
coreiface "github.com/ipfs/kubo/core/coreiface"
3131
"github.com/libp2p/go-libp2p/core/event"
3232
"github.com/libp2p/go-libp2p/core/peer"
3333
"github.com/libp2p/go-libp2p/p2p/host/eventbus"
@@ -54,7 +54,7 @@ type BaseStore struct {
5454
identity *identityprovider.Identity
5555
address address.Address
5656
dbName string
57-
ipfs coreapi.CoreAPI
57+
ipfs coreiface.CoreAPI
5858
cache datastore.Datastore
5959
access accesscontroller.Interface
6060
oplog ipfslog.Log
@@ -89,7 +89,7 @@ func (b *BaseStore) DBName() string {
8989
return b.dbName
9090
}
9191

92-
func (b *BaseStore) IPFS() coreapi.CoreAPI {
92+
func (b *BaseStore) IPFS() coreiface.CoreAPI {
9393
return b.ipfs
9494
}
9595

@@ -136,7 +136,7 @@ func (b *BaseStore) EventBus() event.Bus {
136136
}
137137

138138
// InitBaseStore Initializes the store base
139-
func (b *BaseStore) InitBaseStore(ipfs coreapi.CoreAPI, identity *identityprovider.Identity, addr address.Address, options *iface.NewStoreOptions) error {
139+
func (b *BaseStore) InitBaseStore(ipfs coreiface.CoreAPI, identity *identityprovider.Identity, addr address.Address, options *iface.NewStoreOptions) error {
140140
var err error
141141

142142
b.ctx, b.cancel = context.WithCancel(context.Background())
@@ -719,7 +719,12 @@ func (b *BaseStore) LoadFromSnapshot(ctx context.Context) error {
719719

720720
b.Logger().Debug("loading snapshot from path", zap.String("snapshot", string(snapshot)))
721721

722-
resNode, err := b.IPFS().Unixfs().Get(ctx, path.New(string(snapshot)))
722+
path, err := path.NewPath(string(snapshot))
723+
if err != nil {
724+
return fmt.Errorf("unable to convert string to path: %w", err)
725+
}
726+
727+
resNode, err := b.IPFS().Unixfs().Get(ctx, path)
723728
if err != nil {
724729
return fmt.Errorf("unable to get snapshot from ipfs: %w", err)
725730
}

‎stores/basestore/utils.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func SaveSnapshot(ctx context.Context, b iface.Store) (cid.Cid, error) {
7373
return cid.Cid{}, fmt.Errorf("unable to save log data on store: %w", err)
7474
}
7575

76-
err = b.Cache().Put(ctx, datastore.NewKey("snapshot"), []byte(snapshotPath.Cid().String()))
76+
err = b.Cache().Put(ctx, datastore.NewKey("snapshot"), []byte(snapshotPath.String()))
7777
if err != nil {
7878
return cid.Cid{}, fmt.Errorf("unable to add snapshot data to cache: %w", err)
7979
}
@@ -88,5 +88,5 @@ func SaveSnapshot(ctx context.Context, b iface.Store) (cid.Cid, error) {
8888
return cid.Cid{}, fmt.Errorf("unable to add unfinished data to cache: %w", err)
8989
}
9090

91-
return snapshotPath.Cid(), nil
91+
return snapshotPath.RootCid(), nil
9292
}

‎stores/documentstore/document.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"berty.tech/go-orbit-db/stores/basestore"
1313
"berty.tech/go-orbit-db/stores/operation"
1414

15-
coreapi "github.com/ipfs/interface-go-ipfs-core"
15+
coreiface "github.com/ipfs/kubo/core/coreiface"
1616
)
1717

1818
type orbitDBDocumentStore struct {
@@ -242,7 +242,7 @@ func DefaultStoreOptsForMap(keyField string) *iface.CreateDocumentDBOptions {
242242
}
243243

244244
// NewOrbitDBDocumentStore Instantiates a new DocumentStore
245-
func NewOrbitDBDocumentStore(ipfs coreapi.CoreAPI, identity *identityprovider.Identity, addr address.Address, options *iface.NewStoreOptions) (iface.Store, error) {
245+
func NewOrbitDBDocumentStore(ipfs coreiface.CoreAPI, identity *identityprovider.Identity, addr address.Address, options *iface.NewStoreOptions) (iface.Store, error) {
246246
if options.StoreSpecificOpts == nil {
247247
options.StoreSpecificOpts = DefaultStoreOptsForMap("_id")
248248
}

‎stores/eventlogstore/log.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"berty.tech/go-orbit-db/stores/basestore"
1212
"berty.tech/go-orbit-db/stores/operation"
1313
cid "github.com/ipfs/go-cid"
14-
coreapi "github.com/ipfs/interface-go-ipfs-core"
14+
coreiface "github.com/ipfs/kubo/core/coreiface"
1515
)
1616

1717
type orbitDBEventLogStore struct {
@@ -201,7 +201,7 @@ func (o *orbitDBEventLogStore) Type() string {
201201
}
202202

203203
// NewOrbitDBEventLogStore Instantiates a new EventLogStore
204-
func NewOrbitDBEventLogStore(ipfs coreapi.CoreAPI, identity *identityprovider.Identity, addr address.Address, options *iface.NewStoreOptions) (i iface.Store, e error) {
204+
func NewOrbitDBEventLogStore(ipfs coreiface.CoreAPI, identity *identityprovider.Identity, addr address.Address, options *iface.NewStoreOptions) (i iface.Store, e error) {
205205

206206
store := &orbitDBEventLogStore{}
207207
options.Index = NewEventIndex

‎stores/kvstore/keyvalue.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"fmt"
66

77
"berty.tech/go-ipfs-log/identityprovider"
8-
coreapi "github.com/ipfs/interface-go-ipfs-core"
8+
coreiface "github.com/ipfs/kubo/core/coreiface"
99

1010
"berty.tech/go-orbit-db/address"
1111
"berty.tech/go-orbit-db/iface"
@@ -85,7 +85,7 @@ func (o *orbitDBKeyValue) Type() string {
8585
}
8686

8787
// NewOrbitDBKeyValue Instantiates a new KeyValueStore
88-
func NewOrbitDBKeyValue(ipfs coreapi.CoreAPI, identity *identityprovider.Identity, addr address.Address, options *iface.NewStoreOptions) (i iface.Store, e error) {
88+
func NewOrbitDBKeyValue(ipfs coreiface.CoreAPI, identity *identityprovider.Identity, addr address.Address, options *iface.NewStoreOptions) (i iface.Store, e error) {
8989
store := &orbitDBKeyValue{}
9090

9191
options.Index = NewKVIndex

‎stores/replicator/interface.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ import (
77
"berty.tech/go-ipfs-log/identityprovider"
88
"berty.tech/go-orbit-db/accesscontroller"
99
cid "github.com/ipfs/go-cid"
10-
coreapi "github.com/ipfs/interface-go-ipfs-core"
10+
coreiface "github.com/ipfs/kubo/core/coreiface"
1111
"github.com/libp2p/go-libp2p/core/event"
1212
)
1313

1414
// storeInterface An interface used to avoid import cycles
1515
type storeInterface interface {
1616
OpLog() ipfslog.Log
17-
IPFS() coreapi.CoreAPI
17+
IPFS() coreiface.CoreAPI
1818
Identity() *identityprovider.Identity
1919
AccessController() accesscontroller.Interface
2020
SortFn() ipfslog.SortFn

‎tests/testing_test.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ import (
1313

1414
ds "github.com/ipfs/go-datastore"
1515
dsync "github.com/ipfs/go-datastore/sync"
16-
iface "github.com/ipfs/interface-go-ipfs-core"
1716
cfg "github.com/ipfs/kubo/config"
1817
ipfsCore "github.com/ipfs/kubo/core"
1918
"github.com/ipfs/kubo/core/coreapi"
19+
coreiface "github.com/ipfs/kubo/core/coreiface"
2020
mock "github.com/ipfs/kubo/core/mock"
2121
"github.com/ipfs/kubo/repo"
2222
mocknet "github.com/libp2p/go-libp2p/p2p/net/mock"
@@ -39,7 +39,7 @@ func testingRepo(ctx context.Context, t *testing.T) repo.Repo {
3939
c.Pubsub.Enabled = cfg.True
4040
c.Bootstrap = []string{}
4141
c.Addresses.Swarm = []string{"/ip4/127.0.0.1/tcp/4001", "/ip4/127.0.0.1/udp/4001/quic"}
42-
c.Identity.PeerID = pid.Pretty()
42+
c.Identity.PeerID = pid.String()
4343
c.Identity.PrivKey = base64.StdEncoding.EncodeToString(privkeyb)
4444
c.Swarm.ResourceMgr.Enabled = cfg.False // we don't need ressources manager for test
4545

@@ -49,13 +49,13 @@ func testingRepo(ctx context.Context, t *testing.T) repo.Repo {
4949
}
5050
}
5151

52-
func testingIPFSAPIs(ctx context.Context, t *testing.T, count int) ([]iface.CoreAPI, func()) {
52+
func testingIPFSAPIs(ctx context.Context, t *testing.T, count int) ([]coreiface.CoreAPI, func()) {
5353
t.Helper()
5454

5555
mn := testingMockNet(t)
5656
defer mn.Close()
5757

58-
coreAPIs := make([]iface.CoreAPI, count)
58+
coreAPIs := make([]coreiface.CoreAPI, count)
5959
cleans := make([]func(), count)
6060

6161
for i := 0; i < count; i++ {
@@ -72,10 +72,10 @@ func testingIPFSAPIs(ctx context.Context, t *testing.T, count int) ([]iface.Core
7272
}
7373
}
7474

75-
func testingIPFSAPIsNonMocked(ctx context.Context, t *testing.T, count int) ([]iface.CoreAPI, func()) {
75+
func testingIPFSAPIsNonMocked(ctx context.Context, t *testing.T, count int) ([]coreiface.CoreAPI, func()) {
7676
t.Helper()
7777

78-
coreAPIs := make([]iface.CoreAPI, count)
78+
coreAPIs := make([]coreiface.CoreAPI, count)
7979
cleans := make([]func(), count)
8080

8181
for i := 0; i < count; i++ {
@@ -151,7 +151,7 @@ func testingNonMockedIPFSNode(ctx context.Context, t *testing.T) (*ipfsCore.Ipfs
151151
return core, cleanup
152152
}
153153

154-
func testingCoreAPI(t *testing.T, core *ipfsCore.IpfsNode) iface.CoreAPI {
154+
func testingCoreAPI(t *testing.T, core *ipfsCore.IpfsNode) coreiface.CoreAPI {
155155
t.Helper()
156156

157157
api, err := coreapi.NewCoreAPI(core)

‎utils/create_db_manifest.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"berty.tech/go-ipfs-log/io"
99
cid "github.com/ipfs/go-cid"
1010
cbornode "github.com/ipfs/go-ipld-cbor"
11-
coreapi "github.com/ipfs/interface-go-ipfs-core"
11+
coreiface "github.com/ipfs/kubo/core/coreiface"
1212
"github.com/polydawn/refmt/obj/atlas"
1313
)
1414

@@ -20,7 +20,7 @@ type Manifest struct {
2020
}
2121

2222
// CreateDBManifest creates a new database manifest and saves it on IPFS
23-
func CreateDBManifest(ctx context.Context, ipfs coreapi.CoreAPI, name string, dbType string, accessControllerAddress string) (cid.Cid, error) {
23+
func CreateDBManifest(ctx context.Context, ipfs coreiface.CoreAPI, name string, dbType string, accessControllerAddress string) (cid.Cid, error) {
2424
manifest := &Manifest{
2525
Name: name,
2626
Type: dbType,

0 commit comments

Comments
 (0)
Please sign in to comment.