StorageNodeClient class

Client for a single Walrus storage node's HTTP API.

Usage:

final node = StorageNodeClient(
  baseUrl: 'https://node-1.walrus-testnet.walrus.space',
);

// Write metadata + slivers
await node.storeBlobMetadata(blobId: blobId, metadata: metadataBytes);
await node.storeSliver(
  blobId: blobId,
  sliverPairIndex: 0,
  sliverType: SliverType.primary,
  sliver: sliverBytes,
);

// Get confirmation
final confirmation = await node.getPermanentBlobConfirmation(blobId: blobId);

Constructors

StorageNodeClient({required String baseUrl, Duration timeout = const Duration(seconds: 30), int maxRetries = 3, Duration retryDelay = const Duration(milliseconds: 500), HttpClient? httpClient})

Properties

baseUrl → String
Base URL of the storage node API (e.g. https://node.walrus.space).
final
hashCode → int
The hash code for this object.
no setterinherited
maxRetries → int
Number of retry attempts for failed requests.
final
retryDelay → Duration
Delay between retries (doubled on each retry).
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
timeout → Duration
HTTP request timeout.
final

Methods

close() → void
Close the underlying HTTP client. Call when the node client is no longer needed to free sockets.
getBlobMetadata({required String blobId}) → Future<Uint8List>
Retrieve blob metadata from this node.
getBlobStatus({required String blobId}) → Future<BlobStatus>
Get the status of a blob on this node.
getDeletableBlobConfirmation({required String blobId, required String objectId}) → Future<StorageConfirmation>
Get a deletable blob confirmation from this node.
getPermanentBlobConfirmation({required String blobId}) → Future<StorageConfirmation>
Get a permanent blob confirmation from this node.
getSliver({required String blobId, required int sliverPairIndex, required SliverType sliverType}) → Future<Uint8List>
Retrieve a sliver from this node.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
storeBlobMetadata({required String blobId, required Uint8List metadata}) → Future<void>
Store blob metadata on this node.
storeSliver({required String blobId, required int sliverPairIndex, required SliverType sliverType, required Uint8List sliver}) → Future<void>
Store a sliver on this node.
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited