- module layout: cmd/mithril-go, internal/{aggregator,artifact,verify,networks}
- aggregator REST client, list command working against mainnet
- download/extract/verify stubbed
- no deps yet, pure stdlib
27 lines
958 B
Go
27 lines
958 B
Go
// Package artifact handles downloading and extracting Mithril snapshot artifacts.
|
|
// Currently stubs — HTTP range requests, resumable downloads, zstd+tar extraction
|
|
// will be implemented in the next pass.
|
|
package artifact
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
)
|
|
|
|
var ErrNotImplemented = errors.New("not yet implemented")
|
|
|
|
// Download fetches an artifact from one of the supplied locations, choosing
|
|
// the first reachable one and storing it at destPath.
|
|
// Implementation will do:
|
|
// - parallel range-chunks over HTTP
|
|
// - resume on partial .part file
|
|
// - SHA-256 verification against the snapshot manifest
|
|
func Download(ctx context.Context, locations []string, destPath string) error {
|
|
return ErrNotImplemented
|
|
}
|
|
|
|
// Extract decompresses a zstd+tar archive into targetDir.
|
|
// Will stream through zstd -> tar reader without buffering the full archive.
|
|
func Extract(ctx context.Context, archivePath, targetDir string) error {
|
|
return ErrNotImplemented
|
|
}
|