Rivet.Pool reference
Source:
packages/rivet/src/Pool.ts
A node pool on a Rivet control plane. Nodes that connect with the pool’s
name host its actors; the control plane rejects nodes whose pool does not
exist. Pool Layers (RivetDocker.SwarmPool, …) create one for the nodes they
run, so declare one directly only for nodes Alchemy does not deploy.
Pool: Creating a pool
Section titled “Pool: Creating a pool”const pool = yield* Rivet.Pool("Nodes", { endpoint: "https://rivet.example.com", token: Redacted.make(adminToken), namespace: namespace.name,});Pool: Draining on upgrade
Section titled “Pool: Draining on upgrade”const pool = yield* Rivet.Pool("Nodes", { endpoint: "https://rivet.example.com", token: Redacted.make(adminToken), namespace: namespace.name, drainOnVersionUpgrade: true, actorEvictionPeriod: 60,});Pool: Looking up an existing pool
Section titled “Pool: Looking up an existing pool”Pool.lookup references a pool Alchemy doesn’t manage (created with
the Rivet API or by another stack). It is read during plan/deploy, never
created, updated or deleted.
durableObjects and env are empty: they are what the deploy that runs
the pool hosts.
const nodes = Rivet.Pool.lookup({ endpoint: "https://rivet.example.com", token: Redacted.make(adminToken), namespace: "production", name: "nodes",});