StoreNodeGateway class

The hub-side endpoint storage nodes connect to.

Wraps OmnyHub's NodeGateway and translates its lifecycle into OmnyStoreHub provider membership: a node that registers becomes a RemoteNodeStoreProvider in the hub's registry, its heartbeats refresh that provider's capacity and status, and a disconnect removes it.

final hub = OmnyStoreHub();
final gateway = StoreNodeGateway(store: hub);

final server = OmnyHub(transports: [HttpTransport.http(port: 8080)]);
await server.registerService(gateway.service);
await server.start();

Mount it on the same OmnyHub instance that serves the REST API and both share one port — which is what makes a hub deployable as a single container with one exposed port.

Constructors

StoreNodeGateway({required OmnyStoreHub store, NodeAdmissionPolicy? admissionPolicy, int chunkBytes = StoreProtocol.defaultChunkBytes, Logger logger = const NoopLogger(), String mount = '/_node', String name = 'omnystore-nodes', Duration heartbeatInterval = const Duration(seconds: 10), Duration heartbeatTimeout = const Duration(seconds: 30)})
Creates a gateway feeding store.

Properties

admissionPolicy NodeAdmissionPolicy?
Vets registrations. When null, a node serves exactly what it declares.
final
chunkBytes int
Bytes requested per relay chunk from nodes.
final
hashCode int
The hash code for this object.
no setterinherited
logger Logger
Structured logging.
final
nodes List<ProviderDescriptor>
The nodes currently registered as storage providers.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
service ↔ NodeGateway
The OmnyHub service nodes connect to. Register it with an OmnyHub.
latefinal
store OmnyStoreHub
The federating hub whose registry this gateway maintains.
final

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