[Tutorial] Run your own satellite (part 10) - Introducing mud and ranged-loop

core service (satellite/run/core.go)

What is core service? It is a collection of components in the core.go file:

// https://github.com/storj/storj/blob/861183073ffd057db41d12b85b3184dacccfcbaa/satellite/run/core.go#L37-L66
func (a *Core) GetSelector(ball *mud.Ball) mud.ComponentSelector {
	return mud.Or(
		Observability(ball),
		mud.Select[*analytics.Service](ball),
		mud.Select[*mailservice.Service](ball),
		mud.Select[*emailreminders.Chore](ball),
		mud.Select[*overlay.Service](ball),
		mud.Select[*offlinenodes.Chore](ball),
		mud.Select[*straynodes.Chore](ball),
		mud.Select[*nodeevents.Chore](ball),
		mud.Select[*audit.ContainmentSyncChore](ball),
		mud.Select[*expireddeletion.Chore](ball),
		mud.Select[*zombiedeletion.Chore](ball),
		mud.Select[*tally.Service](ball),
		mud.Select[*rollup.Service](ball),
		mud.Select[*projectbwcleanup.Chore](ball),
		mud.Select[*rolluparchive.Chore](ball),
		mud.Select[*storjscan.Chore](ball),
		mud.Select[*billing.Chore](ball),
		mud.Select[*repairer.QueueStat](ball),
		mud.Select[*sender.Service](ball),
		mud.Select[*accountfreeze.Chore](ball),
		mud.Select[*accountfreeze.BotFreezeChore](ball),
		mud.Select[*accountfreeze.TrialFreezeChore](ball),
		mud.Select[*accountfreeze.OptOutFreezeChore](ball),
		mud.Select[*dbcleanup.Chore](ball),
		mud.Select[*pendingdelete.Chore](ball),
		mud.Select[*projectlimitevents.Chore](ball),
	)
}

Observability(ball) is an additional of these components:

// https://github.com/storj/storj/blob/861183073ffd057db41d12b85b3184dacccfcbaa/satellite/run/observability.go#L18-L26
func Observability(ball *mud.Ball) mud.ComponentSelector {
	return mud.Or(
		mud.Select[debug.Wrapper](ball),
		mud.Select[*tracing.Tracing](ball),
		mud.Select[*eventkit.Eventkit](ball),
		mud.Select[*profiler.Profiler](ball),
		mud.Select[*DBVersionCheck](ball),
	)
}

Unless you plan to run your satellite exactly as Storj, I don’t think you should run this core service exactly as is.

Two ways to run a modified core service:

  1. use satellite-modular exec and only include components that you need.
  2. use built-in satellite-modular core but remove component that you don’t need, eg:
./satellite-modular core --components='!emailreminders,!accountfreeze.Chore' ...

Each have it pro and cons, but I would recommend using 1. as it give you greater control and easier to manage if you heavily modify your satellite.