@@ -26,11 +26,12 @@ import (
26
26
datastore "github.com/ipfs/go-datastore"
27
27
leveldb "github.com/ipfs/go-ds-leveldb"
28
28
cbornode "github.com/ipfs/go-ipld-cbor"
29
- coreapi "github.com/ipfs/interface-go-ipfs- core"
29
+ coreiface "github.com/ipfs/kubo/ core/coreiface "
30
30
"github.com/libp2p/go-libp2p/core/event"
31
31
peer "github.com/libp2p/go-libp2p/core/peer"
32
32
"github.com/libp2p/go-libp2p/p2p/host/eventbus"
33
33
"go.opentelemetry.io/otel/trace"
34
+ tracenoop "go.opentelemetry.io/otel/trace/noop"
34
35
"go.uber.org/zap"
35
36
)
36
37
@@ -98,7 +99,7 @@ type orbitDB struct {
98
99
cancel context.CancelFunc
99
100
storeTypes map [string ]iface.StoreConstructor
100
101
accessControllerTypes map [string ]iface.AccessControllerConstructor
101
- ipfs coreapi .CoreAPI
102
+ ipfs coreiface .CoreAPI
102
103
identity * idp.Identity
103
104
id peer.ID
104
105
pubsub iface.PubSubInterface
@@ -136,7 +137,7 @@ func (o *orbitDB) Tracer() trace.Tracer {
136
137
return o .tracer
137
138
}
138
139
139
- func (o * orbitDB ) IPFS () coreapi .CoreAPI {
140
+ func (o * orbitDB ) IPFS () coreiface .CoreAPI {
140
141
o .muIPFS .RLock ()
141
142
defer o .muIPFS .RUnlock ()
142
143
@@ -316,7 +317,7 @@ func (o *orbitDB) getStoreConstructor(s string) (iface.StoreConstructor, bool) {
316
317
return constructor , ok
317
318
}
318
319
319
- func newOrbitDB (ctx context.Context , is coreapi .CoreAPI , identity * idp.Identity , options * NewOrbitDBOptions ) (BaseOrbitDB , error ) {
320
+ func newOrbitDB (ctx context.Context , is coreiface .CoreAPI , identity * idp.Identity , options * NewOrbitDBOptions ) (BaseOrbitDB , error ) {
320
321
if is == nil {
321
322
return nil , fmt .Errorf ("ipfs is a required argument" )
322
323
}
@@ -334,7 +335,7 @@ func newOrbitDB(ctx context.Context, is coreapi.CoreAPI, identity *idp.Identity,
334
335
}
335
336
336
337
if options .Tracer == nil {
337
- options .Tracer = trace . NewNoopTracerProvider ().Tracer ("" )
338
+ options .Tracer = tracenoop . NewTracerProvider ().Tracer ("" )
338
339
}
339
340
340
341
if options .EventBus == nil {
@@ -408,7 +409,7 @@ func newOrbitDB(ctx context.Context, is coreapi.CoreAPI, identity *idp.Identity,
408
409
}
409
410
410
411
// NewOrbitDB Creates a new OrbitDB instance
411
- func NewOrbitDB (ctx context.Context , ipfs coreapi .CoreAPI , options * NewOrbitDBOptions ) (BaseOrbitDB , error ) {
412
+ func NewOrbitDB (ctx context.Context , ipfs coreiface .CoreAPI , options * NewOrbitDBOptions ) (BaseOrbitDB , error ) {
412
413
if ipfs == nil {
413
414
return nil , fmt .Errorf ("ipfs is a required argument" )
414
415
}
@@ -571,10 +572,10 @@ func (o *orbitDB) Open(ctx context.Context, dbAddress string, options *CreateDBO
571
572
return nil , fmt .Errorf ("'options.Create' set to 'false'. If you want to create a database, set 'options.Create' to 'true'" )
572
573
} else if * options .Create && (options .StoreType == nil || * options .StoreType == "" ) {
573
574
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 )
577
575
}
576
+
577
+ options .Overwrite = boolPtr (true )
578
+ return o .Create (ctx , dbAddress , * options .StoreType , options )
578
579
}
579
580
580
581
parsedDBAddress , err := address .Parse (dbAddress )
0 commit comments