Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Use new metadata api with multi-protocol support #196

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cardatatransfer/cardatatransfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ func StartCarDataTransfer(dt datatransfer.Manager, supplier BlockStoreSupplier)
return nil
}

func MetadataFromContextID(contextID []byte) (stiapi.Metadata, error) {
func MetadataFromContextID(contextID []byte) (stiapi.ParsedMetadata, error) {
pieceCid, err := cid.Prefix{
Version: 1,
Codec: uint64(multicodec.TransportGraphsyncFilecoinv1),
MhType: multihash.IDENTITY,
MhLength: -1,
}.Sum(contextID)
if err != nil {
return stiapi.Metadata{}, err
return stiapi.ParsedMetadata{}, err
}
filecoinV1Metadata := &metadata.GraphsyncFilecoinV1Metadata{
PieceCID: pieceCid,
Expand Down
6 changes: 3 additions & 3 deletions cmd/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ go 1.16

require (
github.com/filecoin-project/go-data-transfer v1.14.0
github.com/filecoin-project/go-legs v0.3.8
github.com/filecoin-project/go-legs v0.3.9
github.com/filecoin-project/index-provider v0.2.1
github.com/filecoin-project/storetheindex v0.3.5
github.com/filecoin-project/storetheindex v0.3.7-0.20220309174359-164d0cba7ea6
github.com/ipfs/go-cid v0.1.0
github.com/ipfs/go-datastore v0.5.1
github.com/ipfs/go-ds-leveldb v0.5.0
github.com/ipfs/go-graphsync v0.12.0
github.com/ipfs/go-ipfs v0.11.0
github.com/ipfs/go-log/v2 v2.5.0
github.com/ipld/go-car/v2 v2.1.1
github.com/ipld/go-ipld-prime v0.14.4
github.com/ipld/go-ipld-prime v0.16.0
github.com/libp2p/go-libp2p v0.18.0-rc3
github.com/libp2p/go-libp2p-core v0.14.0
github.com/mitchellh/go-homedir v1.1.0
Expand Down
22 changes: 12 additions & 10 deletions cmd/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -212,19 +212,19 @@ github.com/filecoin-project/go-data-transfer v1.14.0/go.mod h1:wNJKhaLLYBJDM3VFv
github.com/filecoin-project/go-ds-versioning v0.0.0-20211206185234-508abd7c2aff/go.mod h1:C9/l9PnB1+mwPa26BBVpCjG/XQCB0yj/q5CK2J8X1I4=
github.com/filecoin-project/go-ds-versioning v0.1.1 h1:JiyBqaQlwC+UM0WhcBtVEeT3XrX59mQhT8U3p7nu86o=
github.com/filecoin-project/go-ds-versioning v0.1.1/go.mod h1:C9/l9PnB1+mwPa26BBVpCjG/XQCB0yj/q5CK2J8X1I4=
github.com/filecoin-project/go-indexer-core v0.2.8/go.mod h1:IagNfTdFuX4057kla43PjRCn3yBuUiZgIxuA0hTUamY=
github.com/filecoin-project/go-legs v0.3.7/go.mod h1:pgekGm8/gKY5zCtQ/qGAoSjGP92wTLFqpO3GPHeu8YU=
github.com/filecoin-project/go-legs v0.3.8 h1:HDhunjC+E5g3s47zUQY/YnDveatOXWJyfK519jdKhOA=
github.com/filecoin-project/go-indexer-core v0.2.9/go.mod h1:u03I3HB6ZnqCc3cm8Tq+QkTWBbfKOvNxM8K6Ny/IHRw=
github.com/filecoin-project/go-legs v0.3.8/go.mod h1:FroH5LQUTfYzs8huA4PjW8spDF691uvK8uk9YAfDa78=
github.com/filecoin-project/go-legs v0.3.9 h1:YDW+nHn3fdl/5M7dE0EOxU8E3EgJGjuccLcz9xaT3kg=
github.com/filecoin-project/go-legs v0.3.9/go.mod h1:FroH5LQUTfYzs8huA4PjW8spDF691uvK8uk9YAfDa78=
github.com/filecoin-project/go-state-types v0.1.0 h1:9r2HCSMMCmyMfGyMKxQtv0GKp6VT/m5GgVk8EhYbLJU=
github.com/filecoin-project/go-state-types v0.1.0/go.mod h1:ezYnPf0bNkTsDibL/psSz5dy4B5awOJ/E7P2Saeep8g=
github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe h1:dF8u+LEWeIcTcfUcCf3WFVlc81Fr2JKg8zPzIbBDKDw=
github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe/go.mod h1:FGwQgZAt2Gh5mjlwJUlVB62JeYdo+if0xWxSEfBD9ig=
github.com/filecoin-project/go-statestore v0.1.0/go.mod h1:LFc9hD+fRxPqiHiaqUEZOinUJB4WARkRfNl10O7kTnI=
github.com/filecoin-project/go-statestore v0.2.0 h1:cRRO0aPLrxKQCZ2UOQbzFGn4WDNdofHZoGPjfNaAo5Q=
github.com/filecoin-project/go-statestore v0.2.0/go.mod h1:8sjBYbS35HwPzct7iT4lIXjLlYyPor80aU7t7a/Kspo=
github.com/filecoin-project/storetheindex v0.3.5 h1:KoS9TvjPm6zIZfUH8atAHJbVHOO7GTP1MdTG+v0eE+Q=
github.com/filecoin-project/storetheindex v0.3.5/go.mod h1:0r3d0kSpK63O6AvLr1CjAINLi+nWD49clzcnKV+GLpI=
github.com/filecoin-project/storetheindex v0.3.7-0.20220309174359-164d0cba7ea6 h1:Pg3e+uEgTNPHxhWTl+ouhcnkRpUkgL1UJpo5ekuVwF4=
github.com/filecoin-project/storetheindex v0.3.7-0.20220309174359-164d0cba7ea6/go.mod h1:5QoLWR+55xZXuJA7Y4eJQTbryEo5p6gvIPUqtXK5eaY=
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
github.com/flynn/noise v0.0.0-20180327030543-2492fe189ae6/go.mod h1:1i71OnUq3iUe1ma7Lr6yG6/rjvM3emb6yoL7xLFzcVQ=
github.com/flynn/noise v1.0.0 h1:DlTHqmzmvcEiKj+4RYo/imoswx/4r6iBlCMfVtrMXpQ=
Expand All @@ -234,8 +234,9 @@ github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiD
github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4=
github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20=
github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k=
github.com/frankban/quicktest v1.14.0 h1:+cqqvzZV87b4adx/5ayVOaYZ2CrvM4ejQvUdBzPPUss=
github.com/frankban/quicktest v1.14.0/go.mod h1:NeW+ay9A/U67EYXNFA1nPE8e/tnQv/09mUdL/ijj8og=
github.com/frankban/quicktest v1.14.2 h1:SPb1KFFmM+ybpEjPUhCCkZOM5xlovT5UbrMvWnXyBns=
github.com/frankban/quicktest v1.14.2/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI=
Expand Down Expand Up @@ -330,8 +331,9 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o=
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
Expand Down Expand Up @@ -630,12 +632,13 @@ github.com/ipld/go-ipld-prime v0.12.3/go.mod h1:PaeLYq8k6dJLmDUSLrzkEpoGV4PEfe/1
github.com/ipld/go-ipld-prime v0.14.0/go.mod h1:9ASQLwUFLptCov6lIYc70GRB4V7UTyLD0IJtrDJe6ZM=
github.com/ipld/go-ipld-prime v0.14.1/go.mod h1:QcE4Y9n/ZZr8Ijg5bGPT0GqYWgZ1704nH0RDcQtgTP0=
github.com/ipld/go-ipld-prime v0.14.2/go.mod h1:QcE4Y9n/ZZr8Ijg5bGPT0GqYWgZ1704nH0RDcQtgTP0=
github.com/ipld/go-ipld-prime v0.14.4 h1:bqhmume8+nbNsX4/+J6eohktfZHAI8GKrF3rQ0xgOyc=
github.com/ipld/go-ipld-prime v0.14.4/go.mod h1:QcE4Y9n/ZZr8Ijg5bGPT0GqYWgZ1704nH0RDcQtgTP0=
github.com/ipld/go-ipld-prime v0.16.0 h1:RS5hhjB/mcpeEPJvfyj0qbOj/QL+/j05heZ0qa97dVo=
github.com/ipld/go-ipld-prime v0.16.0/go.mod h1:axSCuOCBPqrH+gvXr2w9uAOulJqBPhHPT2PjoiiU1qA=
github.com/ipld/go-ipld-prime-proto v0.0.0-20191113031812-e32bd156a1e5/go.mod h1:gcvzoEDBjwycpXt3LBE061wT9f46szXGHAmj9uoP6fU=
github.com/ipld/go-ipld-prime/storage/bsadapter v0.0.0-20211210234204-ce2a1c70cd73 h1:TsyATB2ZRRQGTwafJdgEUQkmjOExRV0DNokcihZxbnQ=
github.com/ipld/go-ipld-prime/storage/bsadapter v0.0.0-20211210234204-ce2a1c70cd73/go.mod h1:2PJ0JgxyB08t0b2WKrcuqI3di0V+5n6RS/LTUJhkoxY=
github.com/ipld/go-storethehash v0.0.1/go.mod h1:w8cQfWInks8lvvbQTiKbCPusU9v0sqiViBihTHbavpQ=
github.com/ipld/go-storethehash v0.0.2/go.mod h1:w8cQfWInks8lvvbQTiKbCPusU9v0sqiViBihTHbavpQ=
github.com/ipsn/go-secp256k1 v0.0.0-20180726113642-9d62b9f0bc52 h1:QG4CGBqCeuBo6aZlGAamSkxWdgWfZGeE49eUOWJPA4c=
github.com/ipsn/go-secp256k1 v0.0.0-20180726113642-9d62b9f0bc52/go.mod h1:fdg+/X9Gg4AsAIzWpEHwnqd+QY3b7lajxyjE1m4hkq4=
github.com/jackpal/gateway v1.0.5/go.mod h1:lTpwd4ACLXmpyiCTRtfiNyVnUmqT9RivzCDQetPfnjA=
Expand Down Expand Up @@ -1462,7 +1465,6 @@ github.com/whyrusleeping/cbor-gen v0.0.0-20200810223238-211df3b9e24c/go.mod h1:f
github.com/whyrusleeping/cbor-gen v0.0.0-20200812213548-958ddffe352c/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ=
github.com/whyrusleeping/cbor-gen v0.0.0-20200826160007-0b9f6c5fb163/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ=
github.com/whyrusleeping/cbor-gen v0.0.0-20210219115102-f37d292932f2/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ=
github.com/whyrusleeping/cbor-gen v0.0.0-20220224212727-7a699437a831/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ=
github.com/whyrusleeping/cbor-gen v0.0.0-20220302191723-37c43cae8e14 h1:vo2wkP2ceHyGyZwFFtAabpot03EeSxxwAe57pOI9E/4=
github.com/whyrusleeping/cbor-gen v0.0.0-20220302191723-37c43cae8e14/go.mod h1:fgkXqYy7bV2cFeIEOkVTZS/WjXARfBqSH6Q2qHL33hQ=
github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f h1:jQa4QT2UP9WYv2nzyawpKMOCl+Z/jW7djv2/J50lj9E=
Expand Down
44 changes: 36 additions & 8 deletions cmd/provider/find.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ import (
"encoding/base64"
"fmt"

httpfinderclient "github.com/filecoin-project/storetheindex/api/v0/finder/client/http"
"github.com/filecoin-project/storetheindex/api/v0/finder/client"
httpclient "github.com/filecoin-project/storetheindex/api/v0/finder/client/http"
p2pclient "github.com/filecoin-project/storetheindex/api/v0/finder/client/libp2p"
"github.com/ipfs/go-cid"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/multiformats/go-multihash"
"github.com/urfave/cli/v2"
)
Expand All @@ -18,10 +21,7 @@ var FindCmd = &cli.Command{
}

func findCommand(cctx *cli.Context) error {
cli, err := httpfinderclient.New(cctx.String("indexer"))
if err != nil {
return err
}
protocol := cctx.String("protocol")

mhArgs := cctx.StringSlice("mh")
cidArgs := cctx.StringSlice("cid")
Expand All @@ -41,7 +41,36 @@ func findCommand(cctx *cli.Context) error {
mhs = append(mhs, c.Hash())
}

resp, err := cli.FindBatch(cctx.Context, mhs)
var cl client.Finder
var err error

switch protocol {
case "http":
cl, err = httpclient.New(cctx.String("indexer"))
if err != nil {
return err
}
case "libp2p":
peerID, err := peer.Decode(cctx.String("peerid"))
if err != nil {
return err
}

c, err := p2pclient.New(nil, peerID)
if err != nil {
return err
}

err = c.Connect(cctx.Context, cctx.String("indexer"))
if err != nil {
return err
}
cl = c
default:
return fmt.Errorf("unrecognized protocol type for client interaction: %s", protocol)
}

resp, err := cl.FindBatch(cctx.Context, mhs)
if err != nil {
return err
}
Expand All @@ -57,8 +86,7 @@ func findCommand(cctx *cli.Context) error {
for _, pr := range resp.MultihashResults[i].ProviderResults {
fmt.Println(" Provider:", pr.Provider)
fmt.Println(" ContextID:", base64.StdEncoding.EncodeToString(pr.ContextID))
fmt.Println(" Proto:", pr.Metadata.ProtocolID)
fmt.Println(" Metadata:", base64.StdEncoding.EncodeToString(pr.Metadata.Data))
fmt.Println(" Metadata:", base64.StdEncoding.EncodeToString(*pr.Metadata))
}
}

Expand Down
13 changes: 13 additions & 0 deletions cmd/provider/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ var indexerFlag = &cli.StringFlag{
Required: true,
}

var indexerIDFlag = &cli.StringFlag{
Name: "peerid",
Usage: "Peer ID of indexer to use, when using libp2p",
Required: false,
}

var addrFlag = &cli.StringSliceFlag{
Name: "addr",
Usage: `Provider address as multiaddr string, example: "/ip4/127.0.0.1/tcp/3103"`,
Expand All @@ -43,6 +49,7 @@ var addrFlag = &cli.StringSliceFlag{

var findFlags = []cli.Flag{
indexerFlag,
indexerIDFlag,
&cli.StringSliceFlag{
Name: "mh",
Usage: "Specify multihash to use as indexer key, multiple OK",
Expand All @@ -53,6 +60,12 @@ var findFlags = []cli.Flag{
Usage: "Specify CID to use as indexer key, multiple OK",
Required: false,
},
&cli.StringFlag{
Name: "protocol",
Usage: "Protocol to query the indexer (http, libp2p currently supported)",
Value: "http",
Required: false,
},
}

var indexFlags = []cli.Flag{
Expand Down
18 changes: 12 additions & 6 deletions cmd/provider/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"github.com/filecoin-project/index-provider/cardatatransfer"
adminserver "github.com/filecoin-project/index-provider/server/admin/http"
stiapi "github.com/filecoin-project/storetheindex/api/v0"
"github.com/multiformats/go-multicodec"
"github.com/urfave/cli/v2"
)

Expand All @@ -32,9 +31,8 @@ var (
Before: beforeImportCar,
Action: doImportCar,
}
metadata = stiapi.Metadata{
ProtocolID: multicodec.TransportGraphsyncFilecoinv1,
}

metadata stiapi.ParsedMetadata
)

func beforeImportCar(cctx *cli.Context) error {
Expand All @@ -54,7 +52,10 @@ func beforeImportCar(cctx *cli.Context) error {
if err != nil {
return errors.New("metadata is not a valid base64 encoded string")
}
metadata.Data = decoded
err = metadata.UnmarshalBinary(decoded)
if err != nil {
return err
}
} else {
// If no metadata is set, generate metadata that is compatible for FileCoin retrieval base
// on the context ID
Expand All @@ -68,10 +69,15 @@ func beforeImportCar(cctx *cli.Context) error {
}

func doImportCar(cctx *cli.Context) error {
rawMetadata, err := metadata.MarshalBinary()
if err != nil {
return err
}

req := adminserver.ImportCarReq{
Path: carPathFlagValue,
Key: importCarKey,
Metadata: metadata,
Metadata: rawMetadata,
}
resp, err := doHttpPostReq(cctx.Context, adminAPIFlagValue+"/admin/import/car", req)
if err != nil {
Expand Down
11 changes: 6 additions & 5 deletions cmd/provider/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"fmt"

"github.com/filecoin-project/index-provider/cmd/provider/internal/config"
md "github.com/filecoin-project/index-provider/metadata"
stiapi "github.com/filecoin-project/storetheindex/api/v0"
httpc "github.com/filecoin-project/storetheindex/api/v0/ingest/client/http"
"github.com/ipfs/go-cid"
"github.com/multiformats/go-multicodec"
"github.com/multiformats/go-multihash"
"github.com/urfave/cli/v2"
)
Expand Down Expand Up @@ -61,12 +61,13 @@ func indexCommand(cctx *cli.Context) error {
return err
}

metadata := stiapi.Metadata{
ProtocolID: multicodec.Code(cctx.Int("proto")),
Data: []byte(cctx.String("meta")),
metadata := stiapi.ParsedMetadata{Protocols: []stiapi.ProtocolMetadata{&md.GraphsyncFilecoinV1Metadata{}}}
rawMetadata, err := metadata.MarshalBinary()
if err != nil {
return err
}

err = client.IndexContent(cctx.Context, peerID, privKey, mh, []byte(cctx.String("ctxid")), metadata, cctx.StringSlice("addr"))
err = client.IndexContent(cctx.Context, peerID, privKey, mh, []byte(cctx.String("ctxid")), rawMetadata, cctx.StringSlice("addr"))
if err != nil {
return err
}
Expand Down
10 changes: 6 additions & 4 deletions e2e_retrieve_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,12 @@ func testRetrievalRoundTripWithTestCase(t *testing.T, tc testCase) {
mdb, err := adv.FieldMetadata().AsBytes()
require.NoError(t, err)

var receivedMd stiapi.Metadata
cids := testutil.GenerateCids(1)
pieceCID := cids[0]
receivedMd := stiapi.ParsedMetadata{Protocols: []stiapi.ProtocolMetadata{&metadata.GraphsyncFilecoinV1Metadata{PieceCID: pieceCID}}}
err = receivedMd.UnmarshalBinary(mdb)
require.NoError(t, err)
dtm := &metadata.GraphsyncFilecoinV1Metadata{}
dtm := metadata.GraphsyncFilecoinV1Metadata{}
err = dtm.FromIndexerMetadata(receivedMd)
require.NoError(t, err)

Expand Down Expand Up @@ -209,7 +211,7 @@ func testReimportCarWtihTestCase(t *testing.T, tc testCase) {
mdb, err := adv.FieldMetadata().AsBytes()
require.NoError(t, err)

var receivedMd stiapi.Metadata
var receivedMd stiapi.ParsedMetadata
err = receivedMd.UnmarshalBinary(mdb)
require.NoError(t, err)

Expand Down Expand Up @@ -242,7 +244,7 @@ func testReimportCarWtihTestCase(t *testing.T, tc testCase) {
mdb2, err := adv2.FieldMetadata().AsBytes()
require.NoError(t, err)

var receivedMd2 stiapi.Metadata
var receivedMd2 stiapi.ParsedMetadata
err = receivedMd2.UnmarshalBinary(mdb2)
require.NoError(t, err)

Expand Down
Loading