Skip to content

Config seed provider

ConfigSeedProvider returns a static list of seed addresses — from a constructor argument or environment variables. No discovery logic; what you configure is what you get.

import { Cluster, ConfigSeedProvider } from 'actor-ts';
const provider = new ConfigSeedProvider({
seeds: ['10.0.0.5:2552', '10.0.0.6:2552', '10.0.0.7:2552'],
});
const seeds = await provider.lookup();
await Cluster.join(system, { host, port, seeds });

The simplest provider for the simplest case.

interface ConfigSeedProviderSettings {
seeds?: string[]; // explicit list
envVar?: string; // env-var name (CSV)
}

Two ways to specify:

// Explicit:
new ConfigSeedProvider({ seeds: ['10.0.0.5:2552', '10.0.0.6:2552'] });
// From env (CSV):
new ConfigSeedProvider({ envVar: 'ACTOR_TS_SEEDS' });
// where ACTOR_TS_SEEDS='10.0.0.5:2552,10.0.0.6:2552'

Pick whichever fits your deployment pattern. Env vars are typical for containerized deployments where the list comes from a config map / orchestrator.

Three good fits:

  1. Docker Compose — known service names + ports; actor-ts-1:2552,actor-ts-2:2552,actor-ts-3:2552 in env.
  2. VMs with fixed IPs — three production VMs, each with a stable address.
  3. Tests — known peer addresses inline in test setup.