Skip to content

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.

const pool = yield* Rivet.Pool("Nodes", {
endpoint: "https://rivet.example.com",
token: Redacted.make(adminToken),
namespace: namespace.name,
});
const pool = yield* Rivet.Pool("Nodes", {
endpoint: "https://rivet.example.com",
token: Redacted.make(adminToken),
namespace: namespace.name,
drainOnVersionUpgrade: true,
actorEvictionPeriod: 60,
});

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",
});