StoreProtocol class

The wire contract between a hub and its storage nodes.

Nodes reach the hub over OmnyHub's node control channel — a WebSocket the node dials outward, which is what lets a node sit behind NAT and still serve a public registry. This library names the RPC actions carried on it and the shape of their payloads.

Two planes, deliberately. Registry operations (create a package, publish a release, list assets) are small JSON round-trips and travel on the control channel directly. Artifact bytes are a different problem: an installer is gigabytes and the control channel frames JSON. So bytes travel one of three ways, chosen per provider by DataPlaneMode:

  • DataPlaneMode.presigned — the node's bucket issues a URL and the client fetches it directly. Nothing crosses the hub or the node.
  • DataPlaneMode.direct — the node is reachable, and the hub redirects the client to the node's own HTTP endpoint.
  • DataPlaneMode.relay — the node is not reachable, so bytes are streamed over the control channel in chunks (chunkOpen, chunkRead, uploadChunk). Correct everywhere, and the slowest: every byte is base64-framed and crosses two hops. The chunked actions exist so that even a fully firewalled node is a usable provider.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

decodeQuery(Map<String, dynamic> json) ReleaseQuery
Decodes a ReleaseQuery from an RPC payload.
decodeRange(Map<String, dynamic> json) ByteRange?
Decodes a ByteRange from an RPC payload fragment, or null.
decodeStats(Map<String, dynamic> json) DownloadStats
Decodes DownloadStats from the wire.
encodeException(OmnyStoreException e) Map<String, dynamic>
Renders an OmnyStoreException into an RPC error payload.
encodeQuery(ReleaseQuery query) Map<String, dynamic>
Encodes a ReleaseQuery into an RPC payload.
encodeRange(ByteRange? range) Map<String, dynamic>
Encodes a ByteRange into an RPC payload fragment.
encodeStats(DownloadStats stats) Map<String, dynamic>
Encodes DownloadStats for the wire.
exceptionFrom(Map<String, dynamic> json) OmnyStoreException?
Reconstructs an exception from an RPC error payload, or returns null if json carries no error.
requireVersion(Map<String, dynamic> json, String key) Object
Reads a required semantic version field from an RPC payload.

Constants

assetByName → const String
assetDelete → const String
assetDownloadTarget → const String
assetGet → const String
Asset metadata operations.
assetList → const String
capability → const String
The capability token a storage node advertises to the hub, so a hub sharing its OmnyHub instance with other node types can tell them apart.
chunkClose → const String
chunkOpen → const String
Chunked download: open a read, pull chunks, close it.
chunkRead → const String
defaultChunkBytes → const int
The default relay chunk size.
describe → const String
Returns the node's current ProviderDescriptor.
descriptorKey → const String
The registration payload key carrying the node's ProviderDescriptor.
downloadList → const String
downloadRecord → const String
Download recording and statistics.
downloadStats → const String
maxChunkBytes → const int
The largest chunk a node will accept or emit, so a malicious or buggy peer cannot force an allocation of arbitrary size.
organizationByName → const String
organizationCreate → const String
Organization operations.
organizationDelete → const String
organizationGet → const String
organizationList → const String
organizationUpdate → const String
packageByName → const String
packageCreate → const String
Package operations.
packageDelete → const String
packageGet → const String
packageList → const String
packageResolve → const String
packageUpdate → const String
projectByName → const String
projectCreate → const String
Project operations.
projectDelete → const String
projectGet → const String
projectList → const String
projectUpdate → const String
providerList → const String
Provider listing.
releaseByVersion → const String
releaseDelete → const String
releaseGet → const String
releaseLatest → const String
releaseList → const String
releasePromote → const String
releasePublish → const String
Release operations.
releaseUpdate → const String
ticketSecretKey → const String
The registration ack key carrying the ticket-signing secret the hub issues to a DataPlaneMode.direct node.
updateCheck → const String
Update checking.
uploadAbort → const String
uploadBegin → const String
Chunked upload: begin, push chunks, commit or abort.
uploadChunk → const String
uploadCommit → const String
version → const int
The protocol version advertised at registration. A hub refuses a node whose major version it does not implement.
versionKey → const String
The registration payload key carrying the protocol version.