chore(blockstore): switch ipfs blockstore from go-ipfs-http-api to kubo/client/rpc

This commit is contained in:
Adin Schmahmann 2023-06-02 12:45:59 -04:00 committed by hannahhoward
parent 6c01310728
commit 73f09878e1
No known key found for this signature in database
GPG Key ID: 3C7C0388A749297C
3 changed files with 4 additions and 7 deletions

View File

@ -10,7 +10,7 @@ import (
"github.com/ipfs/boxo/coreiface/path"
blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
httpapi "github.com/ipfs/go-ipfs-http-client"
"github.com/ipfs/kubo/client/rpc"
"github.com/multiformats/go-multiaddr"
"github.com/multiformats/go-multihash"
"golang.org/x/xerrors"
@ -24,7 +24,7 @@ type IPFSBlockstore struct {
var _ BasicBlockstore = (*IPFSBlockstore)(nil)
func NewLocalIPFSBlockstore(ctx context.Context, onlineMode bool) (Blockstore, error) {
localApi, err := httpapi.NewLocalApi()
localApi, err := rpc.NewLocalApi()
if err != nil {
return nil, xerrors.Errorf("getting local ipfs api: %w", err)
}
@ -51,7 +51,7 @@ func NewLocalIPFSBlockstore(ctx context.Context, onlineMode bool) (Blockstore, e
}
func NewRemoteIPFSBlockstore(ctx context.Context, maddr multiaddr.Multiaddr, onlineMode bool) (Blockstore, error) {
httpApi, err := httpapi.NewApi(maddr)
httpApi, err := rpc.NewApi(maddr)
if err != nil {
return nil, xerrors.Errorf("setting remote ipfs api: %w", err)
}

3
go.mod
View File

@ -90,13 +90,13 @@ require (
github.com/ipfs/go-fs-lock v0.0.7
github.com/ipfs/go-graphsync v0.14.6
github.com/ipfs/go-ipfs-blocksutil v0.0.1
github.com/ipfs/go-ipfs-http-client v0.6.1-0.20230531132410-118998577f11
github.com/ipfs/go-ipld-cbor v0.0.6
github.com/ipfs/go-ipld-format v0.4.1-0.20230606153953-b3d3a1ea2b2a
github.com/ipfs/go-log/v2 v2.5.1
github.com/ipfs/go-metrics-interface v0.0.1
github.com/ipfs/go-metrics-prometheus v0.0.2
github.com/ipfs/go-unixfsnode v1.6.0
github.com/ipfs/kubo v0.20.1-0.20230602143531-422d0e4f640c
github.com/ipld/go-car v0.5.0
github.com/ipld/go-car/v2 v2.10.0
github.com/ipld/go-codec-dagpb v1.6.0
@ -240,7 +240,6 @@ require (
github.com/ipfs/go-merkledag v0.10.1-0.20230601163447-eceea556e7d4 // indirect
github.com/ipfs/go-peertaskqueue v0.8.1 // indirect
github.com/ipfs/go-verifcid v0.0.2 // indirect
github.com/ipfs/kubo v0.20.1-0.20230602143531-422d0e4f640c // indirect
github.com/ipld/go-ipld-adl-hamt v0.0.0-20220616142416-9004dbd839e0 // indirect
github.com/ipsn/go-secp256k1 v0.0.0-20180726113642-9d62b9f0bc52 // indirect
github.com/jackpal/go-nat-pmp v1.0.2 // indirect

2
go.sum
View File

@ -759,8 +759,6 @@ github.com/ipfs/go-ipfs-exchange-offline v0.3.0 h1:c/Dg8GDPzixGd0MC8Jh6mjOwU57uY
github.com/ipfs/go-ipfs-files v0.0.3/go.mod h1:INEFm0LL2LWXBhNJ2PMIIb2w45hpXgPjNoE7yA8Y1d4=
github.com/ipfs/go-ipfs-files v0.0.4/go.mod h1:INEFm0LL2LWXBhNJ2PMIIb2w45hpXgPjNoE7yA8Y1d4=
github.com/ipfs/go-ipfs-files v0.3.0 h1:fallckyc5PYjuMEitPNrjRfpwl7YFt69heCOUhsbGxQ=
github.com/ipfs/go-ipfs-http-client v0.6.1-0.20230531132410-118998577f11 h1:waG2kbCO3k9hOzytUPK3AfwpXI+taA2aIEY3Or1zAsE=
github.com/ipfs/go-ipfs-http-client v0.6.1-0.20230531132410-118998577f11/go.mod h1:i6pjdV2EspPHohiaqTsCmmbYzspQSosE/tbHYrQMkw0=
github.com/ipfs/go-ipfs-posinfo v0.0.1 h1:Esoxj+1JgSjX0+ylc0hUmJCOv6V2vFoZiETLR6OtpRs=
github.com/ipfs/go-ipfs-posinfo v0.0.1/go.mod h1:SwyeVP+jCwiDu0C313l/8jg6ZxM0qqtlt2a0vILTc1A=
github.com/ipfs/go-ipfs-pq v0.0.1/go.mod h1:LWIqQpqfRG3fNc5XsnIhz/wQ2XXGyugQwls7BgUmUfY=