Skip to content

Conversation

@unwrap-nicolas
Copy link

@unwrap-nicolas unwrap-nicolas commented Feb 7, 2026

Description and Notes

fixed #795
depends on #639

this PR addresses the lack of data persistence and network flexibility in the current docker-compose.yml setup.

currently, users running docker compose up experience:

  • Data loss on container restart — blockchain data, Prometheus metrics, and Grafana dashboards are lost every time containers are recreated
  • Mainnet-only — no way to run on signet, testnet, or other networks without manually editing the compose file

Changes

Data Persistence:

  • Adds named Docker volumes for Floresta, Prometheus, and Grafana
  • Supports FLORESTA_DATA environment variable to reuse existing local blockchain data (useful for sharing data between native and Docker installations)

Network Configuration:

  • Adds NETWORK environment variable to easily switch between Bitcoin networks (bitcoin, signet, testnet, testnet4, regtest)
  • Forces fixed internal ports (50001 for Electrum, 8332 for RPC) with --rpc-address and --electrum-address flags, avoiding port conflicts when changing networks

Grafana Provisioning Fixes:

  • Adds explicit uid: prometheus to datasource provisioning config
  • Removes __inputs, __elements, and __requires export artifacts from dashboard JSON (these break provisioning and are only used for manual UI imports)
  • Replaces all ${DS_PROMETHEUS} placeholders with the actual datasource uid

Documentation:

  • Updates doc/docker.md with examples for running different networks and using local data directories

How to verify the changes you have done?

  1. Start the stack: docker compose up -d or NETWORK=signet FLORESTA_DATA=$HOME/.floresta docker compose up
  2. Open Grafana at http://localhost:3000/ (user: admin, password: grafana).
  3. Verify:
    • Datasource(s) appear provisioned (Provisioning → Datasources).
    • The "Floresta" dashboard is listed and opens without errors (Dashboards → Browse).
  4. Open Prometheus at http://localhost:9090/ and confirm targets are up.
  5. Optionally validate metrics are exposed: curl -s http://localhost:3333/metrics | head

Contributor Checklist

  • I've followed the contribution guidelines
  • I've verified one of the following:
    • Ran just pcc (recommended but slower)
    • Ran just lint-features '-- -D warnings' && cargo test --release
    • Confirmed CI passed on my fork
  • I've linked any related issue(s) in the sections above

Finally, you are encouraged to sign all your commits (it proves authorship and guards against tampering—see How (and why) to sign Git commits and GitHub's guide to signing commits).

Adiciona provider de dashboards em metrics/grafana/dashboards.yml e dashboard inicial em metrics/grafana/dashboards/floresta-dashboard.json.

Atualiza docker-compose para montar volumes de provisioning e dashboards do Grafana e expor a UI em 3000, além de manter a configuração do Prometheus.

Motivação: facilitar observabilidade local com Grafana e Prometheus sem configuração manual.
@moisesPompilio moisesPompilio added the enhancement New feature or request label Feb 7, 2026
@luisschwab
Copy link
Member

Should be marked as draft until 639 is merged

@unwrap-nicolas unwrap-nicolas marked this pull request as draft February 8, 2026 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhancement] Align docker-compose.yml with persistence docs and improve dev workflow

5 participants