#data-storage #capability-provider #nats #object-store #wasmcloud #storage-config #satisfies

wasmcloud-provider-blobstore-nats

A capability provider that satisfies the 'wasi:blobstore' interface using NATS object store as a backend

1 unstable release

0.1.0 Jan 29, 2026

#943 in WebAssembly

Apache-2.0

1.5MB
4K SLoC

NATS Blobstore Capability Provider

This capability provider is an implementation of the following interfaces of wasi:blobstore proposal, backed by NATS Object Store:

  • wasi:blobstore/blobstore

This provider is multi-threaded and can handle concurrent requests from multiple consumer components. Furthermore, consumer components can share a host supplied default configuration, or provide their bespoke provider configuration, using wasmCloud's link definitions. Each link definition declared for this provider will result in a single NATS cluster connection managed on behalf of the linked component. Connections are maintained within the provider process, so multiple instances of this provider running in the same lattice will not share connections.

To configure this provider, use the following settings in link definitions:

Property Environment Variable Description Default
cluster_uri CONFIG_NATS_URI NATS cluster connection URI nats://0.0.0.0:4222
js_domain CONFIG_NATS_JETSTREAM_DOMAIN Optional NATS JetStream domain to connect to None
tls_ca_file CONFIG_NATS_TLS_CA_FILE Path qualified name of the CA public key. If both tls_ca and tls_ca_file are provided, tls_ca will be used None
max_write_wait CONFIG_NATS_MAX_WRITE_WAIT Timeout for write operations in seconds. Provides better control over write operations in different environments 30

Storage Configuration Settings

The following storage-specific settings can also be configured via link definitions:

Property Environment Variable Description Default
max_age CONFIG_NATS_STORAGE_MAX_AGE Maximum age of any blob in the container, expressed in seconds 315,569,520 (10 years)
storage_type CONFIG_NATS_STORAGE_TYPE The type of storage backend, either file or memory file
num_replicas CONFIG_NATS_STORAGE_NUM_REPLICAS How many replicas to keep for each blob in a NATS cluster 1
compression CONFIG_NATS_STORAGE_COMPRESSION Whether the underlying stream should be compressed false

While the provider supports receiving the following values via configuration, these values are sensitive and thus should be configured via link-time secrets.

Property Environment Variable Description Default
client_jwt CONFIG_NATS_CLIENT_JWT Optional JWT auth token. For JWT authentication, both client_jwt and client_seed must be provided None
client_seed CONFIG_NATS_CLIENT_SEED Private seed for JWT authentication None
tls_ca CONFIG_NATS_TLS_CA To secure communications with the NATS server, the public key of its CA could be provided as an encoded string None

Integration Tests

The provider includes comprehensive integration tests that verify its functionality against a live NATS server. These tests cover blobstore container operations, blob storage and retrieval, and a few edge cases by taking advantage of testcontainers.

Running the Tests

To run the integration tests:

# Set the environment variables
export TESTCONTAINERS_NATS_STARTUP_TIMEOUT=30
export CONFIG_NATS_MAX_WRITE_WAIT=30

# Run the tests in release mode
cargo test --release --test integration -- --include-ignored

Dependencies

~69–93MB
~1.5M SLoC