Skip to content

Commit fe3c79e

Browse files
committed
raw car deprecation: latest references zst file
latest should reference the zst encoded car file. redirect latest.zst to latest now
1 parent dc3272a commit fe3c79e

File tree

4 files changed

+10
-15
lines changed

4 files changed

+10
-15
lines changed

cmd/filecoin-chain-archiver/cmds/create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ func runUploadCompressed(ctx context.Context, minioClient *minio.Client, flagBuc
523523
digest: digest,
524524
size: snapshotSize,
525525
filename: filename,
526-
latestIndex: "latest.zst",
526+
latestIndex: "latest",
527527
latestLocation: latestLocation,
528528
}, nil
529529
}

pkg/export/export.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@ func TimeAtHeight(gts *types.TipSet, height abi.ChainEpoch, blocktime time.Durat
3131
}
3232

3333
/*
34-
/- 500
35-
|----------|----------|----------|----------|
36-
|----------|
37-
485 - / \ - 585
34+
/- 500
35+
36+
|----------|----------|----------|----------|
37+
38+
|----------|
39+
485 - / \ - 585
3840
*/
3941
func GetNextSnapshotHeight(current, interval, confidence abi.ChainEpoch, after bool) abi.ChainEpoch {
4042
next := ((current + interval) / interval) * interval

pkg/index/service/service.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,8 @@ func (bs *IndexService) SetupService(configPath string) error {
8787
})
8888

8989
bs.ServiceRouter.HandleFunc("/minimal/latest.zst", func(w http.ResponseWriter, r *http.Request) {
90-
value, err := bs.resolver.Resolve(context.Background(), "minimal/latest.zst")
91-
if err != nil {
92-
logger.Errorw("error resolving", "err", err)
93-
w.WriteHeader(http.StatusBadGateway)
94-
return
95-
}
96-
97-
w.Header().Set("Location", value)
98-
w.WriteHeader(http.StatusFound)
90+
http.Redirect(w, r, "/minimal/latest", 301)
91+
return
9992
})
10093

10194
return bs.dumpRoutes(bs.ServiceRouter)

pkg/nodelocker/api/apiclient/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"context"
55
"net/http"
66

7-
"github.com/filecoin-project/go-jsonrpc"
87
"github.com/filecoin-project/filecoin-chain-archiver/pkg/nodelocker/api"
8+
"github.com/filecoin-project/go-jsonrpc"
99
)
1010

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

0 commit comments

Comments
 (0)