# `ViewstampedReplication.Replica`
[🔗](https://github.com/gsmlg-dev/concord/tree/main/apps/viewstamped_replication/blob/main/lib/viewstamped_replication/replica.ex#L1)

Supervised effect interpreter for one VSR replica.

The GenServer is the serialization boundary for protocol state. Storage and
transport adapters remain process-free and their state is owned here.

# `t`

```elixir
@type t() :: %ViewstampedReplication.Replica{
  bootstrap: term(),
  configuration: term(),
  durable_applied_number: term(),
  protocol_state: term(),
  state_machine: term(),
  state_machine_state: term(),
  storage: term(),
  storage_state: term(),
  timers: term(),
  transport: term(),
  transport_state: term()
}
```

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `deliver`

```elixir
@spec deliver(term(), term(), ViewstampedReplication.Protocol.Envelope.t()) ::
  :ok | {:error, :not_found}
```

# `primary`

```elixir
@spec primary(term(), term()) :: {:ok, term()} | {:error, :not_found}
```

# `read`

```elixir
@spec read(pid() | term(), term(), keyword()) :: {:ok, term()} | {:error, term()}
```

# `snapshot`

```elixir
@spec snapshot(term(), term()) :: :ok | {:error, term()}
```

# `start_link`

# `status`

```elixir
@spec status(term(), term()) :: {:ok, map()} | {:error, :not_found}
```

# `submit`

```elixir
@spec submit(pid() | term(), term(), ViewstampedReplication.Request.t()) :: :ok
```

# `whereis`

```elixir
@spec whereis(term(), term()) :: pid() | nil
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
