# Node Setup

{% tabs %}
{% tab title="Block Producer" %}

```bash
# in startBlockProducingNode.sh
# run cardano-node with
# +RTS -N${CPU} -A16m --nonmoving-gc -qg -qb -RTS
cardano-node run +RTS -N${CPU} -A16m --nonmoving-gc -qg -qb -RTS ...
# this will lead to minimized "missed slot leader checks"

# in mainnet-config.json add
# "MaxConcurrencyDeadline": 4,
# "SnapshotInterval": 86400,
...
  "TurnOnLogging": true,
  "MaxConcurrencyDeadline": 4,
  "SnapshotInterval": 86400,
  "defaultBackends": [
    "KatipBK"
  ],
...
```

{% endtab %}

{% tab title="Relay Node" %}

```bash
# in startRelayNode.sh
# run cardano-node with
cardano-node run +RTS -N2 --disable-delayed-os-memory-return -I0.3 -Iw600 -A16m -F1.5 -H2500M -T -S -RTS ...
# this will optimize memory allocation

# in mainnet-config.json add
# "MaxConcurrencyDeadline": 4,
...
  "TurnOnLogging": true,
  "MaxConcurrencyDeadline": 4,
  "defaultBackends": [
    "KatipBK"
  ],
...
```

{% endtab %}
{% endtabs %}

* Missed slot leader checks optimization for Block Producer node\
  <https://cardano.stackexchange.com/questions/4532/missed-slot-leader-checks>
* Cardano SPO docs\
  <https://docs.cardano.org/getting-started/guidelines-for-large-spos>
* Solving cardano node huge memory usage\
  <https://forum.cardano.org/t/solving-the-cardano-node-huge-memory-usage-done/67032>
* Node RTS parameter documentation\
  <https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/runtime_control.html>
