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
Known 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
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp