Skip to content

Commit

Permalink
raw car deprecation: latest references zst file
Browse files Browse the repository at this point in the history
latest should reference the zst encoded car file.

redirect latest.zst to latest now
  • Loading branch information
ognots committed May 10, 2023
1 parent dc3272a commit fe3c79e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 15 deletions.
2 changes: 1 addition & 1 deletion cmd/filecoin-chain-archiver/cmds/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ func runUploadCompressed(ctx context.Context, minioClient *minio.Client, flagBuc
digest: digest,
size: snapshotSize,
filename: filename,
latestIndex: "latest.zst",
latestIndex: "latest",
latestLocation: latestLocation,
}, nil
}
10 changes: 6 additions & 4 deletions pkg/export/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ func TimeAtHeight(gts *types.TipSet, height abi.ChainEpoch, blocktime time.Durat
}

/*
/- 500
|----------|----------|----------|----------|
|----------|
485 - / \ - 585
/- 500
|----------|----------|----------|----------|
|----------|
485 - / \ - 585
*/
func GetNextSnapshotHeight(current, interval, confidence abi.ChainEpoch, after bool) abi.ChainEpoch {
next := ((current + interval) / interval) * interval
Expand Down
11 changes: 2 additions & 9 deletions pkg/index/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,8 @@ func (bs *IndexService) SetupService(configPath string) error {
})

bs.ServiceRouter.HandleFunc("/minimal/latest.zst", func(w http.ResponseWriter, r *http.Request) {
value, err := bs.resolver.Resolve(context.Background(), "minimal/latest.zst")
if err != nil {
logger.Errorw("error resolving", "err", err)
w.WriteHeader(http.StatusBadGateway)
return
}

w.Header().Set("Location", value)
w.WriteHeader(http.StatusFound)
http.Redirect(w, r, "/minimal/latest", 301)
return
})

return bs.dumpRoutes(bs.ServiceRouter)
Expand Down
2 changes: 1 addition & 1 deletion pkg/nodelocker/api/apiclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"net/http"

"github.com/filecoin-project/go-jsonrpc"
"github.com/filecoin-project/filecoin-chain-archiver/pkg/nodelocker/api"
"github.com/filecoin-project/go-jsonrpc"
)

func NewOperatorClient(ctx context.Context, addr string, requestHeader http.Header) (api.Operator, jsonrpc.ClientCloser, error) {
Expand Down

0 comments on commit fe3c79e

Please sign in to comment.