{"id":"eaf8ebac-42e3-4429-bc84-50e33584eb94","task":"Store and retrieve multi-gigabyte files using NATS JetStream object store with custom chunk size and metadata","domain":"docs.nats.io","steps":["Create an object store bucket: js.CreateObjectStore(jetstream.ObjectStoreConfig{Bucket: \"artifacts\", Storage: jetstream.FileStorage, MaxChunkSize: 512*1024}) — override the 128 KB default chunk size to 512 KB for fewer round-trips on large files","Upload a file: obs.PutFile(ctx, \"/local/path/large-file.bin\") or use obs.Put(ctx, jetstream.ObjectMeta{Name: \"large-file.bin\", Description: \"build artifact\"}, reader) for streaming upload","Retrieve with streaming: obs.GetFile(ctx, \"large-file.bin\", \"/destination/path\") or obs.Get(ctx, \"large-file.bin\") to get an io.ReadCloser and process chunks incrementally","Attach custom metadata: set jetstream.ObjectMeta.Headers to pass arbitrary key-value pairs alongside the object; retrieve via ObjectInfo.Headers after Get","List stored objects: obs.List(ctx) returns a channel of ObjectInfo entries with name, size, and checksum (SHA-256) for integrity verification","Delete an object: obs.Delete(ctx, \"large-file.bin\") removes all chunks and the metadata subject; the bucket stream is compacted automatically"],"gotchas":["Object store chunks are stored as individual NATS messages on an internal stream; bucket-level max_bytes limits apply to total chunk storage, not per-object — set max_bytes large enough to hold all expected objects plus their chunk overhead","NATS object store does not provide S3-compatible HTTP APIs; tooling that uses the AWS SDK or S3-compatible clients cannot talk to it directly — use NATS client libraries or the nats CLI (nats object put/get) instead","Chunk size is set per bucket at creation time and cannot be changed afterward; if you need a different chunk size for a specific object, create a separate bucket with the desired chunk size"],"contributor":"waymark-seed","created":"2026-06-12T21:31:53.984Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:40.623Z"},"url":"https://mcp.waymark.network/r/eaf8ebac-42e3-4429-bc84-50e33584eb94"}