BYOK Personal Data Server (PDS) written in Go
ipfs vow atproto pds go
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactor: remove ipfs offline mode

+3 -7
+3 -7
blockstore/ipfs.go
··· 12 12 blocks "github.com/ipfs/go-block-format" 13 13 "github.com/ipfs/go-cid" 14 14 "github.com/ipfs/kubo/client/rpc" 15 - "github.com/ipfs/kubo/core/coreiface" 16 15 caopts "github.com/ipfs/kubo/core/coreiface/options" 17 16 "github.com/multiformats/go-multicodec" 18 17 ) ··· 22 21 did string 23 22 rev string 24 23 cli *rpc.HttpApi 25 - offlineCli iface.CoreAPI 26 24 27 25 mu sync.RWMutex 28 26 inserts map[cid.Cid]blocks.Block ··· 30 28 31 29 // NewIPFS creates a blockstore. 32 30 func NewIPFS(did string, cli *rpc.HttpApi) *IPFSBlockstore { 33 - offlineCli, _ := cli.WithOptions(caopts.Api.Offline(true)) 34 31 return &IPFSBlockstore{ 35 32 did: did, 36 33 cli: cli, 37 - offlineCli: offlineCli, 38 34 inserts: make(map[cid.Cid]blocks.Block), 39 35 } 40 36 } ··· 54 50 bs.mu.RUnlock() 55 51 56 52 p := path.FromCid(c) 57 - r, err := bs.offlineCli.Block().Get(ctx, p) 53 + r, err := bs.cli.Block().Get(ctx, p) 58 54 if err != nil { 59 55 return nil, fmt.Errorf("ipfs block/get: %w", err) 60 56 } ··· 132 128 bs.mu.RUnlock() 133 129 134 130 p := path.FromCid(c) 135 - _, err := bs.offlineCli.Block().Stat(ctx, p) 131 + _, err := bs.cli.Block().Stat(ctx, p) 136 132 if err != nil { 137 133 // Not found error means block doesn't exist 138 134 return false, nil ··· 183 179 // Verify checks that a block exists in IPFS, bypassing the local cache. 184 180 func (bs *IPFSBlockstore) Verify(ctx context.Context, c cid.Cid) error { 185 181 p := path.FromCid(c) 186 - _, err := bs.offlineCli.Block().Stat(ctx, p) 182 + _, err := bs.cli.Block().Stat(ctx, p) 187 183 if err != nil { 188 184 return fmt.Errorf("ipfs block/stat %s: %w", c, err) 189 185 }