initial scaffold
- 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
This commit is contained in:
commit
ddf1ec3491
8 changed files with 450 additions and 0 deletions
27
internal/artifact/download.go
Normal file
27
internal/artifact/download.go
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
// 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
|
||||
}
|
||||
Reference in a new issue