> For the complete documentation index, see [llms.txt](https://jito-foundation.gitbook.io/mev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jito-foundation.gitbook.io/mev/jito-solana/firebam-setup-guide.md).

# FireBAM Setup Guide

FireBAM is a fork of [Firedancer](https://jumpcrypto.com/firedancer/) that adds support for [BAM (Blockspace Assembly Marketplace)](https://bam.dev/). BAM provides next-generation transaction scheduling for Solana while the validator continues to own consensus, voting, execution, and block production.

This guide covers the FireBAM-specific setup. Before continuing, complete the standard Firedancer installation and host configuration:

* [Firedancer Getting Started Guide](https://docs.firedancer.io/guide/getting-started.html)
* [Firedancer Configuration Guide](https://docs.firedancer.io/guide/configuring.html)
* [BAM for Validators](https://bam.dev/validators/)

### How FireBAM Works

The BAM node receives transactions and Block Engine bundles, schedules them, and sends ordered work to the validator over gRPC. FireBAM executes that work and returns leader-state and execution results to the BAM node.

FireBAM has two operating modes:

* **BAM disabled or unhealthy:** the BAM scheduling path is inactive and the validator uses its normal transaction ingress, including Block Engine.
* **BAM enabled and healthy:** the validator accepts scheduled work from the BAM node. Normal TPU and Block Engine bundle ingress are paused while this mode is active.

### Requirements

All standard Firedancer requirements still apply. The current FireBAM release has been tested with:

* Ubuntu 24.04
* An AVX-512-compatible CPU, such as Intel Ice Lake or later or AMD EPYC 9xxx
* At least 186 GiB of RAM
* A 10 Gbit/s or faster network connection
* Outbound DNS and TCP access to the selected BAM endpoint on ports `50055-50056`

### Get FireBAM

FireBAM is available from the [Jito FireBAM repository](https://github.com/jito-foundation/firebam). Select the intended release (minimum of v26.10.\* for Alpenglow), then clone the repository with its submodules:

```bash
git clone --recurse-submodules https://github.com/jito-foundation/firebam
cd firebam
git checkout RELEASE_TAG
git submodule update --init --recursive
./deps.sh
```

Build the binary for the validator mode you operate.

#### Build FireBAM

```bash
make -j firedancer
```

The binary is written to `build/native/gcc/bin/firedancer`.

### Configure FireBAM

Start with the Firedancer configuration you already use for the target cluster. Keep your normal identity, vote account, authorized voter, ledger, accounts, gossip, snapshot, RPC, and reporting settings.

The same BAM and Block Engine settings apply to Firedancer. Add the sections for your cluster.

#### Mainnet

```toml
[tiles.bundle]
enabled = true
url = "https://mainnet.block-engine.jito.wtf"
tip_distribution_program_addr = "4R3gSG8BpU4t19KYj8CfnbtRpnT8gtk4dvTHxVRwc2r7"
tip_payment_program_addr = "T1pyyaTNZsKv2WcRAB8oVnk93mLJw2XzjtVYqCsaHqt"
tip_distribution_authority = "8F4jGUmxF36vQ6yabnsxX6AQVXdKBhs8kGSUuRKSg8Xt"
commission_bps = 800

[tiles.bam]
enabled = true
url = "http://mainnet.bam.jito.wtf:50055"
```

`commission_bps` is the validator’s tip commission in basis points. Set it to the value you intend to use rather than copying the example without review.

#### Testnet

```toml
[tiles.bundle]
enabled = true
url = "https://testnet.block-engine.jito.wtf"
tip_distribution_program_addr = "DzvGET57TAgEDxvm3ERUM4GNcsAJdqjDLCne9sdfY4wf"
tip_payment_program_addr = "GJHtFqM9agxPmkeKjHny6qiRKrXZALvvFGiKf11QE7hy"
tip_distribution_authority = "7T4inmPmtNBX3MhLwJ9hFsSMnGJYYkKioVABSNTWVRuS"
commission_bps = 800

[tiles.bam]
enabled = true
url = "http://testnet.bam.jito.wtf:50055"
```

{% hint style="info" %}
The bundle and BAM tiles do not support hot reconfiguration. To use bundle functionality, `[tiles.bundle].enabled = true` must be present when the validator starts. To use BAM functionality, `[tiles.bam].enabled = true` must be present when the validator starts. If either tile is not enabled at startup, the validator must be restarted with the corresponding setting enabled before that functionality can be used.
{% endhint %}

### Start FireBAM

Replace `mainnet.toml` with the path to your reviewed configuration. Run only the command for your validator mode.

Use the appropriate checked-in BAM configuration as a reference:

* [Firedancer mainnet BAM configuration](https://github.com/jito-foundation/firebam/blob/main/src/app/firedancer/config/mainnet-bam.toml)
* [Firedancer testnet BAM configuration](https://github.com/jito-foundation/firebam/blob/main/src/app/firedancer/config/testnet-bam.toml)

```bash
sudo -E ./build/native/gcc/bin/firedancer run --config mainnet.toml
```

Run FireBAM under the same service supervision and restart policy you use for your validator, and use that supervisor to stop it. Do not run a second validator process against the same identity, ledger, or accounts directories.

### Verify the BAM Tile

In another shell, inspect the configured topology with the binary for your validator mode.

#### Inspect the configured topology

```bash
./build/native/gcc/bin/firedancer mem --config mainnet.toml | grep -E '(^|[[:space:]])(bam|bam_verif|pack_bam_(ldr|res)|bank_bam|bam_status|bam_ctrl|bam_fee_cfg)([[:space:]]|$)'
```

You should see the BAM tile and its related workspaces. If the Firedancer GUI is enabled, the topology should also contain `bam:0`.

#### Check the runtime BAM configuration

```bash
./build/native/gcc/bin/firedancer get-bam --config mainnet.toml
```

Always pass the same configuration file that was used to start the validator.

### Runtime Control

You can change the BAM endpoint or toggle BAM without restarting, provided the validator started with `[tiles.bam].enabled = true`.

#### Update the BAM configuration

```bash
# Show the active BAM configuration
./build/native/gcc/bin/firedancer get-bam --config mainnet.toml

# Enable BAM or update the endpoint
./build/native/gcc/bin/firedancer set-bam --config mainnet.toml --enable --url http://mainnet.bam.jito.wtf:50055

# Disable BAM while leaving the BAM tile available for later re-enablement
./build/native/gcc/bin/firedancer set-bam --config mainnet.toml --disable
```

#### Change the validator identity

Identity changes use the control binary for the running validator mode.

```bash
sudo ./build/native/gcc/bin/firedancer set-identity --config mainnet.toml /etc/solana/staked-identity.json
```

Use `--force` only when intentionally recovering from a partially completed identity change.

### Monitor FireBAM

#### Read metrics

If HTTP metrics are enabled, the same command works for both validator modes:

```bash
curl -s http://127.0.0.1:7999/metrics | grep -E '^(bam_|pack_bam_)'
```

If HTTP metrics are disabled, use the control binary for your validator mode.

```bash
./build/native/gcc/bin/firedancer metrics --config mainnet.toml | grep -E '^(bam_|pack_bam_)'
```

#### Core BAM Health

| Metric                             | Meaning                                                                                                                                                                                     |
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `bam_enabled`                      | Operator enable state: `1` when BAM is enabled and `0` when disabled                                                                                                                        |
| `bam_healthy`                      | `1` when transport, authentication, configuration, scheduler stream, and builder-activity checks are healthy; it does not guarantee that fresh work has arrived for the current leader slot |
| `bam_stream_live`                  | `1` when the BAM scheduler gRPC stream is established and live                                                                                                                              |
| `bam_transaction_published_total`  | Transactions published from BAM to verify, including transactions unpacked from bundles                                                                                                     |
| `bam_atomic_batch_published_total` | `revert_on_error` atomic batches published from BAM to verify                                                                                                                               |
| `bam_failure_total`                | BAM control-plane and session failures grouped by class; scheduler payload and atomic-batch rejections are counted separately                                                               |

#### Pack Progress

| Metric                                             | Meaning                                                                                                         |
| -------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| `pack_bam_work_items_total`                        | BAM work items observed at each labeled pack lifecycle stage; a multi-transaction bundle counts as one item     |
| `pack_bam_pending_work_count`                      | Current BAM work items tracked after acceptance and before scheduling or cleanup                                |
| `pack_bam_leader_slot_first_insert_result_total`   | Leader slots grouped by no BAM insert, first insert before slot end, or first insert at or after slot end       |
| `pack_bam_leader_slot_first_schedule_result_total` | Leader slots grouped by no BAM schedule, first schedule before slot end, or first schedule at or after slot end |
| `pack_bam_work_first_outcome_total`                | BAM work items grouped by their first terminal pack outcome                                                     |

Metrics ending in `_total` are cumulative counters. Use their labels and rates or increases when building alerts; `pack_bam_pending_work_count` is a current gauge.

### Troubleshooting

#### The BAM tile is missing

Confirm that the configuration contained `[tiles.bam].enabled = true` before startup. Add it and restart the validator; `set-bam` cannot create a missing BAM topology at runtime.

#### `get-bam` reports that runtime control is unavailable

Use the exact configuration path that started the validator. If the error continues, confirm the validator started with BAM enabled and restart it after correcting the configuration.

#### `bam_enabled=1` but `bam_healthy=0`

Check:

* The BAM hostname, port, and cluster
* DNS resolution and outbound TCP connectivity to ports `50055-50056`
* Validator identity access and BAM authentication logs
* If `bam_stream_live=0`, scheduler-stream connection errors and the labeled failure classes in `bam_failure_total`
* If `bam_stream_live=1`, configuration-response errors, missing builder heartbeats, or builder-activity timeouts in the validator log

#### Hugepage or shared-memory errors

Stop the validator before changing hugepage mounts. The following commands remove and recreate the hugetlbfs mounts and named shared-memory regions for the supplied configuration, so use the exact configuration file for the stopped validator.

```bash
sudo -E ./build/native/gcc/bin/firedancer configure fini hugetlbfs --config mainnet.toml
sudo -E ./build/native/gcc/bin/firedancer configure init hugetlbfs --config mainnet.toml
./build/native/gcc/bin/firedancer configure check hugetlbfs --config mainnet.toml
```

#### Last-resort host configuration reset

Use this only when targeted recovery has failed. Stop the validator and any other process using its hugepage mounts, CPU cores, or network interfaces. Disable automatic supervisor restarts until the reset is complete, and use the exact configuration file for the stopped validator.

`configure fini all` undoes every host-configuration stage that the selected binary can roll back. `configure init all` then checks and reapplies every stage known to that binary, including stages that do not support rollback. This is a full rebuild of the configuration managed by the selected binary, not a factory reset of the host.

| Area                                                          | Firedancer                                                        |
| ------------------------------------------------------------- | ----------------------------------------------------------------- |
| Hugepage mounts and named shared-memory regions               | Removed and recreated                                             |
| System-wide reserved hugepage counts                          | Increased if required by `init`; not reduced by `fini`            |
| Cpuset, IRQ affinity, irqbalance, and kernel-worker CPU masks | Reset and reapplied where supported                               |
| Kernel and network tuning                                     | Reset where a rollback handler exists, then checked and reapplied |
| Agave or systemd CPU affinity                                 | Not managed; restore through the owning service configuration     |

{% hint style="info" %}
These commands change host-wide memory, CPU, kernel, and network configuration. If `configure fini all` reports that a resource is still in use, stop the process using it instead of forcing the cleanup. Do not proceed until `configure fini all` completes successfully; then run `configure init all`.
{% endhint %}

```bash
sudo -E ./build/native/gcc/bin/firedancer configure fini all --config mainnet.toml
sudo -E ./build/native/gcc/bin/firedancer configure init all --config mainnet.toml
./build/native/gcc/bin/firedancer configure check all --config mainnet.toml
```

### Next Steps

After FireBAM is healthy:

1. Confirm `bam_enabled=1`, `bam_healthy=1`, and `bam_stream_live=1`.
2. Confirm `bam_transaction_published_total` and, when atomic batches arrive, `bam_atomic_batch_published_total` increase.
3. During leader slots, confirm the labeled `pack_bam_work_items_total` stages progress and the first-insert and first-schedule results occur before slot end.
4. Alert on BAM health or stream loss and unexpected increases in `no_event` or `after_end` first-insert and first-schedule results.

For BAM architecture and validator information, see [bam.dev](https://bam.dev/) and the [BAM validator guide](https://bam.dev/validators/).
