Publicly Available Monero Dashboard

Warning: Some information in this article might be a little outdated,
Here is the update post: Updated: Monero Dashboard, Now With Node Map!
(^ v ^)

Hi!
Recently i just made available a grafana dashboard for my xmr node publicly available!

You can access the dashboard here: https://xmr-node.dvdznf.xyz

Note than only the dashboard is accessible in this manner and xmr-node.dvdznf.xyz is not a valid daemon to connect to.

How does it work?

Obliviously the fundamental block of this “Tech Stack” is the Monero Daemon.

The monero daemon exposes it’s rpc interface to Monero-Exporter, which is a way underrated and awesome project.

Prometheus is then used to scrape that raw data and makes it available via its queryable database.

Then Grafana is the one who accually generates those nice looking graphs after it queries the Prometheus database.

So this “Tech Stack” generally follows the classic way of making a Grafana dashboard.

Implementation.

Im wayy to lazy to make the setup from zero on bare metal and i also happen to really like Docker.

Soooo,
for my setup, I just used the docker-monero-node project from the same guy that made the monero.fail public node aggregator.

The project not only has an example docker-compose.yaml file but also neccessary dockerfiles for building the images for the containers.

Anyway here is the docker-compose file that is use:

version: "3.7"

volumes:
  grafana:
  prometheus:

x-log-config: &log-config
  logging:
    driver: json-file
    options:
      max-size: "50m"
      max-file: "20"

services: 
  prometheus:
    image: prom/prometheus
    command:
      - --config.file=/etc/prometheus/config.yaml
      - --storage.tsdb.path=/prometheus
      - --storage.tsdb.retention.time=360d
    container_name: monerod_prometheus
    restart: unless-stopped
    ports:
      - 127.0.0.1:9090:9090
    volumes:
      - prometheus:/prometheus
      - ./files/prometheus/config.yaml:/etc/prometheus/config.yaml:ro
    <<: *log-config
  grafana:
    user: "1000"
    command:
      - -config=/etc/grafana/grafana.ini
    container_name: monerod_grafana
    restart: unless-stopped
    image: grafana/grafana
    ports:
      - [Super secret private ip]:80:3000
    volumes:
      - grafana:/var/lib/grafana
      - ./files/grafana/grafana.ini:/etc/grafana/grafana.ini:ro
      - ./files/grafana/provisioning:/etc/grafana/provisioning:ro
      - ./files/grafana/dashboards:/var/lib/grafana/dashboards:ro
    environment:
      HOSTNAME: grafana     #These are super important so i would pay attention to them  ^_^
      GF_SERVER_ROOT_URL: https://xmr-node.dvdznf.xyz
      GF_ANALYTICS_REPORTING_ENABLED: "false"
      GF_ANALYTICS_CHECK_FOR_UPDATES: "false"
      GF_USERS_ALLOW_SIGN_UP: "false"
      GF_USERS_ALLOW_ORG_CREATE: "false"
      GF_LOG_LEVEL: "debug"
      GF_AUTH_ANONYMOUS_ENABLED: "true"
      GF_AUTH_BASIC_ENABLED: "true"
      GF_AUTH_DISABLE_LOGIN_FORM: "false"
      GF_SECURITY_ADMIN_PASSWORD: "[Super secret tmp password that you should change]"
      GF_SECURITY_ADMIN_USER: "[Super secret tmp admin username that you should change]"
      GF_SECURITY_ALLOW_EMBEDDING: "true"
    <<: *log-config
  exporter:
    container_name: monerod_exporter
    build:
      context: dockerfiles
      dockerfile: monerod_exporter
    restart: unless-stopped
    ports:
      - 127.0.0.1:9000:9000
    command:
      - --monero-addr=http://monerod:18083
    <<: *log-config
  monerod:
    container_name: monerod
    build:
      context: dockerfiles
      dockerfile: monero_nocompile
    restart: unless-stopped
    volumes:
      - /home/david/.bitmonero:/data
    ports:
      - 18080:18080                    # p2p
      - 18081:18081             # restricted rpc
      - 127.0.0.1:18082:18082          # zmq
      - 127.0.0.1:18083:18083 # unrestricted rpc
    command:
      monerod --data-dir=/data --p2p-bind-ip=0.0.0.0 --p2p-bind-port=18080 --rpc-restricted-bind-ip=0.0.0.0 --rpc-restricted-bind-port=18081 --zmq-rpc-bind-ip=0.0.0.0 --zmq-rpc-bind-port=18082 --rpc-bind-ip=0.0.0.0 --rpc-bind-port=18083 --non-interactive --confirm-external-bind --public-node --log-level=0 --enable-dns-blocklist --rpc-ssl=disabled    # <--This is the actual monero daemon
    <<: *log-config

Edit: Code updated on 24/07/2023

And finally here is a ctop view of the running servicies:

So now that I have all of the services and containers up and running, I wanted a way to expose the daemon’s p2p interface to the internet but also the Grafana Dashboard.

And because I am behind a NAT that I can control, I simply forwarded those ports to the public facing IP of my network.

Now everything is set!

But having a domain like: xmr-node.dvdznf.xyz pointing directly at my network is kinda scary.
(ISP would probably be reaaaally mad if I get DDoS)

So I decided to use Cloudflare in order to proxy the domain to the actual IP address.

Not only does this hide the actual IP address but it also has built in DDoS mitigation.

So there you go, that’s my setup.

Conclusion:

Running a publicly accessible Monero Node Dashboard may seem hard but it’s actually pretty simple.

Sources/Further reading: