From f56ead56ffaccaff6350d536a6977238617c4652 Mon Sep 17 00:00:00 2001 From: vdo Date: Thu, 26 May 2022 16:22:21 +0100 Subject: [PATCH 01/46] README checklist --- README.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index fa43135..53c4fa4 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,13 @@ Tested in: - Fedora 36 - CentOS 10 Stream -ToDo: +## ToDo -[ ] Add wizard for DNS domain selection. -[ ] Status and node info at finish. -[ ] Make tor service optional -[ ] Optional block explorer -[ ] Grafana with stats -[ ] Add monerod-proxy +- [ ] Add wizard for DNS domain selection. +- [ ] Status and node info at finish. +- [ ] Stagenet / Testnet selection +- [ ] Clearnet TLS port selection +- [ ] Make tor service optional +- [ ] (Optional) block explorer +- [ ] Grafana with stats +- [ ] Add monerod-proxy From fd6fde001c0ef1eba77aae6ae2671f53578af742 Mon Sep 17 00:00:00 2001 From: vdo Date: Thu, 26 May 2022 19:56:33 +0100 Subject: [PATCH 02/46] TLS domain input --- .env | 3 ++- docker-compose.tor.yml | 2 +- installer.sh | 52 ++++++++++++++++++++++++++++++++++++------ 3 files changed, 48 insertions(+), 9 deletions(-) diff --git a/.env b/.env index aad71e2..dfc8353 100644 --- a/.env +++ b/.env @@ -6,4 +6,5 @@ TRAEFIK_LOGLEVEL=DEBUG MONEROD_TAG=latest -THS_TAG=latest +#THS_TAG=latest +THS_TAG=0.4.7.7 diff --git a/docker-compose.tor.yml b/docker-compose.tor.yml index 5ff1a71..24493c1 100644 --- a/docker-compose.tor.yml +++ b/docker-compose.tor.yml @@ -3,7 +3,7 @@ version: "3.7" services: tor: container_name: tor - image: goldy/tor-hidden-service:${THS_TAG} + image: vdo1138/tor-hidden-service:${THS_TAG} links: - monerod environment: diff --git a/installer.sh b/installer.sh index e06ba92..472ce86 100755 --- a/installer.sh +++ b/installer.sh @@ -52,6 +52,8 @@ ErrBullet="${OnBlack}${Red}:: ${White}" Ok="${OnBlack}${Green} ok.${Off}" Fail="${OnBlack}${Red} failed!${Off}" Nok="${OnBlack}${Yellow} nok.${Off}" +Stat="${OnBlack}${Purple}" +StatInfo="${OnBlack}${White}" ################################################################ # Vars # @@ -63,6 +65,7 @@ DOCKER_INSTALLED=false DOCKER_COMPOSE_INSTALLED=false DOCKER_COMPOSE_VERSION="v2.5.0" DEPENDENCIES="git curl" +ONION="Not Available" ################################################################ # Functions # @@ -145,7 +148,7 @@ detect_docker_compose() { fi } -install_docker() { ( +install_docker() { echo -ne "${OkBullet}Installing docker... ${Off}" # Docker Installer as provided in curl -fsSL https://get.docker.com -o - | bash >>"${XMRSH_LOG_FILE}" 2>&1 @@ -156,7 +159,7 @@ install_docker() { ( systemctl start docker >>"${XMRSH_LOG_FILE}" 2>&1 fi echo -e "${Ok}" -); } +} install_docker_compose() { echo -ne "${OkBullet}Installing compose... ${Off}" @@ -181,9 +184,36 @@ install_xmrsh() { echo -e "${Ok}" } +read_tls_domain() { + echo -e "${OkBullet}Enter the desired domain for the SSL certificate." + read -e -p " Leave empty to use a self signed certificate []: " TLS_DOMAIN + pushd "${XMRSH_DIR}" >>"${XMRSH_LOG_FILE}" 2>&1 + if [ ! -z ${TLS_DOMAIN} ]; then + while ! echo "${TLS_DOMAIN}" | grep -qP '(?=^.{5,254}$)(^(?:(?!\d+\.)[a-zA-Z0-9_\-]{1,63}\.?)+(?:[a-zA-Z]{2,})$)'; do + echo -e "${WarnBullet}Domain not valid." + read -p " Enter again your desired domain []: " TLS_DOMAIN + done + # Email needed TRAEFIK_ACME_EMAIL + + sed -i "s/DOMAIN=.*/DOMAIN=${TLS_DOMAIN}/g" .env + cp docker-compose.le.yml docker-compose.yml + else + cp docker-compose.nole.yml docker-compose.yml + fi +} + +get_public_ip() { + # Using dig: + # dig +short txt ch whoami.cloudflare @1.0.0.1 + PUBLIC_IP=$(curl -s ifconfig.co) +} + +validate_domain() { + echo "$1" | grep -P '(?=^.{5,254}$)(^(?:(?!\d+\.)[a-zA-Z0-9_\-]{1,63}\.?)+(?:[a-zA-Z]{2,})$)' +} + start_xmrsh() { pushd "${XMRSH_DIR}" >>"${XMRSH_LOG_FILE}" 2>&1 - cp docker-compose.nole.yml docker-compose.yml ## FIXME: Temporal deploy w/o Let's Encrypt echo -ne "${OkBullet}Starting monero node... ${Off}" docker-compose pull >>"${XMRSH_LOG_FILE}" 2>&1 check_return $? @@ -200,11 +230,10 @@ start_xmrsh_tor() { sleep 3 ONION=$(docker logs tor 2>&1 | grep Entrypoint | cut -d " " -f 8) echo -e "${Ok}" - echo -e "${OkBullet}Tor hidden service ready at: ${ONION} ${Off}" } check_return() { - if [ $1 -ne 0 ]; then + if [ "$1" -ne 0 ]; then echo -e "${Fail}" echo -e "${ErrBullet}Installation failed. Check the logs in ${XMRSH_LOG_FILE}${Off}" exit "$1" @@ -212,8 +241,16 @@ check_return() { } completed() { - # FIXME: Show domain / public IP - echo -e "${OkBullet}Deployment complete!!${Off}" + echo -e "${OkBullet}Deployment complete.${Off}" + echo + echo -e " ${Red}┌───────────────────────────────────────────────────────────────────────────[info]──" + if [ ! -z "$TLS_DOMAIN" ]; then + echo -e " ${Red}│${Stat} URL: ${StatInfo}${TLS_DOMAIN}:443" + fi + echo -e " ${Red}│${Stat} Public IP: ${StatInfo}$(curl -s ifconfig.co 2>>"${XMRSH_LOG_FILE}"):443" + echo -e " ${Red}│${Stat} Onion Service: ${StatInfo}$ONION" + echo -e " ${Red}│" + echo } header @@ -232,6 +269,7 @@ if [ $DOCKER_INSTALLED = true ] && [ $DOCKER_COMPOSE_INSTALLED = false ]; then fi install_xmrsh +read_tls_domain start_xmrsh start_xmrsh_tor completed From 168c0bba97dbf911e835d4fbf24013acbd4db8ef Mon Sep 17 00:00:00 2001 From: vdo Date: Fri, 27 May 2022 11:17:18 +0100 Subject: [PATCH 03/46] Use anchors, TLS email check --- .env | 10 +++++++-- installer.sh | 57 +++++++++++++++++++++++++++++++--------------------- 2 files changed, 42 insertions(+), 25 deletions(-) diff --git a/.env b/.env index dfc8353..55ef4a7 100644 --- a/.env +++ b/.env @@ -3,8 +3,14 @@ DOMAIN=your-domain.xmr.example TRAEFIK_TAG=2.7 TRAEFIK_ACME_EMAIL=your-email@xmr.example TRAEFIK_LOGLEVEL=DEBUG +TRAEFIK_TLS_PORT=443 +TRAEFIK_HTTP_PORT=80 MONEROD_TAG=latest +MONEROD_RPC_PORT=18089 +MONEROD_P2P_PORT=18080 +MONEROD_accessControlAllowOriginList=* -#THS_TAG=latest -THS_TAG=0.4.7.7 +#TOR_TAG=latest +TOR_TAG=0.4.7.7 +TOR_HTTP_PORT=80 diff --git a/installer.sh b/installer.sh index 472ce86..f66615e 100755 --- a/installer.sh +++ b/installer.sh @@ -60,12 +60,16 @@ StatInfo="${OnBlack}${White}" ################################################################ VERSION="v0.1.0" XMRSH_DIR="/opt/xmr.sh" +XMRSH_BRANCH="master" +XMRSH_URL="https://github.com/vdo/xmr.sh" XMRSH_LOG_FILE="/tmp/xmr.sh-$(date +%Y%m%d-%H%M%S).log" DOCKER_INSTALLED=false DOCKER_COMPOSE_INSTALLED=false DOCKER_COMPOSE_VERSION="v2.5.0" DEPENDENCIES="git curl" ONION="Not Available" +TLS_DOMAIN="" +TLS_EMAIL="" ################################################################ # Functions # @@ -92,9 +96,10 @@ detect_root() { check_deps() { echo -ne "${OkBullet}Checking and installing dependencies... ${Off}" + # shellcheck disable=SC2068 for pkg in ${DEPENDENCIES[@]}; do - if ! which ${pkg} >>"${XMRSH_LOG_FILE}" 2>&1; then - install_pkg ${pkg} + if ! command -v "${pkg}" >>"${XMRSH_LOG_FILE}" 2>&1; then + install_pkg "${pkg}" check_return $? fi done @@ -105,9 +110,9 @@ install_pkg() { # This detects both ubuntu and debian if grep -q "debian" /etc/os-release; then apt-get update >>"${XMRSH_LOG_FILE}" 2>&1 - apt-get install -y $1 >>"${XMRSH_LOG_FILE}" 2>&1 + apt-get install -y "$1" >>"${XMRSH_LOG_FILE}" 2>&1 elif grep -q "fedora" /etc/os-release || grep -q "centos" /etc/os-release; then - dnf install -y $1 >>"${XMRSH_LOG_FILE}" 2>&1 + dnf install -y "$1" >>"${XMRSH_LOG_FILE}" 2>&1 else echo -e "${ErrBullet}Cannot detect your distribution package manager.${Off}" exit 1 @@ -174,7 +179,7 @@ install_docker_compose() { install_xmrsh() { echo -ne "${OkBullet}Installing xmr.sh... ${Off}" if [ ! -d "$XMRSH_DIR" ]; then - git clone https://github.com/vdo/xmr.sh "${XMRSH_DIR}" >>"${XMRSH_LOG_FILE}" 2>&1 + git clone -b "${XMRSH_BRANCH}" "${XMRSH_URL}" "${XMRSH_DIR}" >>"${XMRSH_LOG_FILE}" 2>&1 check_return $? else echo -e "${Ok}" @@ -185,35 +190,41 @@ install_xmrsh() { } read_tls_domain() { - echo -e "${OkBullet}Enter the desired domain for the SSL certificate." - read -e -p " Leave empty to use a self signed certificate []: " TLS_DOMAIN - pushd "${XMRSH_DIR}" >>"${XMRSH_LOG_FILE}" 2>&1 - if [ ! -z ${TLS_DOMAIN} ]; then + echo -e "${OkBullet}Enter the desired domain for the Let's Encrypt SSL certificate." + read -r -e -p " Leave empty to use a self signed certificate []: " TLS_DOMAIN + pushd "${XMRSH_DIR}" >>"${XMRSH_LOG_FILE}" 2>&1 || return + if [ -n "${TLS_DOMAIN}" ]; then while ! echo "${TLS_DOMAIN}" | grep -qP '(?=^.{5,254}$)(^(?:(?!\d+\.)[a-zA-Z0-9_\-]{1,63}\.?)+(?:[a-zA-Z]{2,})$)'; do echo -e "${WarnBullet}Domain not valid." - read -p " Enter again your desired domain []: " TLS_DOMAIN + read -r -p " Enter again your desired domain []: " TLS_DOMAIN done - # Email needed TRAEFIK_ACME_EMAIL - + echo -e "${OkBullet}Enter the desired email for the Let's Encrypt SSL certificate." + read -r -e -p " Enter a valid email. Let's Encrypt validates it! []: " TLS_DOMAIN + while ! echo "${TLS_EMAIL}" | grep -qP '^[A-Za-z0-9+._-]+@([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,6}$'; do + echo -e "${WarnBullet}Email not valid." + read -r -p " Enter again your desired email []: " TLS_EMAIL + done + # Set domain and email address in vars sed -i "s/DOMAIN=.*/DOMAIN=${TLS_DOMAIN}/g" .env - cp docker-compose.le.yml docker-compose.yml - else - cp docker-compose.nole.yml docker-compose.yml + sed -i "s/TRAEFIK_ACME_EMAIL=.*/TRAEFIK_ACME_EMAIL=${TLS_EMAIL}/g" .env + # Enable LE settings in compose + sed -i '/#!le/s/# //g' docker-compose.template.yml + sed -i "/#\!traefik-command/s/\*traefik-command-nole/\*traefik-command-le/g" docker-compose.template.yml fi } -get_public_ip() { - # Using dig: - # dig +short txt ch whoami.cloudflare @1.0.0.1 - PUBLIC_IP=$(curl -s ifconfig.co) -} +# get_public_ip() { +# # Using dig: +# # dig +short txt ch whoami.cloudflare @1.0.0.1 +# PUBLIC_IP=$(curl -s ifconfig.co) +# } validate_domain() { echo "$1" | grep -P '(?=^.{5,254}$)(^(?:(?!\d+\.)[a-zA-Z0-9_\-]{1,63}\.?)+(?:[a-zA-Z]{2,})$)' } start_xmrsh() { - pushd "${XMRSH_DIR}" >>"${XMRSH_LOG_FILE}" 2>&1 + pushd "${XMRSH_DIR}" >>"${XMRSH_LOG_FILE}" 2>&1 || return echo -ne "${OkBullet}Starting monero node... ${Off}" docker-compose pull >>"${XMRSH_LOG_FILE}" 2>&1 check_return $? @@ -223,7 +234,7 @@ start_xmrsh() { } start_xmrsh_tor() { - pushd "${XMRSH_DIR}" >>"${XMRSH_LOG_FILE}" 2>&1 + pushd "${XMRSH_DIR}" >>"${XMRSH_LOG_FILE}" 2>&1 || return echo -ne "${OkBullet}Starting tor hidden service... ${Off}" docker-compose -f docker-compose.yml -f docker-compose.tor.yml up -d >>"${XMRSH_LOG_FILE}" 2>&1 check_return $? @@ -244,7 +255,7 @@ completed() { echo -e "${OkBullet}Deployment complete.${Off}" echo echo -e " ${Red}┌───────────────────────────────────────────────────────────────────────────[info]──" - if [ ! -z "$TLS_DOMAIN" ]; then + if [ -n "$TLS_DOMAIN" ]; then echo -e " ${Red}│${Stat} URL: ${StatInfo}${TLS_DOMAIN}:443" fi echo -e " ${Red}│${Stat} Public IP: ${StatInfo}$(curl -s ifconfig.co 2>>"${XMRSH_LOG_FILE}"):443" From d46b04c94381efe1420698d8be760569a79fd01a Mon Sep 17 00:00:00 2001 From: vdo Date: Fri, 27 May 2022 11:43:08 +0100 Subject: [PATCH 04/46] Configure cors, tor, explorer, watchtower --- docker-compose.le.yml | 59 --------------------- docker-compose.nole.yml | 56 -------------------- docker-compose.tor.yml | 26 --------- docker-compose.yml | 113 ++++++++++++++++++++++++++++++++++++++++ installer.sh | 100 ++++++++++++++++++++++++++++------- 5 files changed, 193 insertions(+), 161 deletions(-) delete mode 100644 docker-compose.le.yml delete mode 100644 docker-compose.nole.yml delete mode 100644 docker-compose.tor.yml create mode 100644 docker-compose.yml diff --git a/docker-compose.le.yml b/docker-compose.le.yml deleted file mode 100644 index 90c7895..0000000 --- a/docker-compose.le.yml +++ /dev/null @@ -1,59 +0,0 @@ -version: "3.7" - -services: - traefik: - image: traefik:${TRAEFIK_TAG} - container_name: traefik - ports: - - 80:80 - - 443:443 - volumes: - - "./letsencrypt:/letsencrypt" - - "/var/run/docker.sock:/var/run/docker.sock:ro" - command: - - "--log.level=${TRAEFIK_LOGLEVEL}" - - "--providers.docker=true" - - "--providers.docker.exposedbydefault=false" - - "--entrypoints.web.address=:80" - - "--entrypoints.web.http.redirections.entryPoint.to=websecure" - - "--entrypoints.web.http.redirections.entryPoint.scheme=https" - - "--entrypoints.web.http.redirections.entrypoint.permanent=true" - - "--entrypoints.websecure.address=:443" - - "--certificatesresolvers.le.acme.httpchallenge=true" - - "--certificatesresolvers.le.acme.httpchallenge.entrypoint=web" - - "--certificatesresolvers.le.acme.email=${TRAEFIK_ACME_EMAIL}" - - "--certificatesresolvers.le.acme.storage=/letsencrypt/acme.json" - restart: always - monerod: - container_name: monerod - image: sethsimmons/simple-monerod:${MONEROD_TAG} - command: >- - --restricted-rpc --public-node --no-igd --no-zmq - --enable-dns-blocklist --rpc-restricted-bind-ip=0.0.0.0 --rpc-restricted-bind-port=18089 --confirm-external-bind - --prune-blockchain - ports: - - "18080:18080" # Exposes P2P port - - "18089" - volumes: - - "monerod-data:/home/monero/.bitmonero" - labels: - - "traefik.enable=true" - - "traefik.http.routers.monerod.rule=(Host(`${DOMAIN}`))" - - "traefik.http.routers.monerod.entrypoints=websecure" - - "traefik.http.routers.monerod.tls.certresolver=le" - - "traefik.http.routers.monerod.service=monerod" - - "traefik.http.services.monerod.loadbalancer.server.port=18089" - - "traefik.http.middlewares.corsheader.headers.accessControlAllowOriginList=*" - - "traefik.http.routers.monerod.middlewares=corsheader" - restart: unless-stopped - - watchtower: - container_name: watchtower - image: containrrr/watchtower - volumes: - - /var/run/docker.sock:/var/run/docker.sock - labels: - - com.centurylinklabs.watchtower.enable="false" - command: --interval 360 --include-stopped -volumes: - monerod-data: {} diff --git a/docker-compose.nole.yml b/docker-compose.nole.yml deleted file mode 100644 index 5a5754d..0000000 --- a/docker-compose.nole.yml +++ /dev/null @@ -1,56 +0,0 @@ -services: - traefik: - image: traefik:${TRAEFIK_TAG} - container_name: traefik - ports: - - 80:80 - - 443:443 - volumes: - - "./letsencrypt:/letsencrypt" - - "/var/run/docker.sock:/var/run/docker.sock:ro" - command: - - "--log.level=${TRAEFIK_LOGLEVEL}" - - "--providers.docker=true" - - "--providers.docker.exposedbydefault=false" - - "--entrypoints.web.address=:80" - - "--entrypoints.web.http.redirections.entryPoint.to=websecure" - - "--entrypoints.web.http.redirections.entryPoint.scheme=https" - - "--entrypoints.web.http.redirections.entrypoint.permanent=true" - - "--entrypoints.websecure.address=:443" - restart: always - monerod: - container_name: monerod - image: sethsimmons/simple-monerod:${MONEROD_TAG} - command: >- - --restricted-rpc --public-node --no-igd --no-zmq - --enable-dns-blocklist --rpc-restricted-bind-ip=0.0.0.0 --rpc-restricted-bind-port=18089 --confirm-external-bind - --prune-blockchain - ports: - - "18080:18080" # Exposes P2P port - - "18089" - volumes: - - "monerod-data:/home/monero/.bitmonero" - labels: - - "traefik.enable=true" - - "traefik.http.routers.monerod.rule=(PathPrefix(`/`))" - - "traefik.http.routers.monerod.entrypoints=websecure" - - "traefik.http.routers.monerod.tls" - - "traefik.http.routers.monerod.service=monerod" - - "traefik.http.services.monerod.loadbalancer.server.port=18089" - - "traefik.http.middlewares.corsheader.headers.accessControlAllowOriginList=*" - - "traefik.http.routers.monerod.middlewares=corsheader" - restart: unless-stopped - - watchtower: - image: containrrr/watchtower - volumes: - - /var/run/docker.sock:/var/run/docker.sock - labels: - - com.centurylinklabs.watchtower.enable="false" - command: --interval 360 --include-stopped -volumes: - monerod-data: {} - -networks: - xmrsh: - name: xmrsh diff --git a/docker-compose.tor.yml b/docker-compose.tor.yml deleted file mode 100644 index 24493c1..0000000 --- a/docker-compose.tor.yml +++ /dev/null @@ -1,26 +0,0 @@ -version: "3.7" - -services: - tor: - container_name: tor - image: vdo1138/tor-hidden-service:${THS_TAG} - links: - - monerod - environment: - MONEROD_TOR_SERVICE_HOSTS: "80:monerod:18089" - volumes: - - tor-keys:/var/lib/tor/hidden_service/ - # secrets: - # - monerod - -volumes: - tor-keys: - {} - # driver: local - -# secrets: -# monerod: -# file: ./private_key_monerod_v3 -networks: - default: - name: ${NETWORK:-xmrsh_default} diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..58b0ab2 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,113 @@ +version: "3.7" + +x-traefik-command-le: &traefik-command-le + command: + - "--log.level=${TRAEFIK_LOGLEVEL}" + - "--providers.docker=true" + - "--providers.docker.exposedbydefault=false" + - "--entrypoints.web.address=:${TRAEFIK_HTTP_PORT}" + - "--entrypoints.web.http.redirections.entryPoint.to=websecure" + - "--entrypoints.web.http.redirections.entryPoint.scheme=https" + - "--entrypoints.web.http.redirections.entrypoint.permanent=true" + - "--entrypoints.websecure.address=:${TRAEFIK_TLS_PORT}" + - "--certificatesresolvers.le.acme.httpchallenge=true" + - "--certificatesresolvers.le.acme.httpchallenge.entrypoint=web" + - "--certificatesresolvers.le.acme.email=${TRAEFIK_ACME_EMAIL}" + - "--certificatesresolvers.le.acme.storage=/letsencrypt/acme.json" + +x-traefik-command-nole: &traefik-command-nole + command: + - "--log.level=${TRAEFIK_LOGLEVEL}" + - "--providers.docker=true" + - "--providers.docker.exposedbydefault=false" + - "--entrypoints.web.address=:${TRAEFIK_HTTP_PORT}" + - "--entrypoints.web.http.redirections.entryPoint.to=websecure" + - "--entrypoints.web.http.redirections.entryPoint.scheme=https" + - "--entrypoints.web.http.redirections.entrypoint.permanent=true" + - "--entrypoints.websecure.address=:${TRAEFIK_TLS_PORT}" + +x-monerod-mainnet-command: &monerod-mainnet-command + command: >- + --restricted-rpc --public-node --no-igd --no-zmq + --enable-dns-blocklist --rpc-restricted-bind-ip=0.0.0.0 + --rpc-restricted-bind-port=${MONEROD_RPC_PORT} --confirm-external-bind + --prune-blockchain + +x-tor-service: &tor-service + tor: + container_name: tor + image: vdo1138/tor-hidden-service:${TOR_TAG} + links: + - monerod + environment: + MONEROD_TOR_SERVICE_HOSTS: "${TOR_HTTP_PORT}:monerod:${MONEROD_RPC_PORT}" + volumes: + - tor-keys:/var/lib/tor/hidden_service/ + +x-explorer-service: &explorer-service + explorer: + image: sethsimmons/xmrblocks:latest + container_name: explorer + restart: unless-stopped + volumes: + - monerod-data:/home/monero/.bitmonero + ports: + - ${EXPLORER_PORT} + labels: + - "traefik.enable=true" + - "traefik.http.routers.explorer.rule=(Host(`${DOMAIN}`) && PathPrefix(`/explorer`) )" + - "traefik.http.routers.explorer.entrypoints=websecure" + - "traefik.http.routers.explorer.tls" + - "traefik.http.routers.explorer.service=explorer" + - "traefik.http.services.explorer.loadbalancer.server.port=${EXPLORER_PORT}" + # - "traefik.http.routers.explorer.tls.certresolver=le" #!le + +x-watchtower-service: &watchtower-service + watchtower: + container_name: watchtower + image: containrrr/watchtower:latest + volumes: + - /var/run/docker.sock:/var/run/docker.sock + labels: + - com.centurylinklabs.watchtower.enable="false" + command: --interval 360 --include-stopped + +services: + traefik: + image: traefik:${TRAEFIK_TAG} + container_name: traefik + ports: + - ${TRAEFIK_HTTP_PORT}:${TRAEFIK_HTTP_PORT} + - ${TRAEFIK_TLS_PORT}:${TRAEFIK_TLS_PORT} + volumes: + # - "./letsencrypt:/letsencrypt" #!le + - "/var/run/docker.sock:/var/run/docker.sock:ro" + <<: *traefik-command-nole #!traefik-command + restart: always + monerod: + container_name: monerod + image: sethsimmons/simple-monerod:${MONEROD_TAG} + <<: *monerod-mainnet-command #!monerod-command + ports: + - "${MONEROD_P2P_PORT}:${MONEROD_P2P_PORT}" # Exposes P2P port + - "${MONEROD_RPC_PORT}" + volumes: + - "monerod-data:/home/monero/.bitmonero" + labels: + - "traefik.enable=true" + - "traefik.http.routers.monerod.rule=(Host(`${DOMAIN}`))" + - "traefik.http.routers.monerod.entrypoints=websecure" + - "traefik.http.routers.monerod.tls" + - "traefik.http.routers.monerod.service=monerod" + - "traefik.http.services.monerod.loadbalancer.server.port=${MONEROD_RPC_PORT}" + # - "traefik.http.routers.monerod.tls.certresolver=le" #!le + # - "traefik.http.middlewares.corsheader.headers.accessControlAllowOriginList=${MONEROD_accessControlAllowOriginList}" #!cors + # - "traefik.http.routers.monerod.middlewares=corsheader" #!cors + restart: unless-stopped + + # <<: *tor-service #!tor + # <<: *explorer-service #!explorer + # <<: *watchtower-service #!watchtower +volumes: + monerod-data: {} + # tor-keys: {} #!tor diff --git a/installer.sh b/installer.sh index f66615e..eb7f8e3 100755 --- a/installer.sh +++ b/installer.sh @@ -68,6 +68,7 @@ DOCKER_COMPOSE_INSTALLED=false DOCKER_COMPOSE_VERSION="v2.5.0" DEPENDENCIES="git curl" ONION="Not Available" +TLS_PORT="443" TLS_DOMAIN="" TLS_EMAIL="" @@ -181,18 +182,18 @@ install_xmrsh() { if [ ! -d "$XMRSH_DIR" ]; then git clone -b "${XMRSH_BRANCH}" "${XMRSH_URL}" "${XMRSH_DIR}" >>"${XMRSH_LOG_FILE}" 2>&1 check_return $? + pushd "${XMRSH_DIR}" >>"${XMRSH_LOG_FILE}" 2>&1 || return else echo -e "${Ok}" - echo -e "${WarnBullet}Warning: xmr.sh already present in ${XMRSH_DIR}" + echo -e "${WarnBullet}Warning: xmr.sh already present in ${XMRSH_DIR}" #FIXME: This should probably exit return fi echo -e "${Ok}" } -read_tls_domain() { +configure_tls_domain() { echo -e "${OkBullet}Enter the desired domain for the Let's Encrypt SSL certificate." read -r -e -p " Leave empty to use a self signed certificate []: " TLS_DOMAIN - pushd "${XMRSH_DIR}" >>"${XMRSH_LOG_FILE}" 2>&1 || return if [ -n "${TLS_DOMAIN}" ]; then while ! echo "${TLS_DOMAIN}" | grep -qP '(?=^.{5,254}$)(^(?:(?!\d+\.)[a-zA-Z0-9_\-]{1,63}\.?)+(?:[a-zA-Z]{2,})$)'; do echo -e "${WarnBullet}Domain not valid." @@ -208,11 +209,73 @@ read_tls_domain() { sed -i "s/DOMAIN=.*/DOMAIN=${TLS_DOMAIN}/g" .env sed -i "s/TRAEFIK_ACME_EMAIL=.*/TRAEFIK_ACME_EMAIL=${TLS_EMAIL}/g" .env # Enable LE settings in compose - sed -i '/#!le/s/# //g' docker-compose.template.yml - sed -i "/#\!traefik-command/s/\*traefik-command-nole/\*traefik-command-le/g" docker-compose.template.yml + sed -i '/#!le/s/# //g' docker-compose.yml + sed -i "/#\!traefik-command/s/\*traefik-command-nole/\*traefik-command-le/g" docker-compose.yml fi } +configure_cors() { + echo -e "${OkBullet}Configuring CORS..." + while true; do + read -r -e -p " Do you want to enabe CORS headers so the node can be used in webapps? [y/n]: " yn + case $yn in + [Yy]*) + sed -i '/#!cors/s/# //g' docker-compose.yml + break + ;; + [Nn]*) break ;; + *) echo " Please answer yes or no." ;; + esac + done +} + +configure_tor() { + echo -e "${OkBullet}Configuring tor..." + while true; do + read -r -e -p " Do you want to enable a Tor hidden service? [y/n]: " yn + case $yn in + [Yy]*) + sed -i '/#!tor/s/# //g' docker-compose.yml + ENABLE_TOR=true + break + ;; + [Nn]*) break ;; + *) echo " Please answer yes or no." ;; + esac + done +} + +configure_explorer() { + echo -e "${OkBullet}Configuring explorer..." + while true; do + read -r -e -p " Do you want to enable an explorer service? [y/n]: " yn + case $yn in + [Yy]*) + sed -i '/#!explorer/s/# //g' docker-compose.yml + ENABLE_EXPLORER=true + break + ;; + [Nn]*) break ;; + *) echo " Please answer yes or no." ;; + esac + done +} + +configure_watchtower() { + echo -e "${OkBullet}Configuring watchtower..." + while true; do + read -r -e -p " Do you want to enable automatic updates using watchtower? [y/n]: " yn + case $yn in + [Yy]*) + sed -i '/#!watchtower/s/# //g' docker-compose.yml + break + ;; + [Nn]*) break ;; + *) echo " Please answer yes or no." ;; + esac + done +} + # get_public_ip() { # # Using dig: # # dig +short txt ch whoami.cloudflare @1.0.0.1 @@ -224,22 +287,16 @@ validate_domain() { } start_xmrsh() { - pushd "${XMRSH_DIR}" >>"${XMRSH_LOG_FILE}" 2>&1 || return - echo -ne "${OkBullet}Starting monero node... ${Off}" + echo -ne "${OkBullet}Starting monero node and services... ${Off}" docker-compose pull >>"${XMRSH_LOG_FILE}" 2>&1 check_return $? docker-compose up -d >>"${XMRSH_LOG_FILE}" 2>&1 check_return $? - echo -e "${Ok}" -} -start_xmrsh_tor() { - pushd "${XMRSH_DIR}" >>"${XMRSH_LOG_FILE}" 2>&1 || return - echo -ne "${OkBullet}Starting tor hidden service... ${Off}" - docker-compose -f docker-compose.yml -f docker-compose.tor.yml up -d >>"${XMRSH_LOG_FILE}" 2>&1 - check_return $? - sleep 3 - ONION=$(docker logs tor 2>&1 | grep Entrypoint | cut -d " " -f 8) + if ENABLE_TOR = true; then + sleep 3 + ONION=$(docker logs tor 2>&1 | grep Entrypoint | cut -d " " -f 8) + fi echo -e "${Ok}" } @@ -256,9 +313,9 @@ completed() { echo echo -e " ${Red}┌───────────────────────────────────────────────────────────────────────────[info]──" if [ -n "$TLS_DOMAIN" ]; then - echo -e " ${Red}│${Stat} URL: ${StatInfo}${TLS_DOMAIN}:443" + echo -e " ${Red}│${Stat} URL: ${StatInfo}${TLS_DOMAIN}:${TLS_PORT}" fi - echo -e " ${Red}│${Stat} Public IP: ${StatInfo}$(curl -s ifconfig.co 2>>"${XMRSH_LOG_FILE}"):443" + echo -e " ${Red}│${Stat} Public IP: ${StatInfo}$(curl -s ifconfig.co 2>>"${XMRSH_LOG_FILE}"):${TLS_PORT}" echo -e " ${Red}│${Stat} Onion Service: ${StatInfo}$ONION" echo -e " ${Red}│" echo @@ -280,9 +337,12 @@ if [ $DOCKER_INSTALLED = true ] && [ $DOCKER_COMPOSE_INSTALLED = false ]; then fi install_xmrsh -read_tls_domain +configure_tls_domain +configure_cors +configure_tor +configure_explorer +configure_watchtower start_xmrsh -start_xmrsh_tor completed exit 0 From 20001495795a2afad95e8b4c1fb21f79706c9f5b Mon Sep 17 00:00:00 2001 From: vdo Date: Fri, 27 May 2022 11:43:59 +0100 Subject: [PATCH 05/46] Update todo --- .env | 3 +++ README.md | 8 ++++---- installer.sh | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.env b/.env index 55ef4a7..f964910 100644 --- a/.env +++ b/.env @@ -14,3 +14,6 @@ MONEROD_accessControlAllowOriginList=* #TOR_TAG=latest TOR_TAG=0.4.7.7 TOR_HTTP_PORT=80 + +EXPLORER_TAG=latest +EXPLORER_PORT=8081 diff --git a/README.md b/README.md index 53c4fa4..ac20471 100644 --- a/README.md +++ b/README.md @@ -11,11 +11,11 @@ Tested in: ## ToDo -- [ ] Add wizard for DNS domain selection. -- [ ] Status and node info at finish. +- [x] Add wizard for DNS domain selection. +- [x] Status and node info at finish. - [ ] Stagenet / Testnet selection - [ ] Clearnet TLS port selection -- [ ] Make tor service optional -- [ ] (Optional) block explorer +- [x] Make tor service optional +- [x] (Optional) block explorer - [ ] Grafana with stats - [ ] Add monerod-proxy diff --git a/installer.sh b/installer.sh index eb7f8e3..7b6e4ec 100755 --- a/installer.sh +++ b/installer.sh @@ -60,7 +60,7 @@ StatInfo="${OnBlack}${White}" ################################################################ VERSION="v0.1.0" XMRSH_DIR="/opt/xmr.sh" -XMRSH_BRANCH="master" +XMRSH_BRANCH="main" XMRSH_URL="https://github.com/vdo/xmr.sh" XMRSH_LOG_FILE="/tmp/xmr.sh-$(date +%Y%m%d-%H%M%S).log" DOCKER_INSTALLED=false From 7e0523abd15f20720a932abfc598cb89bed5e5ca Mon Sep 17 00:00:00 2001 From: vdo Date: Fri, 27 May 2022 12:26:20 +0100 Subject: [PATCH 06/46] Fix path prefixes --- docker-compose.yml | 6 ++++-- installer.sh | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 58b0ab2..33690a0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -55,7 +55,8 @@ x-explorer-service: &explorer-service - ${EXPLORER_PORT} labels: - "traefik.enable=true" - - "traefik.http.routers.explorer.rule=(Host(`${DOMAIN}`) && PathPrefix(`/explorer`) )" + - "traefik.http.routers.explorer.rule=(PathPrefix(`/explorer`) )" #!nole + # - "traefik.http.routers.explorer.rule=(Host(`${DOMAIN}`) && PathPrefix(`/explorer`) )" #!le - "traefik.http.routers.explorer.entrypoints=websecure" - "traefik.http.routers.explorer.tls" - "traefik.http.routers.explorer.service=explorer" @@ -95,7 +96,8 @@ services: - "monerod-data:/home/monero/.bitmonero" labels: - "traefik.enable=true" - - "traefik.http.routers.monerod.rule=(Host(`${DOMAIN}`))" + # - "traefik.http.routers.monerod.rule=(Host(`${DOMAIN}`) && PathPrefix(`/`))" #!le + - "traefik.http.routers.monerod.rule=(PathPrefix(`/`))" #!nole - "traefik.http.routers.monerod.entrypoints=websecure" - "traefik.http.routers.monerod.tls" - "traefik.http.routers.monerod.service=monerod" diff --git a/installer.sh b/installer.sh index 7b6e4ec..17ac950 100755 --- a/installer.sh +++ b/installer.sh @@ -200,7 +200,7 @@ configure_tls_domain() { read -r -p " Enter again your desired domain []: " TLS_DOMAIN done echo -e "${OkBullet}Enter the desired email for the Let's Encrypt SSL certificate." - read -r -e -p " Enter a valid email. Let's Encrypt validates it! []: " TLS_DOMAIN + read -r -e -p " Enter a valid email. Let's Encrypt validates it! []: " TLS_EMAIL while ! echo "${TLS_EMAIL}" | grep -qP '^[A-Za-z0-9+._-]+@([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,6}$'; do echo -e "${WarnBullet}Email not valid." read -r -p " Enter again your desired email []: " TLS_EMAIL @@ -210,6 +210,7 @@ configure_tls_domain() { sed -i "s/TRAEFIK_ACME_EMAIL=.*/TRAEFIK_ACME_EMAIL=${TLS_EMAIL}/g" .env # Enable LE settings in compose sed -i '/#!le/s/# //g' docker-compose.yml + sed -i '/#!nole/s/- /# - /g' docker-compose.yml sed -i "/#\!traefik-command/s/\*traefik-command-nole/\*traefik-command-le/g" docker-compose.yml fi } @@ -292,8 +293,7 @@ start_xmrsh() { check_return $? docker-compose up -d >>"${XMRSH_LOG_FILE}" 2>&1 check_return $? - - if ENABLE_TOR = true; then + if [ $ENABLE_TOR = true ]; then sleep 3 ONION=$(docker logs tor 2>&1 | grep Entrypoint | cut -d " " -f 8) fi From 28299e1b5110581bd930f463032459621b36f243 Mon Sep 17 00:00:00 2001 From: vdo Date: Fri, 27 May 2022 14:14:54 +0100 Subject: [PATCH 07/46] add middleware for explorer path prefix --- docker-compose.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 33690a0..8ae9698 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -55,13 +55,15 @@ x-explorer-service: &explorer-service - ${EXPLORER_PORT} labels: - "traefik.enable=true" - - "traefik.http.routers.explorer.rule=(PathPrefix(`/explorer`) )" #!nole - # - "traefik.http.routers.explorer.rule=(Host(`${DOMAIN}`) && PathPrefix(`/explorer`) )" #!le + - "traefik.http.routers.explorer.rule=(PathPrefixStrip(`/explorer`) )" #!nole + # - "traefik.http.routers.explorer.rule=(Host(`${DOMAIN}`) && PathPrefixStrip(`/explorer`) )" #!le + # - "traefik.http.routers.explorer.tls.certresolver=le" #!le + - "traefik.http.middlewares.stripprefix.stripprefix.prefixes=/explorer" + - "traefik.http.routers.explorer.middlewares=stripprefix" - "traefik.http.routers.explorer.entrypoints=websecure" - "traefik.http.routers.explorer.tls" - "traefik.http.routers.explorer.service=explorer" - "traefik.http.services.explorer.loadbalancer.server.port=${EXPLORER_PORT}" - # - "traefik.http.routers.explorer.tls.certresolver=le" #!le x-watchtower-service: &watchtower-service watchtower: @@ -97,12 +99,12 @@ services: labels: - "traefik.enable=true" # - "traefik.http.routers.monerod.rule=(Host(`${DOMAIN}`) && PathPrefix(`/`))" #!le + # - "traefik.http.routers.monerod.tls.certresolver=le" #!le - "traefik.http.routers.monerod.rule=(PathPrefix(`/`))" #!nole - "traefik.http.routers.monerod.entrypoints=websecure" - "traefik.http.routers.monerod.tls" - "traefik.http.routers.monerod.service=monerod" - "traefik.http.services.monerod.loadbalancer.server.port=${MONEROD_RPC_PORT}" - # - "traefik.http.routers.monerod.tls.certresolver=le" #!le # - "traefik.http.middlewares.corsheader.headers.accessControlAllowOriginList=${MONEROD_accessControlAllowOriginList}" #!cors # - "traefik.http.routers.monerod.middlewares=corsheader" #!cors restart: unless-stopped From 32104f3d4a51c136064e66493143ba39c465e518 Mon Sep 17 00:00:00 2001 From: vdo Date: Fri, 27 May 2022 14:33:47 +0100 Subject: [PATCH 08/46] Color order --- installer.sh | 60 +++++++++++++++++++++++----------------------------- 1 file changed, 27 insertions(+), 33 deletions(-) diff --git a/installer.sh b/installer.sh index 17ac950..0f29ef5 100755 --- a/installer.sh +++ b/installer.sh @@ -16,26 +16,6 @@ Purple='\033[0;35m' # Purple Cyan='\033[0;36m' # Cyan White='\033[0;37m' # White -# Bold -BBlack='\033[1;30m' # Black -BRed='\033[1;31m' # Red -BGreen='\033[1;32m' # Green -BYellow='\033[1;33m' # Yellow -BBlue='\033[1;34m' # Blue -BPurple='\033[1;35m' # Purple -BCyan='\033[1;36m' # Cyan -BWhite='\033[1;37m' # White - -# Underline -UBlack='\033[4;30m' # Black -URed='\033[4;31m' # Red -UGreen='\033[4;32m' # Green -UYellow='\033[4;33m' # Yellow -UBlue='\033[4;34m' # Blue -UPurple='\033[4;35m' # Purple -UCyan='\033[4;36m' # Cyan -UWhite='\033[4;37m' # White - # Background On_Black='\033[40m' # Black On_Red='\033[41m' # Red @@ -46,14 +26,14 @@ On_Purple='\033[45m' # Purple On_Cyan='\033[46m' # Cyan On_White='\033[47m' # White -OkBullet="${OnBlack}${Green}:: ${White}" -WarnBullet="${OnBlack}${Yellow}:: ${White}" -ErrBullet="${OnBlack}${Red}:: ${White}" -Ok="${OnBlack}${Green} ok.${Off}" -Fail="${OnBlack}${Red} failed!${Off}" -Nok="${OnBlack}${Yellow} nok.${Off}" -Stat="${OnBlack}${Purple}" -StatInfo="${OnBlack}${White}" +OkBullet="${Green}${On_Black}:: ${White}${On_Black}" +WarnBullet="${Yellow}${On_Black}:: ${White}${On_Black}" +ErrBullet="${Red}${On_Black}:: ${White}${On_Black}" +Ok="${Green}${On_Black} ok.${Off}" +Fail="${Red}${On_Black} failed!${Off}" +Nok="${Yellow}${On_Black} nok.${Off}" +Stat="${Purple}${On_Black}" +StatInfo="${White}${On_Black}" ################################################################ # Vars # @@ -77,7 +57,7 @@ TLS_EMAIL="" ################################################################ header() { - echo -e "${OnBlack}${Red} _ " + echo -e "${Red}${On_Black} _ " echo -e "__ ___ __ ___ _ __ ___| |__ " echo -e "\ \/ / '_ ' _ \| '__/ __| '_ \ " echo -e " > <| | | | | | | _\__ \ | | |" @@ -310,13 +290,27 @@ check_return() { completed() { echo -e "${OkBullet}Deployment complete.${Off}" + PUBLIC_IP=$(curl -s ifconfig.co 2>>"${XMRSH_LOG_FILE}") + if [ -n "$TLS_DOMAIN" ]; then + HOST="${TLS_DOMAIN}" + else + HOST="${PUBLIC_IP}" + fi + if [ "$TLS_PORT" = "443" ]; then + PORT_SUFF="" + else + PORT_SUFF=":${TLS_PORT}" + fi echo echo -e " ${Red}┌───────────────────────────────────────────────────────────────────────────[info]──" - if [ -n "$TLS_DOMAIN" ]; then - echo -e " ${Red}│${Stat} URL: ${StatInfo}${TLS_DOMAIN}:${TLS_PORT}" + echo -e " ${Red}│${Stat} URL: ${StatInfo}https://${HOST}${PORT_SUFF}" + if [ "$ENABLE_EXPLORER" = true ]; then + echo -e " ${Red}│${Stat} Explorer URL: ${StatInfo}https://${HOST}${PORT_SUFF}/explorer" + fi + echo -e " ${Red}│${Stat} Public IP: ${StatInfo}${PUBLIC_IP}" + if [ "$ENABLE_TOR" = true ]; then + echo -e " ${Red}│${Stat} Onion Service: ${StatInfo}$ONION" fi - echo -e " ${Red}│${Stat} Public IP: ${StatInfo}$(curl -s ifconfig.co 2>>"${XMRSH_LOG_FILE}"):${TLS_PORT}" - echo -e " ${Red}│${Stat} Onion Service: ${StatInfo}$ONION" echo -e " ${Red}│" echo } From 9b30144709ee761aef29968bad07da20f57c128b Mon Sep 17 00:00:00 2001 From: vdo Date: Fri, 27 May 2022 17:03:17 +0100 Subject: [PATCH 09/46] explorer PathPrefix, color reset --- .env | 2 +- docker-compose.yml | 8 +++++--- installer.sh | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.env b/.env index f964910..d16eafa 100644 --- a/.env +++ b/.env @@ -15,5 +15,5 @@ MONEROD_accessControlAllowOriginList=* TOR_TAG=0.4.7.7 TOR_HTTP_PORT=80 -EXPLORER_TAG=latest +EXPLORER_TAG=v0.17 EXPLORER_PORT=8081 diff --git a/docker-compose.yml b/docker-compose.yml index 8ae9698..afd954a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -46,17 +46,19 @@ x-tor-service: &tor-service x-explorer-service: &explorer-service explorer: - image: sethsimmons/xmrblocks:latest + image: vdo1138/xmrblocks:${EXPLORER_TAG} container_name: explorer restart: unless-stopped volumes: - monerod-data:/home/monero/.bitmonero ports: - ${EXPLORER_PORT} + depends_on: + - monerod labels: - "traefik.enable=true" - - "traefik.http.routers.explorer.rule=(PathPrefixStrip(`/explorer`) )" #!nole - # - "traefik.http.routers.explorer.rule=(Host(`${DOMAIN}`) && PathPrefixStrip(`/explorer`) )" #!le + - "traefik.http.routers.explorer.rule=(PathPrefix(`/explorer`) )" #!nole + # - "traefik.http.routers.explorer.rule=(Host(`${DOMAIN}`) && PathPrefix(`/explorer`) )" #!le # - "traefik.http.routers.explorer.tls.certresolver=le" #!le - "traefik.http.middlewares.stripprefix.stripprefix.prefixes=/explorer" - "traefik.http.routers.explorer.middlewares=stripprefix" diff --git a/installer.sh b/installer.sh index 0f29ef5..862764a 100755 --- a/installer.sh +++ b/installer.sh @@ -290,7 +290,7 @@ check_return() { completed() { echo -e "${OkBullet}Deployment complete.${Off}" - PUBLIC_IP=$(curl -s ifconfig.co 2>>"${XMRSH_LOG_FILE}") + PUBLIC_IP=$(curl -4 -s ifconfig.co 2>>"${XMRSH_LOG_FILE}") if [ -n "$TLS_DOMAIN" ]; then HOST="${TLS_DOMAIN}" else @@ -311,7 +311,7 @@ completed() { if [ "$ENABLE_TOR" = true ]; then echo -e " ${Red}│${Stat} Onion Service: ${StatInfo}$ONION" fi - echo -e " ${Red}│" + echo -e " ${Red}│${Off}" echo } From ce1660eae3221dd3339406989e147947ebc9e8a8 Mon Sep 17 00:00:00 2001 From: vdo Date: Sat, 28 May 2022 09:54:01 +0100 Subject: [PATCH 10/46] Bump version --- README.md | 5 +++-- installer.sh | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ac20471..cd66a0d 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ A Monero node installer in a single command -Tested in: +Tested on: - Debian 11 - Ubuntu Focal @@ -18,4 +18,5 @@ Tested in: - [x] Make tor service optional - [x] (Optional) block explorer - [ ] Grafana with stats -- [ ] Add monerod-proxy +- [ ] arm64 support +- [ ] monerod-proxy support for fallback nodes. diff --git a/installer.sh b/installer.sh index 862764a..6301be0 100755 --- a/installer.sh +++ b/installer.sh @@ -38,7 +38,7 @@ StatInfo="${White}${On_Black}" ################################################################ # Vars # ################################################################ -VERSION="v0.1.0" +VERSION="v0.2.0" XMRSH_DIR="/opt/xmr.sh" XMRSH_BRANCH="main" XMRSH_URL="https://github.com/vdo/xmr.sh" From 05fb2e83f39d84f7dd8411ba4d7aed43009f4933 Mon Sep 17 00:00:00 2001 From: vdo Date: Tue, 31 May 2022 11:52:07 +0100 Subject: [PATCH 11/46] Rename script, port and network select --- .env | 1 + README.md | 10 +++++--- docker-compose.yml | 6 ++--- installer.sh => install | 54 +++++++++++++++++++++++++++++++++++------ uninstall | 50 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 108 insertions(+), 13 deletions(-) rename installer.sh => install (86%) create mode 100755 uninstall diff --git a/.env b/.env index d16eafa..742db05 100644 --- a/.env +++ b/.env @@ -9,6 +9,7 @@ TRAEFIK_HTTP_PORT=80 MONEROD_TAG=latest MONEROD_RPC_PORT=18089 MONEROD_P2P_PORT=18080 +MONEROD_EXTRA_PARAMS=--prune-blockchain MONEROD_accessControlAllowOriginList=* #TOR_TAG=latest diff --git a/README.md b/README.md index cd66a0d..f86bd65 100644 --- a/README.md +++ b/README.md @@ -13,10 +13,14 @@ Tested on: - [x] Add wizard for DNS domain selection. - [x] Status and node info at finish. -- [ ] Stagenet / Testnet selection +- [ ] Mainnet / Stagenet / Testnet selection +- [ ] Pruning option - [ ] Clearnet TLS port selection +- [ ] Uninstall script +- [ ] Documentation - [x] Make tor service optional - [x] (Optional) block explorer -- [ ] Grafana with stats -- [ ] arm64 support +- [ ] Grafana dashboard +- [ ] arm64 support for all images. +- [ ] monerod-lws support. - [ ] monerod-proxy support for fallback nodes. diff --git a/docker-compose.yml b/docker-compose.yml index afd954a..c36c612 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -26,12 +26,12 @@ x-traefik-command-nole: &traefik-command-nole - "--entrypoints.web.http.redirections.entrypoint.permanent=true" - "--entrypoints.websecure.address=:${TRAEFIK_TLS_PORT}" -x-monerod-mainnet-command: &monerod-mainnet-command +x-monerod-command: &monerod-command command: >- --restricted-rpc --public-node --no-igd --no-zmq --enable-dns-blocklist --rpc-restricted-bind-ip=0.0.0.0 --rpc-restricted-bind-port=${MONEROD_RPC_PORT} --confirm-external-bind - --prune-blockchain + ${MONEROD_EXTRA_PARAMS} x-tor-service: &tor-service tor: @@ -92,7 +92,7 @@ services: monerod: container_name: monerod image: sethsimmons/simple-monerod:${MONEROD_TAG} - <<: *monerod-mainnet-command #!monerod-command + <<: *monerod-command ports: - "${MONEROD_P2P_PORT}:${MONEROD_P2P_PORT}" # Exposes P2P port - "${MONEROD_RPC_PORT}" diff --git a/installer.sh b/install similarity index 86% rename from installer.sh rename to install index 6301be0..a38e2f2 100755 --- a/installer.sh +++ b/install @@ -48,9 +48,10 @@ DOCKER_COMPOSE_INSTALLED=false DOCKER_COMPOSE_VERSION="v2.5.0" DEPENDENCIES="git curl" ONION="Not Available" -TLS_PORT="443" +TLS_PORT="" TLS_DOMAIN="" TLS_EMAIL="" +NETWORK="mainnet" ################################################################ # Functions # @@ -165,12 +166,36 @@ install_xmrsh() { pushd "${XMRSH_DIR}" >>"${XMRSH_LOG_FILE}" 2>&1 || return else echo -e "${Ok}" - echo -e "${WarnBullet}Warning: xmr.sh already present in ${XMRSH_DIR}" #FIXME: This should probably exit + echo -e "${WarnBullet}Warning: xmr.sh already present in ${XMRSH_DIR}" #FIXME: This should exit, when uninstall script ready return fi echo -e "${Ok}" } +configure_network() { + echo -e "${OkBullet}Select the desired node network (mainnet, testnet, stagenet)" + PS3=":: Enter a number: " + options=("mainnet" "testnet" "stagenet") + select opt in "${options[@]}"; do + case $opt in + "mainnet") + break + ;; + "testnet") + NETWORK="testnet" + sed -i "s/MONEROD_P2P_PORT=.*/MONEROD_P2P_PORT=28080/g" .env + sed -i "'/MONEROD_EXTRA_PARAMS/s/$/ --testnet/g' docker-compose.yml" .env + ;; + "stagenet") + NETWORK="stagenet" + sed -i "s/MONEROD_P2P_PORT=.*/MONEROD_P2P_PORT=38080/g" .env + sed -i "'/MONEROD_EXTRA_PARAMS/s/$/ --stagenet/g' docker-compose.yml" .env + ;; + *) echo "Invalid network choice!" ;; + esac + done +} + configure_tls_domain() { echo -e "${OkBullet}Enter the desired domain for the Let's Encrypt SSL certificate." read -r -e -p " Leave empty to use a self signed certificate []: " TLS_DOMAIN @@ -195,10 +220,23 @@ configure_tls_domain() { fi } +configure_tls_port() { + echo -e "${OkBullet}Enter the desired TLS/HTTPS port." + read -r -e -p " Leave empty to use the default [443]: " TLS_PORT + if [ -n "${TLS_PORT}" ]; then + while ! echo "${TLS_PORT}" | grep -qP '^([1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$'; do + echo -e "${WarnBullet}Port not valid." + read -r -p " Enter again your desired port: " TLS_PORT + done + # Set port in vars + sed -i "s/TRAEFIK_TLS_PORT=.*/TRAEFIK_TLS_PORT=${TLS_PORT}/g" .env + fi +} + configure_cors() { echo -e "${OkBullet}Configuring CORS..." while true; do - read -r -e -p " Do you want to enabe CORS headers so the node can be used in webapps? [y/n]: " yn + read -r -e -p " Do you want to enabe CORS headers so the node can be used in web apps? [y/n]: " yn case $yn in [Yy]*) sed -i '/#!cors/s/# //g' docker-compose.yml @@ -263,10 +301,6 @@ configure_watchtower() { # PUBLIC_IP=$(curl -s ifconfig.co) # } -validate_domain() { - echo "$1" | grep -P '(?=^.{5,254}$)(^(?:(?!\d+\.)[a-zA-Z0-9_\-]{1,63}\.?)+(?:[a-zA-Z]{2,})$)' -} - start_xmrsh() { echo -ne "${OkBullet}Starting monero node and services... ${Off}" docker-compose pull >>"${XMRSH_LOG_FILE}" 2>&1 @@ -331,11 +365,17 @@ if [ $DOCKER_INSTALLED = true ] && [ $DOCKER_COMPOSE_INSTALLED = false ]; then fi install_xmrsh +configure_network configure_tls_domain +configure_tls_port +# configure_pruning configure_cors + configure_tor configure_explorer configure_watchtower +# configure_monitor +# configure_lws start_xmrsh completed diff --git a/uninstall b/uninstall new file mode 100755 index 0000000..4c36eff --- /dev/null +++ b/uninstall @@ -0,0 +1,50 @@ +#!/bin/bash + +################################################################ +# Color Aliases # +################################################################ +# Reset +Off='\033[0m' # Text Reset + +# Regular Colors +Black='\033[0;30m' # Black +Red='\033[0;31m' # Red +Green='\033[0;32m' # Green +Yellow='\033[0;33m' # Yellow +Blue='\033[0;34m' # Blue +Purple='\033[0;35m' # Purple +Cyan='\033[0;36m' # Cyan +White='\033[0;37m' # White + +# Background +On_Black='\033[40m' # Black +On_Red='\033[41m' # Red +On_Green='\033[42m' # Green +On_Yellow='\033[43m' # Yellow +On_Blue='\033[44m' # Blue +On_Purple='\033[45m' # Purple +On_Cyan='\033[46m' # Cyan +On_White='\033[47m' # White + +OkBullet="${Green}${On_Black}:: ${White}${On_Black}" +WarnBullet="${Yellow}${On_Black}:: ${White}${On_Black}" +ErrBullet="${Red}${On_Black}:: ${White}${On_Black}" +Ok="${Green}${On_Black} ok.${Off}" +Fail="${Red}${On_Black} failed!${Off}" +Nok="${Yellow}${On_Black} nok.${Off}" +Stat="${Purple}${On_Black}" +StatInfo="${White}${On_Black}" + +################################################################ +# Vars # +################################################################ + +XMRSH_DIR="/opt/xmr.sh" + +################################################################ +# Functions # +################################################################ + +# TBD + +exit 0 From 1d641da19b9ef7d3baf8158f4eb934e98ef87570 Mon Sep 17 00:00:00 2001 From: vdo Date: Tue, 31 May 2022 12:30:45 +0100 Subject: [PATCH 12/46] Add network output --- install | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/install b/install index a38e2f2..645e820 100755 --- a/install +++ b/install @@ -184,12 +184,14 @@ configure_network() { "testnet") NETWORK="testnet" sed -i "s/MONEROD_P2P_PORT=.*/MONEROD_P2P_PORT=28080/g" .env - sed -i "'/MONEROD_EXTRA_PARAMS/s/$/ --testnet/g' docker-compose.yml" .env + sed -i "/MONEROD_EXTRA_PARAMS/s/$/ --testnet/g" .env + break ;; "stagenet") NETWORK="stagenet" sed -i "s/MONEROD_P2P_PORT=.*/MONEROD_P2P_PORT=38080/g" .env - sed -i "'/MONEROD_EXTRA_PARAMS/s/$/ --stagenet/g' docker-compose.yml" .env + sed -i "/MONEROD_EXTRA_PARAMS/s/$/ --stagenet/g" .env + break ;; *) echo "Invalid network choice!" ;; esac @@ -307,7 +309,7 @@ start_xmrsh() { check_return $? docker-compose up -d >>"${XMRSH_LOG_FILE}" 2>&1 check_return $? - if [ $ENABLE_TOR = true ]; then + if [[ $ENABLE_TOR == true ]]; then sleep 3 ONION=$(docker logs tor 2>&1 | grep Entrypoint | cut -d " " -f 8) fi @@ -337,6 +339,7 @@ completed() { fi echo echo -e " ${Red}┌───────────────────────────────────────────────────────────────────────────[info]──" + echo -e " ${Red}│${Stat} Network: ${StatInfo}${NETWORK}" echo -e " ${Red}│${Stat} URL: ${StatInfo}https://${HOST}${PORT_SUFF}" if [ "$ENABLE_EXPLORER" = true ]; then echo -e " ${Red}│${Stat} Explorer URL: ${StatInfo}https://${HOST}${PORT_SUFF}/explorer" From 720974857d494c26903533fa012fc80e961a0904 Mon Sep 17 00:00:00 2001 From: vdo Date: Tue, 31 May 2022 14:12:44 +0100 Subject: [PATCH 13/46] add grafana labels --- .env | 4 + README.md | 6 +- config/grafana/dashboards/monero.json | 5426 +++++++++++++++++ config/grafana/grafana.ini | 29 + .../grafana/provisioning/dashboards/all.yaml | 12 + .../grafana/provisioning/datasources/all.yaml | 12 + config/prometheus/Dockerfile | 29 + config/prometheus/config.yaml | 8 + docker-compose.yml | 51 + 9 files changed, 5574 insertions(+), 3 deletions(-) create mode 100644 config/grafana/dashboards/monero.json create mode 100644 config/grafana/grafana.ini create mode 100644 config/grafana/provisioning/dashboards/all.yaml create mode 100644 config/grafana/provisioning/datasources/all.yaml create mode 100644 config/prometheus/Dockerfile create mode 100644 config/prometheus/config.yaml diff --git a/.env b/.env index 742db05..b78d5fd 100644 --- a/.env +++ b/.env @@ -18,3 +18,7 @@ TOR_HTTP_PORT=80 EXPLORER_TAG=v0.17 EXPLORER_PORT=8081 + +GRAFANA_TAG=7.3.10 + +PROMETHEUS_TAG=v2.22.2 diff --git a/README.md b/README.md index f86bd65..b632d9c 100644 --- a/README.md +++ b/README.md @@ -13,9 +13,9 @@ Tested on: - [x] Add wizard for DNS domain selection. - [x] Status and node info at finish. -- [ ] Mainnet / Stagenet / Testnet selection +- [x] Mainnet / Stagenet / Testnet selection - [ ] Pruning option -- [ ] Clearnet TLS port selection +- [x] Clearnet TLS port selection - [ ] Uninstall script - [ ] Documentation - [x] Make tor service optional @@ -23,4 +23,4 @@ Tested on: - [ ] Grafana dashboard - [ ] arm64 support for all images. - [ ] monerod-lws support. -- [ ] monerod-proxy support for fallback nodes. +- [ ] monerod-proxy support. diff --git a/config/grafana/dashboards/monero.json b/config/grafana/dashboards/monero.json new file mode 100644 index 0000000..9ea24af --- /dev/null +++ b/config/grafana/dashboards/monero.json @@ -0,0 +1,5426 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "description": "", + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": 1, + "iteration": 1628030532187, + "links": [], + "panels": [ + { + "datasource": null, + "description": "Whether the node is running against mainnet or not.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "0": { + "index": 1, + "text": "no" + }, + "1": { + "index": 0, + "text": "yes" + } + }, + "type": "value" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 2, + "w": 3, + "x": 0, + "y": 0 + }, + "id": 68, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "8.0.6", + "targets": [ + { + "exemplar": true, + "expr": "monero_info_mainnet", + "instant": true, + "interval": "", + "legendFormat": "mainnet", + "refId": "A" + } + ], + "title": "Main network", + "transparent": true, + "type": "stat" + }, + { + "datasource": null, + "description": "Whether the node is fully in sync with the network or not.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "0": { + "index": 1, + "text": "no" + }, + "1": { + "index": 0, + "text": "yes" + } + }, + "type": "value" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 2, + "w": 3, + "x": 3, + "y": 0 + }, + "id": 69, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "text": {}, + "textMode": "auto" + }, + "pluginVersion": "8.0.6", + "targets": [ + { + "exemplar": true, + "expr": "monero_info_synchronized", + "instant": true, + "interval": "", + "legendFormat": "mainnet", + "refId": "A" + } + ], + "title": "Synchronized", + "transparent": true, + "type": "stat" + }, + { + "collapsed": true, + "datasource": null, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 2 + }, + "id": 62, + "panels": [ + { + "datasource": null, + "description": "Current chain's block height vs node's current height. When syncing, let's one quickly tell how far the node is from being synchronized with the network.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "stepBefore", + "lineWidth": 1, + "pointSize": 6, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 0, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 3 + }, + "id": 71, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "monero_info_height", + "interval": "", + "legendFormat": "height", + "refId": "A" + }, + { + "exemplar": true, + "expr": "monero_info_target_height", + "hide": false, + "interval": "", + "legendFormat": "target", + "refId": "B" + } + ], + "title": "Height and Target", + "transparent": true, + "type": "timeseries" + }, + { + "datasource": null, + "description": "Maximum hard limit for block size scaling, as well as median used for scaling factor", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "axisSoftMin": 0, + "barAlignment": -1, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "stepBefore", + "lineWidth": 1, + "pointSize": 6, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 0, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "decbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 3 + }, + "id": 65, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "monero_info_block_size_limit_bytes", + "interval": "", + "legendFormat": "limit", + "refId": "A" + }, + { + "exemplar": true, + "expr": "monero_info_block_size_median_bytes", + "hide": false, + "interval": "", + "legendFormat": "median", + "refId": "B" + } + ], + "title": "Block size median and limit", + "transparent": true, + "type": "timeseries" + }, + { + "datasource": null, + "description": "For how long this node has been up.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "stepBefore", + "lineWidth": 1, + "pointSize": 6, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "dtdhms" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 16, + "y": 3 + }, + "id": 66, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "monero_info_uptime_seconds_total", + "interval": "", + "legendFormat": "limit", + "refId": "A" + } + ], + "title": "Uptime", + "transparent": true, + "type": "timeseries" + }, + { + "datasource": null, + "description": "Number of blocks alternative to the longest chain", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "axisSoftMin": 0, + "barAlignment": -1, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "stepBefore", + "lineWidth": 1, + "pointSize": 6, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 0, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 10 + }, + "id": 64, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "monero_info_alternative_blocks", + "interval": "", + "legendFormat": "alternative blocks", + "refId": "A" + } + ], + "title": "Alternative blocks", + "transparent": true, + "type": "timeseries" + }, + { + "datasource": null, + "description": "Amount of free space in the partition where the Monero database is located at.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "stepBefore", + "lineWidth": 1, + "pointSize": 6, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 3, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "decbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 10 + }, + "id": 74, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "monero_info_free_space_bytes", + "interval": "", + "legendFormat": "free space", + "refId": "A" + } + ], + "title": "Free space", + "transparent": true, + "type": "timeseries" + }, + { + "datasource": null, + "description": "Size of Monero's database on disk.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "stepBefore", + "lineWidth": 1, + "pointSize": 6, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 3, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "decbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 16, + "y": 10 + }, + "id": 75, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "monero_info_database_size_bytes", + "interval": "", + "legendFormat": "size", + "refId": "A" + } + ], + "title": "Database Size", + "transparent": true, + "type": "timeseries" + } + ], + "title": "Overall", + "type": "row" + }, + { + "collapsed": true, + "datasource": null, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 3 + }, + "id": 44, + "panels": [ + { + "datasource": null, + "description": "The distribution of how long ago peers in the whitelist have been seen.\n", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "points", + "fillOpacity": 26, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "1" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-purple", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.99" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.95" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-green", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.9" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-yellow", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.75" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-orange", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.5" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.25" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "light-red", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 4 + }, + "id": 55, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "monero_peerlist_lastseen{quantile=~\"$quantile\"}", + "interval": "", + "legendFormat": "{{ quantile }}", + "refId": "A" + } + ], + "title": "White Peerlist last seen distribution", + "transparent": true, + "type": "timeseries" + }, + { + "datasource": null, + "description": "Number of peers in each peer list.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "stepBefore", + "lineWidth": 1, + "pointSize": 6, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 4 + }, + "id": 57, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "monero_peerlist", + "interval": "", + "legendFormat": "{{ type }}", + "refId": "A" + } + ], + "title": "Peerlists' count", + "transparent": true, + "type": "timeseries" + }, + { + "datasource": null, + "description": "Rate of data transmission in and out from this node (p2p and rpc).", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "stepBefore", + "lineWidth": 1, + "pointSize": 6, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "Bps" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 16, + "y": 4 + }, + "id": 58, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "rate(monero_net_rx_bytes[1m])", + "interval": "", + "legendFormat": "rx", + "refId": "A" + }, + { + "exemplar": true, + "expr": "rate(monero_net_tx_bytes[1m])", + "hide": false, + "interval": "", + "legendFormat": "tx", + "refId": "B" + } + ], + "title": "Data rate", + "transparent": true, + "type": "timeseries" + }, + { + "datasource": null, + "description": "Number of connections based on their direction (incoming/outgoing)", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "stepBefore", + "lineWidth": 1, + "pointSize": 6, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 11 + }, + "id": 46, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "sum(monero_p2p_connections) by (type)", + "interval": "", + "legendFormat": "{{ type }}", + "refId": "A" + } + ], + "title": "Connections by direction (in/out)", + "transparent": true, + "type": "timeseries" + }, + { + "datasource": null, + "description": "Number of connections based on their connection state.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "stepBefore", + "lineWidth": 1, + "pointSize": 6, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 11 + }, + "id": 47, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "sum(monero_p2p_connections) by (state)", + "interval": "", + "legendFormat": "{{ type }}", + "refId": "A" + } + ], + "title": "Connections by connection state", + "transparent": true, + "type": "timeseries" + }, + { + "datasource": null, + "description": "Total amount of data sent and received by this node.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "stepBefore", + "lineWidth": 1, + "pointSize": 6, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "decbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 16, + "y": 11 + }, + "id": 59, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "monero_net_rx_bytes", + "interval": "", + "legendFormat": "rx", + "refId": "A" + }, + { + "exemplar": true, + "expr": "monero_net_tx_bytes", + "hide": false, + "interval": "", + "legendFormat": "tx", + "refId": "B" + } + ], + "title": "Data", + "transparent": true, + "type": "timeseries" + }, + { + "datasource": null, + "description": "The distribution of data retrieval from our connected peers.\n", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "points", + "fillOpacity": 26, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "Bps" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "1" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-purple", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.99" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.95" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-green", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.9" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-yellow", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.75" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-orange", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.5" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.25" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "light-red", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 18 + }, + "id": 50, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "monero_p2p_connections_rx_rate_bps{quantile=~\"$quantile\"}", + "interval": "", + "legendFormat": "{{ quantile }}", + "refId": "A" + } + ], + "title": "P2P Peers Data Receive Rate", + "transparent": true, + "type": "timeseries" + }, + { + "datasource": null, + "description": "The distribution of data transmission to our connected peers.\n", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "points", + "fillOpacity": 26, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "Bps" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "1" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-purple", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.99" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.95" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-green", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.9" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-yellow", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.75" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-orange", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.5" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.25" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "light-red", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 18 + }, + "id": 60, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "monero_p2p_connections_tx_rate_bps{quantile=~\"$quantile\"}", + "interval": "", + "legendFormat": "{{ quantile }}", + "refId": "A" + } + ], + "title": "P2P Peers Data Transmission Rate", + "transparent": true, + "type": "timeseries" + }, + { + "datasource": null, + "description": "The distribution of the heights of our peers\n", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "points", + "fillOpacity": 26, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "1" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-purple", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.99" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.95" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-green", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.9" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-yellow", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.75" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-orange", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.5" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.25" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "light-red", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 16, + "y": 18 + }, + "id": 49, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "monero_p2p_connections_height{quantile=~\"$quantile\"}", + "interval": "", + "legendFormat": "{{ quantile }}", + "refId": "A" + } + ], + "title": "Connected Peers' Height", + "transparent": true, + "type": "timeseries" + }, + { + "datasource": null, + "description": "The distribution of the age of the connections established to/from our nodes.\n", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "points", + "fillOpacity": 26, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "1" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-purple", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.99" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.95" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-green", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.9" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-yellow", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.75" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-orange", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.5" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.25" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "light-red", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 25 + }, + "id": 51, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "monero_p2p_connections_age{quantile=~\"$quantile\"}", + "interval": "", + "legendFormat": "{{ quantile }}", + "refId": "A" + } + ], + "title": "Connections' Age", + "transparent": true, + "type": "timeseries" + } + ], + "title": "Networking", + "type": "row" + }, + { + "collapsed": true, + "datasource": null, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 4 + }, + "id": 38, + "panels": [ + { + "datasource": null, + "description": "Average number of RPC requests served over the past minute.\n\nps.: this includes the calls made by the stats collector too.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "stepBefore", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 6, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 5 + }, + "id": 40, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "increase(monero_rpc_hits_total[1m])", + "interval": "", + "legendFormat": "{{method}}", + "refId": "A" + } + ], + "title": "RPC hits per minute", + "transparent": true, + "type": "timeseries" + }, + { + "datasource": null, + "description": "Average amount of time spent serving RPC methods over that past minute.\n\nps.: this includes the calls made by the stats collector too.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "stepBefore", + "lineWidth": 1, + "pointSize": 6, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 5 + }, + "id": 42, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "rate(monero_rpc_seconds_total[1m])", + "interval": "", + "legendFormat": "{{method}}", + "refId": "A" + } + ], + "title": "Time spent serving RPC methods", + "transparent": true, + "type": "timeseries" + }, + { + "datasource": null, + "description": "Number of RPC connections being served.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "axisSoftMin": 0, + "barAlignment": -1, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "stepBefore", + "lineWidth": 1, + "pointSize": 6, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 0, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 13 + }, + "id": 73, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "monero_info_rpc_connections", + "interval": "", + "legendFormat": "connections", + "refId": "A" + } + ], + "title": "RPC Connections", + "transparent": true, + "type": "timeseries" + } + ], + "title": "RPC", + "type": "row" + }, + { + "collapsed": true, + "datasource": null, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 5 + }, + "id": 16, + "panels": [ + { + "datasource": null, + "description": "Total number of key images spent across all transactions that are still in the pool", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "stepBefore", + "lineWidth": 1, + "pointSize": 6, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 6 + }, + "id": 21, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "monero_transaction_pool_spent_key_images", + "interval": "", + "legendFormat": "spent key images", + "refId": "A" + } + ], + "title": "Spent Key Images", + "transparent": true, + "type": "timeseries" + }, + { + "datasource": null, + "description": "Total size of the block", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "stepBefore", + "lineWidth": 1, + "pointSize": 6, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "decbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 6 + }, + "id": 23, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "monero_transaction_pool_size_bytes", + "interval": "", + "legendFormat": "size", + "refId": "A" + } + ], + "title": "Size", + "transparent": true, + "type": "timeseries" + }, + { + "datasource": null, + "description": "Number of transactions in the transaction pool.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "stepBefore", + "lineWidth": 1, + "pointSize": 6, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 16, + "y": 6 + }, + "id": 18, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "monero_transaction_pool_transactions", + "interval": "", + "legendFormat": "fee", + "refId": "A" + } + ], + "title": "Transactions", + "transparent": true, + "type": "timeseries" + }, + { + "datasource": null, + "description": "The distribution of the sizes of the transactions in the pool.\n", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "points", + "fillOpacity": 26, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "decbytes" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "1" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-purple", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.99" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.95" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-green", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.9" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-yellow", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.75" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-orange", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.5" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.25" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "light-red", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 13 + }, + "id": 26, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "monero_transaction_pool_transactions_size_bytes{quantile=~\"$quantile\"}", + "interval": "", + "legendFormat": "{{ quantile }}", + "refId": "A" + } + ], + "title": "Transaction Size", + "transparent": true, + "type": "timeseries" + }, + { + "datasource": null, + "description": "The distribution fees (in micronero) per kB for the transactions still in the transaction pool.\n", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "points", + "fillOpacity": 26, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "µɱ" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "1" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-purple", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.99" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.95" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-green", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.9" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-yellow", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.75" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-orange", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.5" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.25" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "light-red", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 13 + }, + "id": 20, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "monero_transaction_pool_fees_micronero_per_kb{quantile=~\"$quantile\"}", + "interval": "", + "legendFormat": "{{ quantile }}", + "refId": "A" + } + ], + "title": "Transaction Fees Distribution (per kB)", + "transparent": true, + "type": "timeseries" + }, + { + "datasource": null, + "description": "Total amount of fees (in Monero) for the transactions in the transaction pool.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "stepBefore", + "lineWidth": 1, + "pointSize": 6, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ɱ" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 16, + "y": 13 + }, + "id": 24, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "monero_transaction_pool_fees_monero", + "interval": "", + "legendFormat": "fee", + "refId": "A" + } + ], + "title": "Fees", + "transparent": true, + "type": "timeseries" + }, + { + "datasource": null, + "description": "The distribution of the amount of inputs used in transactions still in the transaction pool. \n", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "points", + "fillOpacity": 26, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "1" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-purple", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.99" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.95" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-green", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.9" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-yellow", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.75" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-orange", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.5" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.25" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "light-red", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 20 + }, + "id": 28, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "monero_transaction_pool_transactions_inputs{quantile=~\"$quantile\"}", + "interval": "", + "legendFormat": "{{ quantile }}", + "refId": "A" + } + ], + "title": "Transaction Inputs", + "transparent": true, + "type": "timeseries" + }, + { + "datasource": null, + "description": "The distribution of the amount of outputs used in transactions still in the transaction pool. \n", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "points", + "fillOpacity": 26, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "1" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-purple", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.99" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.95" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-green", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.9" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-yellow", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.75" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-orange", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.5" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.25" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "light-red", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 20 + }, + "id": 29, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "monero_transaction_pool_transactions_outputs{quantile=~\"$quantile\"}", + "interval": "", + "legendFormat": "{{ quantile }}", + "refId": "A" + } + ], + "title": "Transaction Outputs", + "transparent": true, + "type": "timeseries" + }, + { + "datasource": null, + "description": "Total number of inputs and outputs from the transactions still in the pool.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "stepBefore", + "lineWidth": 1, + "pointSize": 6, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 16, + "y": 20 + }, + "id": 31, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "monero_transaction_pool_transactions_inputs_sum", + "interval": "", + "legendFormat": "inputs", + "refId": "A" + }, + { + "exemplar": true, + "expr": "monero_transaction_pool_transactions_outputs_sum", + "hide": false, + "interval": "", + "legendFormat": "outputs", + "refId": "B" + } + ], + "title": "Inputs and Outputs", + "transparent": true, + "type": "timeseries" + }, + { + "datasource": null, + "description": "A couple of statistics that reveals weird scenarios found in the transaction pool.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "stepBefore", + "lineWidth": 1, + "pointSize": 6, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 27 + }, + "id": 32, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "monero_transaction_pool_double_spends", + "interval": "", + "legendFormat": "double spends", + "refId": "A" + }, + { + "exemplar": true, + "expr": "monero_transaction_pool_older_than_10m", + "hide": false, + "interval": "", + "legendFormat": "older than 10m", + "refId": "B" + }, + { + "exemplar": true, + "expr": "monero_transaction_pool_failing_transactions", + "hide": false, + "interval": "", + "legendFormat": "failing transactions", + "refId": "C" + }, + { + "exemplar": true, + "expr": "monero_transaction_pool_not_relayed", + "hide": false, + "interval": "", + "legendFormat": "not relayed", + "refId": "D" + } + ], + "title": "Weird cases", + "transparent": true, + "type": "timeseries" + }, + { + "datasource": null, + "description": "Distribution of for how long transactions have been sitting in the pool.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "points", + "fillOpacity": 26, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "1" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-purple", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.99" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.95" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-green", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.9" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-yellow", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.75" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-orange", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.5" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.25" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "light-red", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 27 + }, + "id": 34, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "monero_transaction_pool_transactions_age{quantile=~\"$quantile\"}", + "interval": "", + "legendFormat": "{{ quantile }}", + "refId": "A" + } + ], + "title": "Transaction Age", + "transparent": true, + "type": "timeseries" + } + ], + "title": "Transaction Pool", + "type": "row" + }, + { + "collapsed": true, + "datasource": null, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 6 + }, + "id": 2, + "panels": [ + { + "datasource": null, + "description": "Height of the last block in the chain.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "stepBefore", + "lineWidth": 1, + "pointSize": 6, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 7 + }, + "id": 36, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "monero_lastblock_height", + "interval": "", + "legendFormat": "transactions", + "refId": "A" + } + ], + "title": "Height", + "transparent": true, + "type": "timeseries" + }, + { + "datasource": null, + "description": "Total amount of fees (in Monero) included in the last block.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "stepBefore", + "lineWidth": 1, + "pointSize": 6, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ɱ" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 7 + }, + "id": 4, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "monero_lastblock_fees_monero", + "interval": "", + "legendFormat": "fee", + "refId": "A" + } + ], + "title": "Fees", + "transparent": true, + "type": "timeseries" + }, + { + "datasource": null, + "description": "Newly amount of Monero created in this block as a miner subsidy. ", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "stepBefore", + "lineWidth": 1, + "pointSize": 6, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 6, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ɱ" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 16, + "y": 7 + }, + "id": 7, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "monero_lastblock_subsidy_monero", + "interval": "", + "legendFormat": "block subsidy", + "refId": "A" + } + ], + "title": "Subsidy", + "transparent": true, + "type": "timeseries" + }, + { + "datasource": null, + "description": "The distribution fees (in micronero) per kB for the transactions included in the block seen as last at the time.\n", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "points", + "fillOpacity": 26, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "µɱ" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "1" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-purple", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.99" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.95" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-green", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.9" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-yellow", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.75" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-orange", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.5" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.25" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "light-red", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 14 + }, + "id": 5, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "monero_lastblock_fees_micronero_per_kb{quantile=~\"$quantile\"}", + "interval": "", + "legendFormat": "{{ quantile }}", + "refId": "A" + } + ], + "title": "Transaction Fees Distribution (per kB)", + "transparent": true, + "type": "timeseries" + }, + { + "datasource": null, + "description": "Total block rewards granted to the miner of this block (transaction fees + block subsidy).", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "stepBefore", + "lineWidth": 1, + "pointSize": 6, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ɱ" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 14 + }, + "id": 6, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "monero_lastblock_reward_monero", + "interval": "", + "legendFormat": "total rewards", + "refId": "A" + } + ], + "title": "Rewards", + "transparent": true, + "type": "timeseries" + }, + { + "datasource": null, + "description": "Total size of the block", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "stepBefore", + "lineWidth": 1, + "pointSize": 6, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "decbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 16, + "y": 14 + }, + "id": 11, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "monero_lastblock_size_bytes", + "interval": "", + "legendFormat": "size", + "refId": "A" + } + ], + "title": "Size", + "transparent": true, + "type": "timeseries" + }, + { + "datasource": null, + "description": "Number of transactions included in the block", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "stepBefore", + "lineWidth": 1, + "pointSize": 6, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 21 + }, + "id": 10, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "monero_lastblock_transactions", + "interval": "", + "legendFormat": "transactions", + "refId": "A" + } + ], + "title": "Transactions", + "transparent": true, + "type": "timeseries" + }, + { + "datasource": null, + "description": "Number of transactions included in the block", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "stepBefore", + "lineWidth": 1, + "pointSize": 6, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 21 + }, + "id": 14, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "monero_lastblock_transactions_inputs_sum", + "interval": "", + "legendFormat": "inputs", + "refId": "A" + }, + { + "exemplar": true, + "expr": "monero_lastblock_transactions_outputs_sum", + "hide": false, + "interval": "", + "legendFormat": "outputs", + "refId": "B" + } + ], + "title": "Inputs and Outputs", + "transparent": true, + "type": "timeseries" + }, + { + "datasource": null, + "description": "The distribution of sizes of the transactions included in this block.\n", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "points", + "fillOpacity": 26, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "decbytes" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "1" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-purple", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.99" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.95" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-green", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.9" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-yellow", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.75" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-orange", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.5" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.25" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "light-red", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 16, + "y": 21 + }, + "id": 13, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "monero_lastblock_transactions_size_bytes{quantile=~\"$quantile\"}", + "interval": "", + "legendFormat": "{{ quantile }}", + "refId": "A" + } + ], + "title": "Transaction Size Distribution", + "transparent": true, + "type": "timeseries" + }, + { + "datasource": null, + "description": "The distribution of the amount of inputs used in transactions included in this block. \n", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "points", + "fillOpacity": 26, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "1" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-purple", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.99" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.95" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-green", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.9" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-yellow", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.75" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-orange", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.5" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.25" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "light-red", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 0, + "y": 28 + }, + "id": 8, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "monero_lastblock_transactions_inputs{quantile=~\"$quantile\"}", + "interval": "", + "legendFormat": "{{ quantile }}", + "refId": "A" + } + ], + "title": "Transaction Inputs", + "transparent": true, + "type": "timeseries" + }, + { + "datasource": null, + "description": "The distribution of the amount of outputs used in transactions included in this block. \n", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "points", + "fillOpacity": 26, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "1" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-purple", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.99" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-blue", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.95" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-green", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.9" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-yellow", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.75" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-orange", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.5" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "dark-red", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "0.25" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "light-red", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 8, + "y": 28 + }, + "id": 9, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "monero_lastblock_transactions_outputs{quantile=~\"$quantile\"}", + "interval": "", + "legendFormat": "{{ quantile }}", + "refId": "A" + } + ], + "title": "Transaction Outputs", + "transparent": true, + "type": "timeseries" + }, + { + "datasource": null, + "description": "Difficulty used for mining the last block", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": -1, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "stepBefore", + "lineWidth": 1, + "pointSize": 6, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "sci" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 8, + "x": 16, + "y": 28 + }, + "id": 12, + "options": { + "legend": { + "calcs": [], + "displayMode": "hidden", + "placement": "bottom" + }, + "tooltip": { + "mode": "multi" + } + }, + "targets": [ + { + "exemplar": true, + "expr": "monero_lastblock_difficulty", + "interval": "", + "legendFormat": "size", + "refId": "A" + } + ], + "title": "Difficulty", + "transparent": true, + "type": "timeseries" + } + ], + "title": "Last Block", + "type": "row" + } + ], + "refresh": "1m", + "schemaVersion": 30, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "allValue": null, + "current": { + "selected": true, + "text": [ + "0.05", + "0.25", + "0.5", + "0.75", + "0.95", + "1" + ], + "value": [ + "0.05", + "0.25", + "0.5", + "0.75", + "0.95", + "1" + ] + }, + "datasource": null, + "definition": "label_values(monero_lastblock_transactions_inputs,quantile)", + "description": "quantile to filter for in the panels that use distributions", + "error": null, + "hide": 0, + "includeAll": true, + "label": "quantile", + "multi": true, + "name": "quantile", + "options": [], + "query": { + "query": "label_values(monero_lastblock_transactions_inputs,quantile)", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "type": "query" + } + ] + }, + "time": { + "from": "now-3h", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ] + }, + "timezone": "", + "title": "Monero", + "uid": "K9dtfZG7z", + "version": 1 +} diff --git a/config/grafana/grafana.ini b/config/grafana/grafana.ini new file mode 100644 index 0000000..c1c31f9 --- /dev/null +++ b/config/grafana/grafana.ini @@ -0,0 +1,29 @@ +[analytics] +reporting_enabled = false +check_for_updates = false + + +[auth] +disable_login_form = true + + +[auth.anonymous] +enabled = true +org_role = Admin + + +[dashboards] +min_refresh_interval = 1m + + +[paths] +provisioning = /etc/grafana/provisioning + + +[server] +enable_gzip = true +read_timeout = 2m + + +[snapshots] +external_enabled = false diff --git a/config/grafana/provisioning/dashboards/all.yaml b/config/grafana/provisioning/dashboards/all.yaml new file mode 100644 index 0000000..5a31c91 --- /dev/null +++ b/config/grafana/provisioning/dashboards/all.yaml @@ -0,0 +1,12 @@ +apiVersion: 1 + +providers: + - name: 'fs' + orgId: 1 + folder: '' + type: 'file' + updateIntervalSeconds: 30 + allowUiUpdates: true + options: + path: '/var/lib/grafana/dashboards' + foldersFromFilesStructure: true diff --git a/config/grafana/provisioning/datasources/all.yaml b/config/grafana/provisioning/datasources/all.yaml new file mode 100644 index 0000000..10d9ced --- /dev/null +++ b/config/grafana/provisioning/datasources/all.yaml @@ -0,0 +1,12 @@ +apiVersion: 1 + +datasources: + - name: prometheus + type: prometheus + access: proxy + orgId: 1 + url: http://prometheus:9090 + isDefault: true + version: 1 + editable: false + timeInterval: 30s diff --git a/config/prometheus/Dockerfile b/config/prometheus/Dockerfile new file mode 100644 index 0000000..99b0e72 --- /dev/null +++ b/config/prometheus/Dockerfile @@ -0,0 +1,29 @@ +ARG BUILDER_IMAGE=index.docker.io/library/ubuntu@sha256:82becede498899ec668628e7cb0ad87b6e1c371cb8a1e597d83a47fac21d6af3 +ARG RUNTIME_IMAGE=gcr.io/distroless/base@sha256:97f9cbf81590c7dd878d7e10c20116fa7488c2fb91b3c839df1ebdcb61ab13ca + + +FROM $BUILDER_IMAGE AS builder + + ARG VERSION=2.28.1 + ARG SHA256=91dd91e13f30fe520e01175ca1027dd09a458d4421a584ba557ba88b38803f27 + + RUN set -ex && \ + apt update && \ + apt install -y curl gzip + + RUN set -ex && \ + curl -SOL https://github.com/prometheus/prometheus/releases/download/v${VERSION}/prometheus-${VERSION}.linux-amd64.tar.gz && \ + echo "${SHA256} prometheus-${VERSION}.linux-amd64.tar.gz" | sha256sum -c && \ + tar xvzf prometheus-${VERSION}.linux-amd64.tar.gz --strip-components=1 && \ + mv ./prometheus /usr/local/bin/prometheus + + RUN mkdir /data + + +FROM $RUNTIME_IMAGE + + COPY --from=builder --chown=nonroot:nonroot /data /data + COPY --from=builder --chown=nonroot:nonroot /usr/local/bin/prometheus /usr/local/bin/prometheus + USER nonroot:nonroot + + ENTRYPOINT [ "prometheus" ] diff --git a/config/prometheus/config.yaml b/config/prometheus/config.yaml new file mode 100644 index 0000000..b387614 --- /dev/null +++ b/config/prometheus/config.yaml @@ -0,0 +1,8 @@ +global: + scrape_interval: '15s' + evaluation_interval: '15s' +scrape_configs: + - job_name: 'monerod' + static_configs: + - targets: + - 'monerod:9000' diff --git a/docker-compose.yml b/docker-compose.yml index c36c612..c508ca8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -67,6 +67,50 @@ x-explorer-service: &explorer-service - "traefik.http.routers.explorer.service=explorer" - "traefik.http.services.explorer.loadbalancer.server.port=${EXPLORER_PORT}" +x-monero-exporter-service: &monero-exporter-service + monero-exporter: + command: + - --monero-addr=http://monerod:${MONEROD_RPC_PORT} + container_name: monero-exporter + image: utxobr/monero-exporter@sha256:737413b1054583535e835e1417b61a8d59a4c08723e4a15c61c4249c2a7d69a4 + network_mode: service:monerod + +x-grafana-service: &grafana-service + grafana: + command: + - -config=/etc/grafana/grafana.ini + container_name: grafana + image: grafana/grafana:${GRAFANA_TAG} + ports: + - 3000 + volumes: + - ./config/grafana/grafana.ini:/etc/grafana/grafana.ini:ro + - ./config/grafana/provisioning:/etc/grafana/provisioning:ro + - ./config/grafana/dashboards:/var/lib/grafana/dashboards:ro + labels: + - "traefik.enable=true" + - "traefik.http.routers.grafana.rule=(PathPrefix(`/grafana`) )" #!nole + # - "traefik.http.routers.grafana.rule=(Host(`${DOMAIN}`) && PathPrefix(`/grafana`) )" #!le + # - "traefik.http.routers.grafana.tls.certresolver=le" #!le + - "traefik.http.middlewares.stripprefix.stripprefix.prefixes=/grafana" + - "traefik.http.routers.grafana.middlewares=stripprefix" + - "traefik.http.routers.grafana.entrypoints=websecure" + - "traefik.http.routers.grafana.tls" + - "traefik.http.routers.grafana.service=grafana" + - "traefik.http.services.grafana.loadbalancer.server.port=3000" + +x-prometheus-service: &prometheus-service + prometheus: + command: + - --config.file=/etc/prometheus/config.yaml + - --storage.tsdb.path=/data + - --storage.tsdb.retention.time=30d + container_name: prometheus + image: prom/prometheus:${PROMETHEUS_TAG} + volumes: + - prometheus-data:/data + - ./config/prometheus/config.yaml:/etc/prometheus/config.yaml:ro + x-watchtower-service: &watchtower-service watchtower: container_name: watchtower @@ -113,7 +157,14 @@ services: # <<: *tor-service #!tor # <<: *explorer-service #!explorer + <<: *monero-exporter-service #!monero-exporter + + <<: *grafana-service #!grafana + + <<: *prometheus-service #!prometheus # <<: *watchtower-service #!watchtower + volumes: monerod-data: {} # tor-keys: {} #!tor + prometheus-data: {} #!prometheus From 9e364559b7dcc961b98b004cd07c513d3666f17e Mon Sep 17 00:00:00 2001 From: vdo Date: Tue, 31 May 2022 16:02:33 +0100 Subject: [PATCH 14/46] fix graphs, grafana compose --- .env | 3 +- config/grafana/dashboards/monero.json | 84 +++++++++++++-------------- config/grafana/grafana.ini | 3 +- docker-compose.yml | 22 ++++--- install | 32 ++++++++-- 5 files changed, 84 insertions(+), 60 deletions(-) diff --git a/.env b/.env index b78d5fd..5cdaf2c 100644 --- a/.env +++ b/.env @@ -7,7 +7,8 @@ TRAEFIK_TLS_PORT=443 TRAEFIK_HTTP_PORT=80 MONEROD_TAG=latest -MONEROD_RPC_PORT=18089 +MONEROD_RPC_PORT=18081 +MONEROD_RESTRICTED_RPC_PORT=18089 MONEROD_P2P_PORT=18080 MONEROD_EXTRA_PARAMS=--prune-blockchain MONEROD_accessControlAllowOriginList=* diff --git a/config/grafana/dashboards/monero.json b/config/grafana/dashboards/monero.json index 9ea24af..0e342e4 100644 --- a/config/grafana/dashboards/monero.json +++ b/config/grafana/dashboards/monero.json @@ -274,7 +274,7 @@ ], "title": "Height and Target", "transparent": true, - "type": "timeseries" + "type": "graph" }, { "datasource": null, @@ -368,7 +368,7 @@ ], "title": "Block size median and limit", "transparent": true, - "type": "timeseries" + "type": "graph" }, { "datasource": null, @@ -452,7 +452,7 @@ ], "title": "Uptime", "transparent": true, - "type": "timeseries" + "type": "graph" }, { "datasource": null, @@ -538,7 +538,7 @@ ], "title": "Alternative blocks", "transparent": true, - "type": "timeseries" + "type": "graph" }, { "datasource": null, @@ -623,7 +623,7 @@ ], "title": "Free space", "transparent": true, - "type": "timeseries" + "type": "graph" }, { "datasource": null, @@ -708,7 +708,7 @@ ], "title": "Database Size", "transparent": true, - "type": "timeseries" + "type": "graph" } ], "title": "Overall", @@ -914,7 +914,7 @@ ], "title": "White Peerlist last seen distribution", "transparent": true, - "type": "timeseries" + "type": "graph" }, { "datasource": null, @@ -998,7 +998,7 @@ ], "title": "Peerlists' count", "transparent": true, - "type": "timeseries" + "type": "graph" }, { "datasource": null, @@ -1090,7 +1090,7 @@ ], "title": "Data rate", "transparent": true, - "type": "timeseries" + "type": "graph" }, { "datasource": null, @@ -1174,7 +1174,7 @@ ], "title": "Connections by direction (in/out)", "transparent": true, - "type": "timeseries" + "type": "graph" }, { "datasource": null, @@ -1258,7 +1258,7 @@ ], "title": "Connections by connection state", "transparent": true, - "type": "timeseries" + "type": "graph" }, { "datasource": null, @@ -1350,7 +1350,7 @@ ], "title": "Data", "transparent": true, - "type": "timeseries" + "type": "graph" }, { "datasource": null, @@ -1541,7 +1541,7 @@ ], "title": "P2P Peers Data Receive Rate", "transparent": true, - "type": "timeseries" + "type": "graph" }, { "datasource": null, @@ -1732,7 +1732,7 @@ ], "title": "P2P Peers Data Transmission Rate", "transparent": true, - "type": "timeseries" + "type": "graph" }, { "datasource": null, @@ -1923,7 +1923,7 @@ ], "title": "Connected Peers' Height", "transparent": true, - "type": "timeseries" + "type": "graph" }, { "datasource": null, @@ -2114,7 +2114,7 @@ ], "title": "Connections' Age", "transparent": true, - "type": "timeseries" + "type": "graph" } ], "title": "Networking", @@ -2216,7 +2216,7 @@ ], "title": "RPC hits per minute", "transparent": true, - "type": "timeseries" + "type": "graph" }, { "datasource": null, @@ -2300,7 +2300,7 @@ ], "title": "Time spent serving RPC methods", "transparent": true, - "type": "timeseries" + "type": "graph" }, { "datasource": null, @@ -2386,7 +2386,7 @@ ], "title": "RPC Connections", "transparent": true, - "type": "timeseries" + "type": "graph" } ], "title": "RPC", @@ -2485,7 +2485,7 @@ ], "title": "Spent Key Images", "transparent": true, - "type": "timeseries" + "type": "graph" }, { "datasource": null, @@ -2569,7 +2569,7 @@ ], "title": "Size", "transparent": true, - "type": "timeseries" + "type": "graph" }, { "datasource": null, @@ -2653,7 +2653,7 @@ ], "title": "Transactions", "transparent": true, - "type": "timeseries" + "type": "graph" }, { "datasource": null, @@ -2844,7 +2844,7 @@ ], "title": "Transaction Size", "transparent": true, - "type": "timeseries" + "type": "graph" }, { "datasource": null, @@ -3035,7 +3035,7 @@ ], "title": "Transaction Fees Distribution (per kB)", "transparent": true, - "type": "timeseries" + "type": "graph" }, { "datasource": null, @@ -3119,7 +3119,7 @@ ], "title": "Fees", "transparent": true, - "type": "timeseries" + "type": "graph" }, { "datasource": null, @@ -3309,7 +3309,7 @@ ], "title": "Transaction Inputs", "transparent": true, - "type": "timeseries" + "type": "graph" }, { "datasource": null, @@ -3499,7 +3499,7 @@ ], "title": "Transaction Outputs", "transparent": true, - "type": "timeseries" + "type": "graph" }, { "datasource": null, @@ -3591,7 +3591,7 @@ ], "title": "Inputs and Outputs", "transparent": true, - "type": "timeseries" + "type": "graph" }, { "datasource": null, @@ -3699,7 +3699,7 @@ ], "title": "Weird cases", "transparent": true, - "type": "timeseries" + "type": "graph" }, { "datasource": null, @@ -3890,7 +3890,7 @@ ], "title": "Transaction Age", "transparent": true, - "type": "timeseries" + "type": "graph" } ], "title": "Transaction Pool", @@ -3989,7 +3989,7 @@ ], "title": "Height", "transparent": true, - "type": "timeseries" + "type": "graph" }, { "datasource": null, @@ -4073,7 +4073,7 @@ ], "title": "Fees", "transparent": true, - "type": "timeseries" + "type": "graph" }, { "datasource": null, @@ -4158,7 +4158,7 @@ ], "title": "Subsidy", "transparent": true, - "type": "timeseries" + "type": "graph" }, { "datasource": null, @@ -4349,7 +4349,7 @@ ], "title": "Transaction Fees Distribution (per kB)", "transparent": true, - "type": "timeseries" + "type": "graph" }, { "datasource": null, @@ -4433,7 +4433,7 @@ ], "title": "Rewards", "transparent": true, - "type": "timeseries" + "type": "graph" }, { "datasource": null, @@ -4517,7 +4517,7 @@ ], "title": "Size", "transparent": true, - "type": "timeseries" + "type": "graph" }, { "datasource": null, @@ -4601,7 +4601,7 @@ ], "title": "Transactions", "transparent": true, - "type": "timeseries" + "type": "graph" }, { "datasource": null, @@ -4693,7 +4693,7 @@ ], "title": "Inputs and Outputs", "transparent": true, - "type": "timeseries" + "type": "graph" }, { "datasource": null, @@ -4884,7 +4884,7 @@ ], "title": "Transaction Size Distribution", "transparent": true, - "type": "timeseries" + "type": "graph" }, { "datasource": null, @@ -5074,7 +5074,7 @@ ], "title": "Transaction Inputs", "transparent": true, - "type": "timeseries" + "type": "graph" }, { "datasource": null, @@ -5264,7 +5264,7 @@ ], "title": "Transaction Outputs", "transparent": true, - "type": "timeseries" + "type": "graph" }, { "datasource": null, @@ -5348,7 +5348,7 @@ ], "title": "Difficulty", "transparent": true, - "type": "timeseries" + "type": "graph" } ], "title": "Last Block", diff --git a/config/grafana/grafana.ini b/config/grafana/grafana.ini index c1c31f9..6d6478f 100644 --- a/config/grafana/grafana.ini +++ b/config/grafana/grafana.ini @@ -14,13 +14,14 @@ org_role = Admin [dashboards] min_refresh_interval = 1m - +default_home_dashboard_path = dashboards/monero.json [paths] provisioning = /etc/grafana/provisioning [server] +root_url = https://127.0.0.1/grafana enable_gzip = true read_timeout = 2m diff --git a/docker-compose.yml b/docker-compose.yml index c508ca8..37de078 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -28,9 +28,10 @@ x-traefik-command-nole: &traefik-command-nole x-monerod-command: &monerod-command command: >- - --restricted-rpc --public-node --no-igd --no-zmq + --public-node --no-igd --no-zmq --enable-dns-blocklist --rpc-restricted-bind-ip=0.0.0.0 - --rpc-restricted-bind-port=${MONEROD_RPC_PORT} --confirm-external-bind + --rpc-restricted-bind-port=${MONEROD_RESTRICTED_RPC_PORT} --confirm-external-bind + --rpc-bind-port=${MONEROD_RPC_PORT} --rpc-bind-ip=0.0.0.0 ${MONEROD_EXTRA_PARAMS} x-tor-service: &tor-service @@ -40,7 +41,7 @@ x-tor-service: &tor-service links: - monerod environment: - MONEROD_TOR_SERVICE_HOSTS: "${TOR_HTTP_PORT}:monerod:${MONEROD_RPC_PORT}" + MONEROD_TOR_SERVICE_HOSTS: "${TOR_HTTP_PORT}:monerod:${MONEROD_RESTRICTED_RPC_PORT}" volumes: - tor-keys:/var/lib/tor/hidden_service/ @@ -73,7 +74,6 @@ x-monero-exporter-service: &monero-exporter-service - --monero-addr=http://monerod:${MONEROD_RPC_PORT} container_name: monero-exporter image: utxobr/monero-exporter@sha256:737413b1054583535e835e1417b61a8d59a4c08723e4a15c61c4249c2a7d69a4 - network_mode: service:monerod x-grafana-service: &grafana-service grafana: @@ -101,6 +101,7 @@ x-grafana-service: &grafana-service x-prometheus-service: &prometheus-service prometheus: + user: root command: - --config.file=/etc/prometheus/config.yaml - --storage.tsdb.path=/data @@ -139,7 +140,6 @@ services: <<: *monerod-command ports: - "${MONEROD_P2P_PORT}:${MONEROD_P2P_PORT}" # Exposes P2P port - - "${MONEROD_RPC_PORT}" volumes: - "monerod-data:/home/monero/.bitmonero" labels: @@ -150,21 +150,19 @@ services: - "traefik.http.routers.monerod.entrypoints=websecure" - "traefik.http.routers.monerod.tls" - "traefik.http.routers.monerod.service=monerod" - - "traefik.http.services.monerod.loadbalancer.server.port=${MONEROD_RPC_PORT}" + - "traefik.http.services.monerod.loadbalancer.server.port=${MONEROD_RESTRICTED_RPC_PORT}" # - "traefik.http.middlewares.corsheader.headers.accessControlAllowOriginList=${MONEROD_accessControlAllowOriginList}" #!cors # - "traefik.http.routers.monerod.middlewares=corsheader" #!cors restart: unless-stopped # <<: *tor-service #!tor # <<: *explorer-service #!explorer - <<: *monero-exporter-service #!monero-exporter - - <<: *grafana-service #!grafana - - <<: *prometheus-service #!prometheus + # <<: *monero-exporter-service #!monero-exporter + # <<: *grafana-service #!grafana + # <<: *prometheus-service #!prometheus # <<: *watchtower-service #!watchtower volumes: monerod-data: {} # tor-keys: {} #!tor - prometheus-data: {} #!prometheus + # prometheus-data: {} #!prometheus diff --git a/install b/install index 645e820..cb05b13 100755 --- a/install +++ b/install @@ -52,6 +52,7 @@ TLS_PORT="" TLS_DOMAIN="" TLS_EMAIL="" NETWORK="mainnet" +ENABLE_GRAFANA="" ################################################################ # Functions # @@ -282,6 +283,24 @@ configure_explorer() { done } +configure_grafana() { + echo -e "${OkBullet}Configuring grafana..." + while true; do + read -r -e -p " Do you want to enable a grafana monitoring dashboard? [y/n]: " yn + case $yn in + [Yy]*) + ENABLE_GRAFANA=true + sed -i '/#!monero-exporter/s/# //g' docker-compose.yml + sed -i '/#!grafana/s/# //g' docker-compose.yml + sed -i '/#!prometheus/s/# //g' docker-compose.yml + break + ;; + [Nn]*) break ;; + *) echo " Please answer yes or no." ;; + esac + done +} + configure_watchtower() { echo -e "${OkBullet}Configuring watchtower..." while true; do @@ -341,13 +360,18 @@ completed() { echo -e " ${Red}┌───────────────────────────────────────────────────────────────────────────[info]──" echo -e " ${Red}│${Stat} Network: ${StatInfo}${NETWORK}" echo -e " ${Red}│${Stat} URL: ${StatInfo}https://${HOST}${PORT_SUFF}" - if [ "$ENABLE_EXPLORER" = true ]; then - echo -e " ${Red}│${Stat} Explorer URL: ${StatInfo}https://${HOST}${PORT_SUFF}/explorer" - fi + echo -e " ${Red}│${Stat} Public IP: ${StatInfo}${PUBLIC_IP}" if [ "$ENABLE_TOR" = true ]; then echo -e " ${Red}│${Stat} Onion Service: ${StatInfo}$ONION" fi + if [ "$ENABLE_EXPLORER" = true ]; then + echo -e " ${Red}│${Stat} Explorer URL: ${StatInfo}https://${HOST}${PORT_SUFF}/explorer" + fi + if [ "$ENABLE_GRAFANA" = true ]; then + echo -e " ${Red}│${Stat} Grafana URL: ${StatInfo}https://${HOST}${PORT_SUFF}/grafana" + fi + echo -e " ${Red}│${Stat} Project installed in: ${StatInfo}${XMRSH_DIR}" echo -e " ${Red}│${Off}" echo } @@ -377,7 +401,7 @@ configure_cors configure_tor configure_explorer configure_watchtower -# configure_monitor +configure_grafana # configure_lws start_xmrsh completed From 4573e58e8342105dead2a41273f6c10556601f14 Mon Sep 17 00:00:00 2001 From: vdo Date: Tue, 31 May 2022 17:52:51 +0100 Subject: [PATCH 15/46] fix quantiles --- config/grafana/dashboards/monero.json | 22 ++------------------ config/grafana/grafana.ini | 7 +++++-- config/prometheus/Dockerfile | 29 --------------------------- config/prometheus/config.yaml | 8 ++++---- 4 files changed, 11 insertions(+), 55 deletions(-) delete mode 100644 config/prometheus/Dockerfile diff --git a/config/grafana/dashboards/monero.json b/config/grafana/dashboards/monero.json index 0e342e4..ffdaba1 100644 --- a/config/grafana/dashboards/monero.json +++ b/config/grafana/dashboards/monero.json @@ -86,7 +86,7 @@ { "exemplar": true, "expr": "monero_info_mainnet", - "instant": true, + "instant": false, "interval": "", "legendFormat": "mainnet", "refId": "A" @@ -5363,25 +5363,7 @@ "list": [ { "allValue": null, - "current": { - "selected": true, - "text": [ - "0.05", - "0.25", - "0.5", - "0.75", - "0.95", - "1" - ], - "value": [ - "0.05", - "0.25", - "0.5", - "0.75", - "0.95", - "1" - ] - }, + "current": {}, "datasource": null, "definition": "label_values(monero_lastblock_transactions_inputs,quantile)", "description": "quantile to filter for in the panels that use distributions", diff --git a/config/grafana/grafana.ini b/config/grafana/grafana.ini index 6d6478f..b296b63 100644 --- a/config/grafana/grafana.ini +++ b/config/grafana/grafana.ini @@ -14,7 +14,7 @@ org_role = Admin [dashboards] min_refresh_interval = 1m -default_home_dashboard_path = dashboards/monero.json +default_home_dashboard_path = /var/lib/grafana/dashboards/monero.json [paths] provisioning = /etc/grafana/provisioning @@ -25,6 +25,9 @@ root_url = https://127.0.0.1/grafana enable_gzip = true read_timeout = 2m - [snapshots] external_enabled = false + +[security] +admin_user = admin +admin_password = xmrsh-admin \ No newline at end of file diff --git a/config/prometheus/Dockerfile b/config/prometheus/Dockerfile deleted file mode 100644 index 99b0e72..0000000 --- a/config/prometheus/Dockerfile +++ /dev/null @@ -1,29 +0,0 @@ -ARG BUILDER_IMAGE=index.docker.io/library/ubuntu@sha256:82becede498899ec668628e7cb0ad87b6e1c371cb8a1e597d83a47fac21d6af3 -ARG RUNTIME_IMAGE=gcr.io/distroless/base@sha256:97f9cbf81590c7dd878d7e10c20116fa7488c2fb91b3c839df1ebdcb61ab13ca - - -FROM $BUILDER_IMAGE AS builder - - ARG VERSION=2.28.1 - ARG SHA256=91dd91e13f30fe520e01175ca1027dd09a458d4421a584ba557ba88b38803f27 - - RUN set -ex && \ - apt update && \ - apt install -y curl gzip - - RUN set -ex && \ - curl -SOL https://github.com/prometheus/prometheus/releases/download/v${VERSION}/prometheus-${VERSION}.linux-amd64.tar.gz && \ - echo "${SHA256} prometheus-${VERSION}.linux-amd64.tar.gz" | sha256sum -c && \ - tar xvzf prometheus-${VERSION}.linux-amd64.tar.gz --strip-components=1 && \ - mv ./prometheus /usr/local/bin/prometheus - - RUN mkdir /data - - -FROM $RUNTIME_IMAGE - - COPY --from=builder --chown=nonroot:nonroot /data /data - COPY --from=builder --chown=nonroot:nonroot /usr/local/bin/prometheus /usr/local/bin/prometheus - USER nonroot:nonroot - - ENTRYPOINT [ "prometheus" ] diff --git a/config/prometheus/config.yaml b/config/prometheus/config.yaml index b387614..555e9e4 100644 --- a/config/prometheus/config.yaml +++ b/config/prometheus/config.yaml @@ -1,8 +1,8 @@ global: - scrape_interval: '15s' - evaluation_interval: '15s' + scrape_interval: "10s" + evaluation_interval: "10s" scrape_configs: - - job_name: 'monerod' + - job_name: "monerod" static_configs: - targets: - - 'monerod:9000' + - "monero-exporter:9000" From 34db57fef01acf83092e5007f1fed4468d918306 Mon Sep 17 00:00:00 2001 From: vdo Date: Tue, 31 May 2022 17:56:04 +0100 Subject: [PATCH 16/46] split stripprefixes --- docker-compose.yml | 8 ++++---- install | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 37de078..7c627af 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -61,8 +61,8 @@ x-explorer-service: &explorer-service - "traefik.http.routers.explorer.rule=(PathPrefix(`/explorer`) )" #!nole # - "traefik.http.routers.explorer.rule=(Host(`${DOMAIN}`) && PathPrefix(`/explorer`) )" #!le # - "traefik.http.routers.explorer.tls.certresolver=le" #!le - - "traefik.http.middlewares.stripprefix.stripprefix.prefixes=/explorer" - - "traefik.http.routers.explorer.middlewares=stripprefix" + - "traefik.http.middlewares.stripprefix-explorer.stripprefix.prefixes=/explorer" + - "traefik.http.routers.explorer.middlewares=stripprefix-explorer" - "traefik.http.routers.explorer.entrypoints=websecure" - "traefik.http.routers.explorer.tls" - "traefik.http.routers.explorer.service=explorer" @@ -92,8 +92,8 @@ x-grafana-service: &grafana-service - "traefik.http.routers.grafana.rule=(PathPrefix(`/grafana`) )" #!nole # - "traefik.http.routers.grafana.rule=(Host(`${DOMAIN}`) && PathPrefix(`/grafana`) )" #!le # - "traefik.http.routers.grafana.tls.certresolver=le" #!le - - "traefik.http.middlewares.stripprefix.stripprefix.prefixes=/grafana" - - "traefik.http.routers.grafana.middlewares=stripprefix" + - "traefik.http.middlewares.stripprefix-grafana.stripprefix.prefixes=/grafana" + - "traefik.http.routers.grafana.middlewares=stripprefix-grafana" - "traefik.http.routers.grafana.entrypoints=websecure" - "traefik.http.routers.grafana.tls" - "traefik.http.routers.grafana.service=grafana" diff --git a/install b/install index cb05b13..4eeea8e 100755 --- a/install +++ b/install @@ -48,7 +48,7 @@ DOCKER_COMPOSE_INSTALLED=false DOCKER_COMPOSE_VERSION="v2.5.0" DEPENDENCIES="git curl" ONION="Not Available" -TLS_PORT="" +TLS_PORT="443" TLS_DOMAIN="" TLS_EMAIL="" NETWORK="mainnet" From fba7d4c8aa3a050bf313ca8a1e36b706d625f6ba Mon Sep 17 00:00:00 2001 From: vdo Date: Tue, 31 May 2022 18:29:02 +0100 Subject: [PATCH 17/46] bump to v0.3.0 --- install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install b/install index 4eeea8e..41230f6 100755 --- a/install +++ b/install @@ -38,7 +38,7 @@ StatInfo="${White}${On_Black}" ################################################################ # Vars # ################################################################ -VERSION="v0.2.0" +VERSION="v0.3.0" XMRSH_DIR="/opt/xmr.sh" XMRSH_BRANCH="main" XMRSH_URL="https://github.com/vdo/xmr.sh" @@ -351,7 +351,7 @@ completed() { else HOST="${PUBLIC_IP}" fi - if [ "$TLS_PORT" = "443" ]; then + if [[ $TLS_PORT == "443" ]]; then PORT_SUFF="" else PORT_SUFF=":${TLS_PORT}" From 8dd1927677dd6758a20ab8f310937200c1c5bfa4 Mon Sep 17 00:00:00 2001 From: vdo Date: Wed, 1 Jun 2022 10:00:26 +0100 Subject: [PATCH 18/46] update grafana and prometheus --- .env | 2 +- config/grafana/grafana.ini | 8 +++----- docker-compose.yml | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.env b/.env index 5cdaf2c..2480d31 100644 --- a/.env +++ b/.env @@ -20,6 +20,6 @@ TOR_HTTP_PORT=80 EXPLORER_TAG=v0.17 EXPLORER_PORT=8081 -GRAFANA_TAG=7.3.10 +GRAFANA_TAG=9.0.0-beta1 PROMETHEUS_TAG=v2.22.2 diff --git a/config/grafana/grafana.ini b/config/grafana/grafana.ini index b296b63..446da93 100644 --- a/config/grafana/grafana.ini +++ b/config/grafana/grafana.ini @@ -6,11 +6,9 @@ check_for_updates = false [auth] disable_login_form = true - -[auth.anonymous] -enabled = true -org_role = Admin - +; [auth.anonymous] +; enabled = true +; org_role = Admin [dashboards] min_refresh_interval = 1m diff --git a/docker-compose.yml b/docker-compose.yml index 7c627af..9de074a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -101,13 +101,13 @@ x-grafana-service: &grafana-service x-prometheus-service: &prometheus-service prometheus: - user: root + #user: root command: - --config.file=/etc/prometheus/config.yaml - --storage.tsdb.path=/data - --storage.tsdb.retention.time=30d container_name: prometheus - image: prom/prometheus:${PROMETHEUS_TAG} + image: bitnami/prometheus:${PROMETHEUS_TAG} volumes: - prometheus-data:/data - ./config/prometheus/config.yaml:/etc/prometheus/config.yaml:ro From 9c92b6eaa64e281225049c98ae8521257629b277 Mon Sep 17 00:00:00 2001 From: vdo Date: Wed, 1 Jun 2022 10:16:03 +0100 Subject: [PATCH 19/46] fix quantiles, bump versions --- .env | 4 ++-- config/grafana/dashboards/monero.json | 26 +++++++++++++------------- config/grafana/grafana.ini | 4 +--- docker-compose.yml | 2 +- install | 2 ++ 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.env b/.env index 2480d31..f77c2c7 100644 --- a/.env +++ b/.env @@ -20,6 +20,6 @@ TOR_HTTP_PORT=80 EXPLORER_TAG=v0.17 EXPLORER_PORT=8081 -GRAFANA_TAG=9.0.0-beta1 +GRAFANA_TAG=8.5.4 -PROMETHEUS_TAG=v2.22.2 +PROMETHEUS_TAG=2.36.0 diff --git a/config/grafana/dashboards/monero.json b/config/grafana/dashboards/monero.json index ffdaba1..373654c 100644 --- a/config/grafana/dashboards/monero.json +++ b/config/grafana/dashboards/monero.json @@ -5364,25 +5364,25 @@ { "allValue": null, "current": {}, - "datasource": null, - "definition": "label_values(monero_lastblock_transactions_inputs,quantile)", - "description": "quantile to filter for in the panels that use distributions", - "error": null, + "datasource": "prometheus", + "definition": "", "hide": 0, - "includeAll": true, - "label": "quantile", - "multi": true, + "includeAll": false, + "index": -1, + "label": "Quantile", + "multi": false, "name": "quantile", "options": [], - "query": { - "query": "label_values(monero_lastblock_transactions_inputs,quantile)", - "refId": "StandardVariableQuery" - }, + "query": "label_values(monero_peerlist_lastseen,quantile)", "refresh": 1, "regex": "", "skipUrlSync": false, - "sort": 0, - "type": "query" + "sort": 1, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false } ] }, diff --git a/config/grafana/grafana.ini b/config/grafana/grafana.ini index 446da93..bb46eea 100644 --- a/config/grafana/grafana.ini +++ b/config/grafana/grafana.ini @@ -2,9 +2,8 @@ reporting_enabled = false check_for_updates = false - [auth] -disable_login_form = true +disable_login_form = false ; [auth.anonymous] ; enabled = true @@ -17,7 +16,6 @@ default_home_dashboard_path = /var/lib/grafana/dashboards/monero.json [paths] provisioning = /etc/grafana/provisioning - [server] root_url = https://127.0.0.1/grafana enable_gzip = true diff --git a/docker-compose.yml b/docker-compose.yml index 9de074a..68204f5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -101,7 +101,7 @@ x-grafana-service: &grafana-service x-prometheus-service: &prometheus-service prometheus: - #user: root + user: root # root user needed to use an external volume command: - --config.file=/etc/prometheus/config.yaml - --storage.tsdb.path=/data diff --git a/install b/install index 41230f6..43c3a02 100755 --- a/install +++ b/install @@ -233,6 +233,8 @@ configure_tls_port() { done # Set port in vars sed -i "s/TRAEFIK_TLS_PORT=.*/TRAEFIK_TLS_PORT=${TLS_PORT}/g" .env + else + TLS_PORT="443" fi } From eb30c499be5d997c79c5c62f564abe919fd8aa98 Mon Sep 17 00:00:00 2001 From: vdo Date: Wed, 1 Jun 2022 10:50:52 +0100 Subject: [PATCH 20/46] generate a safe grafana password --- .env | 2 +- docker-compose.yml | 2 ++ install | 9 ++++++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.env b/.env index f77c2c7..7a8274f 100644 --- a/.env +++ b/.env @@ -21,5 +21,5 @@ EXPLORER_TAG=v0.17 EXPLORER_PORT=8081 GRAFANA_TAG=8.5.4 - +GF_SECURITY_ADMIN_PASSWORD=xmrsh-admin PROMETHEUS_TAG=2.36.0 diff --git a/docker-compose.yml b/docker-compose.yml index 68204f5..4d1f30e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -87,6 +87,8 @@ x-grafana-service: &grafana-service - ./config/grafana/grafana.ini:/etc/grafana/grafana.ini:ro - ./config/grafana/provisioning:/etc/grafana/provisioning:ro - ./config/grafana/dashboards:/var/lib/grafana/dashboards:ro + environment: + GF_SECURITY_ADMIN_PASSWORD: ${GF_SECURITY_ADMIN_PASSWORD} labels: - "traefik.enable=true" - "traefik.http.routers.grafana.rule=(PathPrefix(`/grafana`) )" #!nole diff --git a/install b/install index 43c3a02..4b8d959 100755 --- a/install +++ b/install @@ -295,6 +295,11 @@ configure_grafana() { sed -i '/#!monero-exporter/s/# //g' docker-compose.yml sed -i '/#!grafana/s/# //g' docker-compose.yml sed -i '/#!prometheus/s/# //g' docker-compose.yml + GRAFANA_PASSWORD="$( + tr Date: Wed, 1 Jun 2022 11:05:17 +0100 Subject: [PATCH 21/46] update todo and readme --- README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b632d9c..fa5c777 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,16 @@ # xmr.sh -A Monero node installer in a single command +**xmr.sh** script wizard sets up a new server running a monero node daemon with Docker compose, with your choice of SSL certificates for your domain, network selection, a Tor hidden service, Grafana dashboard and more. -Tested on: +## Distribution support + +Compatible and tested on: - Debian 11 - Ubuntu Focal - Fedora 36 -- CentOS 10 Stream + +Other distributions with docker pre-installed would probably be compatible as well. ## ToDo @@ -20,7 +23,7 @@ Tested on: - [ ] Documentation - [x] Make tor service optional - [x] (Optional) block explorer -- [ ] Grafana dashboard +- [x] Grafana dashboard - [ ] arm64 support for all images. - [ ] monerod-lws support. - [ ] monerod-proxy support. From 6d3b92486e05e2fce58c64c6c8233b831e77f783 Mon Sep 17 00:00:00 2001 From: vdo Date: Wed, 1 Jun 2022 12:03:47 +0100 Subject: [PATCH 22/46] pass generation fix, bump --- install | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/install b/install index 4b8d959..3a6398f 100755 --- a/install +++ b/install @@ -38,7 +38,7 @@ StatInfo="${White}${On_Black}" ################################################################ # Vars # ################################################################ -VERSION="v0.3.0" +VERSION="v0.3.1" XMRSH_DIR="/opt/xmr.sh" XMRSH_BRANCH="main" XMRSH_URL="https://github.com/vdo/xmr.sh" @@ -295,10 +295,7 @@ configure_grafana() { sed -i '/#!monero-exporter/s/# //g' docker-compose.yml sed -i '/#!grafana/s/# //g' docker-compose.yml sed -i '/#!prometheus/s/# //g' docker-compose.yml - GRAFANA_PASSWORD="$( - tr Date: Wed, 1 Jun 2022 14:45:45 +0100 Subject: [PATCH 23/46] uninstall, local volumes --- README.md | 6 ++--- data/grafana/.gitignore | 4 +++ data/letsencrypt/.gitignore | 4 +++ data/monero/.gitignore | 4 +++ data/prometheus/.gitignore | 4 +++ data/tor/.gitignore | 4 +++ docker-compose.yml | 19 ++++++-------- install | 18 ++++--------- uninstall | 50 ++++++++++++++++++++++++++----------- 9 files changed, 71 insertions(+), 42 deletions(-) create mode 100644 data/grafana/.gitignore create mode 100644 data/letsencrypt/.gitignore create mode 100644 data/monero/.gitignore create mode 100644 data/prometheus/.gitignore create mode 100644 data/tor/.gitignore diff --git a/README.md b/README.md index fa5c777..383ca43 100644 --- a/README.md +++ b/README.md @@ -17,13 +17,13 @@ Other distributions with docker pre-installed would probably be compatible as we - [x] Add wizard for DNS domain selection. - [x] Status and node info at finish. - [x] Mainnet / Stagenet / Testnet selection -- [ ] Pruning option +- [x] Pruning enabled - [x] Clearnet TLS port selection - [ ] Uninstall script - [ ] Documentation - [x] Make tor service optional -- [x] (Optional) block explorer +- [x] Block explorer (disabled) - [x] Grafana dashboard - [ ] arm64 support for all images. -- [ ] monerod-lws support. +- [ ] monerod-lws support - [ ] monerod-proxy support. diff --git a/data/grafana/.gitignore b/data/grafana/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/data/grafana/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/data/letsencrypt/.gitignore b/data/letsencrypt/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/data/letsencrypt/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/data/monero/.gitignore b/data/monero/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/data/monero/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/data/prometheus/.gitignore b/data/prometheus/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/data/prometheus/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/data/tor/.gitignore b/data/tor/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/data/tor/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/docker-compose.yml b/docker-compose.yml index 4d1f30e..ca3d72d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -43,7 +43,7 @@ x-tor-service: &tor-service environment: MONEROD_TOR_SERVICE_HOSTS: "${TOR_HTTP_PORT}:monerod:${MONEROD_RESTRICTED_RPC_PORT}" volumes: - - tor-keys:/var/lib/tor/hidden_service/ + - ./data/tor:/var/lib/tor/hidden_service/ x-explorer-service: &explorer-service explorer: @@ -51,7 +51,7 @@ x-explorer-service: &explorer-service container_name: explorer restart: unless-stopped volumes: - - monerod-data:/home/monero/.bitmonero + - ./data/monero:/home/monero/.bitmonero ports: - ${EXPLORER_PORT} depends_on: @@ -77,6 +77,7 @@ x-monero-exporter-service: &monero-exporter-service x-grafana-service: &grafana-service grafana: + user: "1000" command: - -config=/etc/grafana/grafana.ini container_name: grafana @@ -84,6 +85,7 @@ x-grafana-service: &grafana-service ports: - 3000 volumes: + - ./data/grafana:/var/lib/grafana - ./config/grafana/grafana.ini:/etc/grafana/grafana.ini:ro - ./config/grafana/provisioning:/etc/grafana/provisioning:ro - ./config/grafana/dashboards:/var/lib/grafana/dashboards:ro @@ -103,7 +105,7 @@ x-grafana-service: &grafana-service x-prometheus-service: &prometheus-service prometheus: - user: root # root user needed to use an external volume + user: "1000" command: - --config.file=/etc/prometheus/config.yaml - --storage.tsdb.path=/data @@ -111,7 +113,7 @@ x-prometheus-service: &prometheus-service container_name: prometheus image: bitnami/prometheus:${PROMETHEUS_TAG} volumes: - - prometheus-data:/data + - ./data/prometheus:/data - ./config/prometheus/config.yaml:/etc/prometheus/config.yaml:ro x-watchtower-service: &watchtower-service @@ -132,7 +134,7 @@ services: - ${TRAEFIK_HTTP_PORT}:${TRAEFIK_HTTP_PORT} - ${TRAEFIK_TLS_PORT}:${TRAEFIK_TLS_PORT} volumes: - # - "./letsencrypt:/letsencrypt" #!le + - "./data/letsencrypt:/letsencrypt" #!le - "/var/run/docker.sock:/var/run/docker.sock:ro" <<: *traefik-command-nole #!traefik-command restart: always @@ -143,7 +145,7 @@ services: ports: - "${MONEROD_P2P_PORT}:${MONEROD_P2P_PORT}" # Exposes P2P port volumes: - - "monerod-data:/home/monero/.bitmonero" + - "./data/monero:/home/monero/.bitmonero" labels: - "traefik.enable=true" # - "traefik.http.routers.monerod.rule=(Host(`${DOMAIN}`) && PathPrefix(`/`))" #!le @@ -163,8 +165,3 @@ services: # <<: *grafana-service #!grafana # <<: *prometheus-service #!prometheus # <<: *watchtower-service #!watchtower - -volumes: - monerod-data: {} - # tor-keys: {} #!tor - # prometheus-data: {} #!prometheus diff --git a/install b/install index 3a6398f..da009c4 100755 --- a/install +++ b/install @@ -1,30 +1,20 @@ #!/bin/bash ################################################################ -# Color Aliases # +# Colors # ################################################################ # Reset Off='\033[0m' # Text Reset # Regular Colors -Black='\033[0;30m' # Black Red='\033[0;31m' # Red Green='\033[0;32m' # Green Yellow='\033[0;33m' # Yellow -Blue='\033[0;34m' # Blue Purple='\033[0;35m' # Purple -Cyan='\033[0;36m' # Cyan White='\033[0;37m' # White # Background -On_Black='\033[40m' # Black -On_Red='\033[41m' # Red -On_Green='\033[42m' # Green -On_Yellow='\033[43m' # Yellow -On_Blue='\033[44m' # Blue -On_Purple='\033[45m' # Purple -On_Cyan='\033[46m' # Cyan -On_White='\033[47m' # White +On_Black='\033[40m' # Black OkBullet="${Green}${On_Black}:: ${White}${On_Black}" WarnBullet="${Yellow}${On_Black}:: ${White}${On_Black}" @@ -165,6 +155,7 @@ install_xmrsh() { git clone -b "${XMRSH_BRANCH}" "${XMRSH_URL}" "${XMRSH_DIR}" >>"${XMRSH_LOG_FILE}" 2>&1 check_return $? pushd "${XMRSH_DIR}" >>"${XMRSH_LOG_FILE}" 2>&1 || return + chown -R "1000:1000" ./data else echo -e "${Ok}" echo -e "${WarnBullet}Warning: xmr.sh already present in ${XMRSH_DIR}" #FIXME: This should exit, when uninstall script ready @@ -405,7 +396,8 @@ configure_tls_port configure_cors configure_tor -configure_explorer +# Deployment of explorer disabled until it's stable. +# configure_explorer configure_watchtower configure_grafana # configure_lws diff --git a/uninstall b/uninstall index 4c36eff..634971a 100755 --- a/uninstall +++ b/uninstall @@ -1,30 +1,20 @@ #!/bin/bash ################################################################ -# Color Aliases # +# Colors # ################################################################ # Reset Off='\033[0m' # Text Reset # Regular Colors -Black='\033[0;30m' # Black Red='\033[0;31m' # Red Green='\033[0;32m' # Green Yellow='\033[0;33m' # Yellow -Blue='\033[0;34m' # Blue Purple='\033[0;35m' # Purple -Cyan='\033[0;36m' # Cyan White='\033[0;37m' # White # Background -On_Black='\033[40m' # Black -On_Red='\033[41m' # Red -On_Green='\033[42m' # Green -On_Yellow='\033[43m' # Yellow -On_Blue='\033[44m' # Blue -On_Purple='\033[45m' # Purple -On_Cyan='\033[46m' # Cyan -On_White='\033[47m' # White +On_Black='\033[40m' # Black OkBullet="${Green}${On_Black}:: ${White}${On_Black}" WarnBullet="${Yellow}${On_Black}:: ${White}${On_Black}" @@ -32,19 +22,49 @@ ErrBullet="${Red}${On_Black}:: ${White}${On_Black}" Ok="${Green}${On_Black} ok.${Off}" Fail="${Red}${On_Black} failed!${Off}" Nok="${Yellow}${On_Black} nok.${Off}" -Stat="${Purple}${On_Black}" -StatInfo="${White}${On_Black}" ################################################################ # Vars # ################################################################ XMRSH_DIR="/opt/xmr.sh" +XMRSH_LOG_FILE="/tmp/xmr.sh-$(date +%Y%m%d-%H%M%S).log" ################################################################ # Functions # ################################################################ -# TBD +check_return() { + if [ "$1" -ne 0 ]; then + echo -e "${Fail}" + echo -e "${ErrBullet}Installation failed. Check the logs in ${XMRSH_LOG_FILE}${Off}" + exit "$1" + fi +} + +uninstall() { + pushd $XMRSH_DIR || check_return $? + echo -e "${OkBullet}Uninstalling xmr.sh..." + docker-compose down >>"${XMRSH_LOG_FILE}" 2>&1 + check_return $? + while true; do + read -r -e -p " Do you want to keep the data directory with the blockchain and other data files? [y/n]: " yn + case $yn in + [Yy]*) + rm -rf !("data") + check_return $? + break + ;; + [Nn]*) + popd || check_return $? + rm -rf ./* + check_return $? + break + ;; + *) echo " Please answer yes or no." ;; + esac + done + echo -e "${OkBullet}Uninstall complete." +} exit 0 From f201e23b1624f8253c09301515d6c730f7243b8b Mon Sep 17 00:00:00 2001 From: vdo Date: Wed, 1 Jun 2022 15:12:55 +0100 Subject: [PATCH 24/46] detect pipe --- install | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/install b/install index da009c4..817c61f 100755 --- a/install +++ b/install @@ -29,6 +29,7 @@ StatInfo="${White}${On_Black}" # Vars # ################################################################ VERSION="v0.3.1" +XMRSH_INSTALL_CMD="sudo bash -c \"\$(curl -sLSf https://get.xmr.sh)\"" XMRSH_DIR="/opt/xmr.sh" XMRSH_BRANCH="main" XMRSH_URL="https://github.com/vdo/xmr.sh" @@ -67,6 +68,16 @@ detect_root() { echo -e "${Ok}" } +detect_pipe() { + echo -ne "${OkBullet}Checking script execution... ${Off}" + if [ -p /dev/stdin ]; then + echo -e "${Fail}" + echo -e "${ErrBullet}This script can't be piped! Instead, use the command: ${XMRSH_INSTALL_CMD}${Off}" + exit 1 + fi + echo -e "${Ok}" +} + check_deps() { echo -ne "${OkBullet}Checking and installing dependencies... ${Off}" # shellcheck disable=SC2068 @@ -155,7 +166,8 @@ install_xmrsh() { git clone -b "${XMRSH_BRANCH}" "${XMRSH_URL}" "${XMRSH_DIR}" >>"${XMRSH_LOG_FILE}" 2>&1 check_return $? pushd "${XMRSH_DIR}" >>"${XMRSH_LOG_FILE}" 2>&1 || return - chown -R "1000:1000" ./data + chown -R "1000:1000" ./data >>"${XMRSH_LOG_FILE}" 2>&1 + check_return $? else echo -e "${Ok}" echo -e "${WarnBullet}Warning: xmr.sh already present in ${XMRSH_DIR}" #FIXME: This should exit, when uninstall script ready @@ -375,6 +387,7 @@ completed() { header detect_root +detect_pipe check_deps detect_docker detect_docker_compose From 3c232d96723cf8389f591aec4815c2d1499bbc7a Mon Sep 17 00:00:00 2001 From: vdo Date: Wed, 1 Jun 2022 15:22:08 +0100 Subject: [PATCH 25/46] Exit if present --- install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install b/install index 817c61f..aefae77 100755 --- a/install +++ b/install @@ -170,8 +170,8 @@ install_xmrsh() { check_return $? else echo -e "${Ok}" - echo -e "${WarnBullet}Warning: xmr.sh already present in ${XMRSH_DIR}" #FIXME: This should exit, when uninstall script ready - return + echo -e "${ErrBullet}Error: xmr.sh already present in ${XMRSH_DIR}. Run the uninstall script first." + exit 1 fi echo -e "${Ok}" } From b2ab5d2ab58c1fecc02e5bcf030ff6dcf1dfbf29 Mon Sep 17 00:00:00 2001 From: vdo Date: Wed, 1 Jun 2022 17:12:45 +0100 Subject: [PATCH 26/46] uninstall: clean excluding data --- uninstall | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/uninstall b/uninstall index 634971a..428f160 100755 --- a/uninstall +++ b/uninstall @@ -34,6 +34,16 @@ XMRSH_LOG_FILE="/tmp/xmr.sh-$(date +%Y%m%d-%H%M%S).log" # Functions # ################################################################ +check_root() { + echo -ne "${OkBullet}Checking root... ${Off}" + if [[ $EUID -ne 0 ]]; then + echo -e "${Fail}" + echo -e "${ErrBullet}You need to run this script as root (UID=0).${Off}" + exit 1 + fi + echo -e "${Ok}" +} + check_return() { if [ "$1" -ne 0 ]; then echo -e "${Fail}" @@ -43,20 +53,21 @@ check_return() { } uninstall() { - pushd $XMRSH_DIR || check_return $? + pushd $XMRSH_DIR >>"${XMRSH_LOG_FILE}" 2>&1 || check_return $? echo -e "${OkBullet}Uninstalling xmr.sh..." - docker-compose down >>"${XMRSH_LOG_FILE}" 2>&1 + if [ -f docker-compose.yml ]; then + docker-compose down >>"${XMRSH_LOG_FILE}" 2>&1 + fi check_return $? while true; do read -r -e -p " Do you want to keep the data directory with the blockchain and other data files? [y/n]: " yn case $yn in [Yy]*) - rm -rf !("data") + find . -type f -not -name 'data' -print0 | xargs -0 -I {} rm {} check_return $? break ;; [Nn]*) - popd || check_return $? rm -rf ./* check_return $? break @@ -64,7 +75,11 @@ uninstall() { *) echo " Please answer yes or no." ;; esac done + popd || check_return $? echo -e "${OkBullet}Uninstall complete." } +check_root +uninstall + exit 0 From c372efafe63ed1b1f331fb30daa266bec9bedea8 Mon Sep 17 00:00:00 2001 From: vdo Date: Wed, 1 Jun 2022 17:34:23 +0100 Subject: [PATCH 27/46] Fix sed slash --- install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install b/install index aefae77..585605c 100755 --- a/install +++ b/install @@ -298,7 +298,7 @@ configure_grafana() { sed -i '/#!monero-exporter/s/# //g' docker-compose.yml sed -i '/#!grafana/s/# //g' docker-compose.yml sed -i '/#!prometheus/s/# //g' docker-compose.yml - GRAFANA_PASSWORD="$(openssl rand -base64 9)" + GRAFANA_PASSWORD="$(openssl rand -base64 9 | tr '\/' '-')" sed -i "s/GF_SECURITY_ADMIN_PASSWORD=.*/GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD}/g" .env break ;; @@ -336,7 +336,7 @@ start_xmrsh() { docker-compose up -d >>"${XMRSH_LOG_FILE}" 2>&1 check_return $? if [[ $ENABLE_TOR == true ]]; then - sleep 3 + sleep 4 ONION=$(docker logs tor 2>&1 | grep Entrypoint | cut -d " " -f 8) fi echo -e "${Ok}" From cab282cc699dce1b94b97ffc05c0b647344348cd Mon Sep 17 00:00:00 2001 From: vdo Date: Fri, 3 Jun 2022 14:19:57 +0100 Subject: [PATCH 28/46] Update README --- README.md | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 383ca43..8fed81e 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,14 @@ Compatible and tested on: Other distributions with docker pre-installed would probably be compatible as well. +## Demo + +[![asciicast](https://asciinema.org/a/DvAz3ygotWYfODOP3duvLbDf.png)](https://asciinema.org/a/DvAz3ygotWYfODOP3duvLbDf) + +## FAQ + +Check the [wiki](https://github.com/vdo/xmr.sh/wiki/FAQ) + ## ToDo - [x] Add wizard for DNS domain selection. @@ -19,11 +27,20 @@ Other distributions with docker pre-installed would probably be compatible as we - [x] Mainnet / Stagenet / Testnet selection - [x] Pruning enabled - [x] Clearnet TLS port selection -- [ ] Uninstall script -- [ ] Documentation +- [x] Uninstall script - [x] Make tor service optional - [x] Block explorer (disabled) - [x] Grafana dashboard +- [ ] Shellcheck via Github Actions +- [ ] Installation documentation - [ ] arm64 support for all images. - [ ] monerod-lws support - [ ] monerod-proxy support. + + +# Credits + +[@cirocosta](https://github.com/cirocosta) for the metrics exporter and grafana dashboard. +[@sethforprivacy](https://github.com/sethforprivacy) for providing and maintaining Monero Docker images. + + From b5badfc96aac69846bd35614c92246386620a855 Mon Sep 17 00:00:00 2001 From: vdo Date: Fri, 3 Jun 2022 14:33:26 +0100 Subject: [PATCH 29/46] Asciicast link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8fed81e..774b80d 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Other distributions with docker pre-installed would probably be compatible as we ## Demo -[![asciicast](https://asciinema.org/a/DvAz3ygotWYfODOP3duvLbDf.png)](https://asciinema.org/a/DvAz3ygotWYfODOP3duvLbDf) +[![asciicast](https://asciinema.org/a/DvAz3ygotWYfODOP3duvLbDfv.svg)](https://asciinema.org/a/DvAz3ygotWYfODOP3duvLbDfv) ## FAQ From ddfa6e596af84e152dc6efe9473b21644bb3ed1c Mon Sep 17 00:00:00 2001 From: vdo Date: Mon, 6 Jun 2022 21:13:47 +0100 Subject: [PATCH 30/46] optional pruning --- .env | 3 ++- README.md | 11 ++++++++--- install | 17 ++++++++++++++++- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/.env b/.env index 7a8274f..0411fb5 100644 --- a/.env +++ b/.env @@ -10,7 +10,8 @@ MONEROD_TAG=latest MONEROD_RPC_PORT=18081 MONEROD_RESTRICTED_RPC_PORT=18089 MONEROD_P2P_PORT=18080 -MONEROD_EXTRA_PARAMS=--prune-blockchain +#MONEROD_EXTRA_PARAMS=--prune-blockchain +MONEROD_EXTRA_PARAMS= MONEROD_accessControlAllowOriginList=* #TOR_TAG=latest diff --git a/README.md b/README.md index 774b80d..e127210 100644 --- a/README.md +++ b/README.md @@ -33,10 +33,10 @@ Check the [wiki](https://github.com/vdo/xmr.sh/wiki/FAQ) - [x] Grafana dashboard - [ ] Shellcheck via Github Actions - [ ] Installation documentation -- [ ] arm64 support for all images. +- [ ] arm64 support for all images - [ ] monerod-lws support -- [ ] monerod-proxy support. - +- [ ] monerod-proxy support for random node forwarding +- [ ] i2p service # Credits @@ -44,3 +44,8 @@ Check the [wiki](https://github.com/vdo/xmr.sh/wiki/FAQ) [@sethforprivacy](https://github.com/sethforprivacy) for providing and maintaining Monero Docker images. +# Donate XMR 🍕 + +86GwmtuKWtjJBWT8Srn4oqZHbP41k2kpG79xXKKgauJzCmZkFJ5ihwjVnRodVbVjAx64JeB7VyGbF6hEdwpcPcR7Go8x2YZ + + diff --git a/install b/install index 585605c..bb1751e 100755 --- a/install +++ b/install @@ -241,10 +241,25 @@ configure_tls_port() { fi } +configure_pruning() { + echo -e "${OkBullet}Configuring pruning..." + while true; do + read -r -e -p " Do you want to enable blockchain pruning? [y/n]: " yn + case $yn in + [Yy]*) + sed -i "/MONEROD_EXTRA_PARAMS/s/$/ --prune-blockchain/g" .env + break + ;; + [Nn]*) break ;; + *) echo " Please answer yes or no." ;; + esac + done +} + configure_cors() { echo -e "${OkBullet}Configuring CORS..." while true; do - read -r -e -p " Do you want to enabe CORS headers so the node can be used in web apps? [y/n]: " yn + read -r -e -p " Do you want to enable CORS headers so the node can be used in web apps? [y/n]: " yn case $yn in [Yy]*) sed -i '/#!cors/s/# //g' docker-compose.yml From 83d4d41092466c4f91e640ff58fab7a9018eb952 Mon Sep 17 00:00:00 2001 From: vdo Date: Mon, 6 Jun 2022 22:01:06 +0100 Subject: [PATCH 31/46] uninstall fixes --- .env | 1 - uninstall | 19 ++++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.env b/.env index 0411fb5..1c40fc4 100644 --- a/.env +++ b/.env @@ -10,7 +10,6 @@ MONEROD_TAG=latest MONEROD_RPC_PORT=18081 MONEROD_RESTRICTED_RPC_PORT=18089 MONEROD_P2P_PORT=18080 -#MONEROD_EXTRA_PARAMS=--prune-blockchain MONEROD_EXTRA_PARAMS= MONEROD_accessControlAllowOriginList=* diff --git a/uninstall b/uninstall index 428f160..47c79ff 100755 --- a/uninstall +++ b/uninstall @@ -7,21 +7,21 @@ Off='\033[0m' # Text Reset # Regular Colors -Red='\033[0;31m' # Red -Green='\033[0;32m' # Green -Yellow='\033[0;33m' # Yellow -Purple='\033[0;35m' # Purple -White='\033[0;37m' # White +Red='\033[0;31m' # Red +Green='\033[0;32m' # Green +#Yellow='\033[0;33m' # Yellow +#Purple='\033[0;35m' # Purple +White='\033[0;37m' # White # Background On_Black='\033[40m' # Black OkBullet="${Green}${On_Black}:: ${White}${On_Black}" -WarnBullet="${Yellow}${On_Black}:: ${White}${On_Black}" +#WarnBullet="${Yellow}${On_Black}:: ${White}${On_Black}" ErrBullet="${Red}${On_Black}:: ${White}${On_Black}" Ok="${Green}${On_Black} ok.${Off}" Fail="${Red}${On_Black} failed!${Off}" -Nok="${Yellow}${On_Black} nok.${Off}" +#Nok="${Yellow}${On_Black} nok.${Off}" ################################################################ # Vars # @@ -65,17 +65,18 @@ uninstall() { [Yy]*) find . -type f -not -name 'data' -print0 | xargs -0 -I {} rm {} check_return $? + popd >>"${XMRSH_LOG_FILE}" 2>&1 || check_return $? break ;; [Nn]*) - rm -rf ./* + popd >>"${XMRSH_LOG_FILE}" 2>&1 || check_return $? + rm -rf "${XMRSH_DIR}" check_return $? break ;; *) echo " Please answer yes or no." ;; esac done - popd || check_return $? echo -e "${OkBullet}Uninstall complete." } From ecd5f51fda51ac17a9a3dee544f7caece0a81593 Mon Sep 17 00:00:00 2001 From: vdo Date: Mon, 6 Jun 2022 22:01:29 +0100 Subject: [PATCH 32/46] version bump --- install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install b/install index bb1751e..4e2d5e6 100755 --- a/install +++ b/install @@ -28,7 +28,7 @@ StatInfo="${White}${On_Black}" ################################################################ # Vars # ################################################################ -VERSION="v0.3.1" +VERSION="v0.3.2" XMRSH_INSTALL_CMD="sudo bash -c \"\$(curl -sLSf https://get.xmr.sh)\"" XMRSH_DIR="/opt/xmr.sh" XMRSH_BRANCH="main" From dc0932b0c9ec6af21561994dbf16b4da0c93c48a Mon Sep 17 00:00:00 2001 From: vdo Date: Mon, 6 Jun 2022 22:25:08 +0100 Subject: [PATCH 33/46] clean comments --- README.md | 4 +--- install | 8 +++----- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index e127210..619111d 100644 --- a/README.md +++ b/README.md @@ -41,11 +41,9 @@ Check the [wiki](https://github.com/vdo/xmr.sh/wiki/FAQ) # Credits [@cirocosta](https://github.com/cirocosta) for the metrics exporter and grafana dashboard. -[@sethforprivacy](https://github.com/sethforprivacy) for providing and maintaining Monero Docker images. +[@sethforprivacy](https://github.com/sethforprivacy) for providing and maintaining Monero Docker images. # Donate XMR 🍕 86GwmtuKWtjJBWT8Srn4oqZHbP41k2kpG79xXKKgauJzCmZkFJ5ihwjVnRodVbVjAx64JeB7VyGbF6hEdwpcPcR7Go8x2YZ - - diff --git a/install b/install index 4e2d5e6..6da2356 100755 --- a/install +++ b/install @@ -117,7 +117,6 @@ detect_curl() { detect_docker() { echo -ne "${OkBullet}Checking docker... ${Off}" - # docker --version >>"${XMRSH_LOG_FILE}" 2>&1 | grep -q "Docker version" if docker --version >>"${XMRSH_LOG_FILE}" 2>&1; then DOCKER_INSTALLED=true echo -e "${Ok}" @@ -128,7 +127,6 @@ detect_docker() { detect_docker_compose() { echo -ne "${OkBullet}Checking docker compose... ${Off}" - #docker-compose --version >>"${XMRSH_LOG_FILE}" 2>&1 | grep -q "Docker Compose version" if docker-compose --version >>"${XMRSH_LOG_FILE}" 2>&1; then DOCKER_COMPOSE_INSTALLED=true echo -e "${Ok}" @@ -219,7 +217,7 @@ configure_tls_domain() { # Set domain and email address in vars sed -i "s/DOMAIN=.*/DOMAIN=${TLS_DOMAIN}/g" .env sed -i "s/TRAEFIK_ACME_EMAIL=.*/TRAEFIK_ACME_EMAIL=${TLS_EMAIL}/g" .env - # Enable LE settings in compose + # Enable Let's Encrypt settings in compose sed -i '/#!le/s/# //g' docker-compose.yml sed -i '/#!nole/s/- /# - /g' docker-compose.yml sed -i "/#\!traefik-command/s/\*traefik-command-nole/\*traefik-command-le/g" docker-compose.yml @@ -381,7 +379,7 @@ completed() { echo echo -e " ${Red}┌───────────────────────────────────────────────────────────────────────────[info]──" echo -e " ${Red}│${Stat} Network: ${StatInfo}${NETWORK}" - echo -e " ${Red}│${Stat} URL: ${StatInfo}https://${HOST}${PORT_SUFF}" + echo -e " ${Red}│${Stat} Public URL: ${StatInfo}https://${HOST}${PORT_SUFF}" echo -e " ${Red}│${Stat} Public IP: ${StatInfo}${PUBLIC_IP}" if [ "$ENABLE_TOR" = true ]; then @@ -420,7 +418,7 @@ install_xmrsh configure_network configure_tls_domain configure_tls_port -# configure_pruning +configure_pruning configure_cors configure_tor From b58cf52373892b4d25a1ce2d54f3d89a0c0e6093 Mon Sep 17 00:00:00 2001 From: vdo Date: Tue, 7 Jun 2022 18:02:27 +0100 Subject: [PATCH 34/46] log config, arm64 compatible images --- .env | 2 +- docker-compose.yml | 20 ++++++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.env b/.env index 1c40fc4..a420223 100644 --- a/.env +++ b/.env @@ -22,4 +22,4 @@ EXPLORER_PORT=8081 GRAFANA_TAG=8.5.4 GF_SECURITY_ADMIN_PASSWORD=xmrsh-admin -PROMETHEUS_TAG=2.36.0 +PROMETHEUS_TAG=v2.36.0 diff --git a/docker-compose.yml b/docker-compose.yml index ca3d72d..222e8b8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,12 @@ version: "3.7" +x-log-config: &log-config + logging: + driver: json-file + options: + max-size: "50m" + max-file: "20" + x-traefik-command-le: &traefik-command-le command: - "--log.level=${TRAEFIK_LOGLEVEL}" @@ -44,6 +51,7 @@ x-tor-service: &tor-service MONEROD_TOR_SERVICE_HOSTS: "${TOR_HTTP_PORT}:monerod:${MONEROD_RESTRICTED_RPC_PORT}" volumes: - ./data/tor:/var/lib/tor/hidden_service/ + <<: *log-config x-explorer-service: &explorer-service explorer: @@ -67,13 +75,15 @@ x-explorer-service: &explorer-service - "traefik.http.routers.explorer.tls" - "traefik.http.routers.explorer.service=explorer" - "traefik.http.services.explorer.loadbalancer.server.port=${EXPLORER_PORT}" + <<: *log-config x-monero-exporter-service: &monero-exporter-service monero-exporter: command: - --monero-addr=http://monerod:${MONEROD_RPC_PORT} container_name: monero-exporter - image: utxobr/monero-exporter@sha256:737413b1054583535e835e1417b61a8d59a4c08723e4a15c61c4249c2a7d69a4 + image: vdo1138/monero-exporter:0.0.2 + <<: *log-config x-grafana-service: &grafana-service grafana: @@ -102,6 +112,7 @@ x-grafana-service: &grafana-service - "traefik.http.routers.grafana.tls" - "traefik.http.routers.grafana.service=grafana" - "traefik.http.services.grafana.loadbalancer.server.port=3000" + <<: *log-config x-prometheus-service: &prometheus-service prometheus: @@ -111,10 +122,11 @@ x-prometheus-service: &prometheus-service - --storage.tsdb.path=/data - --storage.tsdb.retention.time=30d container_name: prometheus - image: bitnami/prometheus:${PROMETHEUS_TAG} + image: prom/prometheus:${PROMETHEUS_TAG} volumes: - ./data/prometheus:/data - ./config/prometheus/config.yaml:/etc/prometheus/config.yaml:ro + <<: *log-config x-watchtower-service: &watchtower-service watchtower: @@ -125,6 +137,7 @@ x-watchtower-service: &watchtower-service labels: - com.centurylinklabs.watchtower.enable="false" command: --interval 360 --include-stopped + <<: *log-config services: traefik: @@ -138,6 +151,8 @@ services: - "/var/run/docker.sock:/var/run/docker.sock:ro" <<: *traefik-command-nole #!traefik-command restart: always + <<: *log-config + monerod: container_name: monerod image: sethsimmons/simple-monerod:${MONEROD_TAG} @@ -158,6 +173,7 @@ services: # - "traefik.http.middlewares.corsheader.headers.accessControlAllowOriginList=${MONEROD_accessControlAllowOriginList}" #!cors # - "traefik.http.routers.monerod.middlewares=corsheader" #!cors restart: unless-stopped + <<: *log-config # <<: *tor-service #!tor # <<: *explorer-service #!explorer From 1fd10d8cde6d5a5ce9dc4636b99d0961fbf8d669 Mon Sep 17 00:00:00 2001 From: vdo Date: Wed, 8 Jun 2022 12:39:18 +0100 Subject: [PATCH 35/46] add lws service --- .env | 5 +++++ docker-compose.yml | 30 ++++++++++++++++++++++++++++++ install | 20 ++++++++++++++++++-- 3 files changed, 53 insertions(+), 2 deletions(-) diff --git a/.env b/.env index a420223..9806607 100644 --- a/.env +++ b/.env @@ -10,9 +10,14 @@ MONEROD_TAG=latest MONEROD_RPC_PORT=18081 MONEROD_RESTRICTED_RPC_PORT=18089 MONEROD_P2P_PORT=18080 +MONEROD_ZMQ_RPC_PORT=18082 +MONEROD_ZMQ_PUB_PORT=18083 MONEROD_EXTRA_PARAMS= MONEROD_accessControlAllowOriginList=* +LWS_TAG=0.17-15bce7f +LWS_PORT=8000 + #TOR_TAG=latest TOR_TAG=0.4.7.7 TOR_HTTP_PORT=80 diff --git a/docker-compose.yml b/docker-compose.yml index 222e8b8..734610f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -38,6 +38,7 @@ x-monerod-command: &monerod-command --public-node --no-igd --no-zmq --enable-dns-blocklist --rpc-restricted-bind-ip=0.0.0.0 --rpc-restricted-bind-port=${MONEROD_RESTRICTED_RPC_PORT} --confirm-external-bind + --zmq-pub tcp://0.0.0.0:${MONEROD_ZMQ_PUB_PORT}--zmq-rpc-bind-port=${MONEROD_ZMQ_RPC_PORT} --zmq-rpc-bind-ip=0.0.0.0 --rpc-bind-port=${MONEROD_RPC_PORT} --rpc-bind-ip=0.0.0.0 ${MONEROD_EXTRA_PARAMS} @@ -77,6 +78,34 @@ x-explorer-service: &explorer-service - "traefik.http.services.explorer.loadbalancer.server.port=${EXPLORER_PORT}" <<: *log-config +x-monero-lws-service: &monero-lws-service + monero-lws: + image: vdo1138/monero-lws:${LWS_TAG} + container_name: monero-lws + restart: unless-stopped + command: >- + --rest-server http://0.0.0.0:8000 --daemon=tcp://monerod:${MONEROD_ZMQ_RPC_PORT} + --sub=tcp://monerod:${MONEROD_ZMQ_SUB_PORT} --log-level=4 + --confirm-external-bind + volumes: + - ./data/monero-lws:/home/monero-lws/.bitmonero/ + # ports: + # - ${LWS_PORT} + depends_on: + - monerod + labels: + - "traefik.enable=true" + - "traefik.http.routers.monero-lws.rule=(PathPrefix(`/lws`) )" #!nole + # - "traefik.http.routers.monero-lws.rule=(Host(`${DOMAIN}`) && PathPrefix(`/monero-lws`) )" #!le + # - "traefik.http.routers.monero-lws.tls.certresolver=le" #!le + - "traefik.http.middlewares.stripprefix-monero-lws.stripprefix.prefixes=/lws" + - "traefik.http.routers.monero-lws.middlewares=stripprefix-monero-lws" + - "traefik.http.routers.monero-lws.entrypoints=websecure" + - "traefik.http.routers.monero-lws.tls" + - "traefik.http.routers.monero-lws.service=monero-lws" + - "traefik.http.services.monero-lws.loadbalancer.server.port=${LWS_PORT}" + <<: *log-config + x-monero-exporter-service: &monero-exporter-service monero-exporter: command: @@ -177,6 +206,7 @@ services: # <<: *tor-service #!tor # <<: *explorer-service #!explorer + # <<: *monero-lws-service #!lws # <<: *monero-exporter-service #!monero-exporter # <<: *grafana-service #!grafana # <<: *prometheus-service #!prometheus diff --git a/install b/install index 6da2356..adaeda4 100755 --- a/install +++ b/install @@ -301,6 +301,22 @@ configure_explorer() { done } +configure_lws() { + echo -e "${OkBullet}Configuring LWS..." + while true; do + read -r -e -p " Do you want to enable the light wallet service? [y/n]: " yn + case $yn in + [Yy]*) + sed -i '/#!lws/s/# //g' docker-compose.yml + ENABLE_LWS=true + break + ;; + [Nn]*) break ;; + *) echo " Please answer yes or no." ;; + esac + done +} + configure_grafana() { echo -e "${OkBullet}Configuring grafana..." while true; do @@ -419,14 +435,14 @@ configure_network configure_tls_domain configure_tls_port configure_pruning +configure_lws configure_cors - configure_tor # Deployment of explorer disabled until it's stable. # configure_explorer configure_watchtower configure_grafana -# configure_lws + start_xmrsh completed From 7b4495d55147b4582693915a2b0be9e527015a6b Mon Sep 17 00:00:00 2001 From: vdo Date: Wed, 8 Jun 2022 13:41:37 +0100 Subject: [PATCH 36/46] zmq params, exec order --- data/monero-lws/.gitignore | 4 ++++ docker-compose.yml | 4 ++-- install | 6 +++--- 3 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 data/monero-lws/.gitignore diff --git a/data/monero-lws/.gitignore b/data/monero-lws/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/data/monero-lws/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/docker-compose.yml b/docker-compose.yml index 734610f..d15434d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -35,7 +35,7 @@ x-traefik-command-nole: &traefik-command-nole x-monerod-command: &monerod-command command: >- - --public-node --no-igd --no-zmq + --public-node --no-igd --enable-dns-blocklist --rpc-restricted-bind-ip=0.0.0.0 --rpc-restricted-bind-port=${MONEROD_RESTRICTED_RPC_PORT} --confirm-external-bind --zmq-pub tcp://0.0.0.0:${MONEROD_ZMQ_PUB_PORT}--zmq-rpc-bind-port=${MONEROD_ZMQ_RPC_PORT} --zmq-rpc-bind-ip=0.0.0.0 @@ -85,7 +85,7 @@ x-monero-lws-service: &monero-lws-service restart: unless-stopped command: >- --rest-server http://0.0.0.0:8000 --daemon=tcp://monerod:${MONEROD_ZMQ_RPC_PORT} - --sub=tcp://monerod:${MONEROD_ZMQ_SUB_PORT} --log-level=4 + --sub=tcp://monerod:${MONEROD_ZMQ_PUB_PORT} --log-level=4 --confirm-external-bind volumes: - ./data/monero-lws:/home/monero-lws/.bitmonero/ diff --git a/install b/install index adaeda4..b54c164 100755 --- a/install +++ b/install @@ -340,7 +340,7 @@ configure_grafana() { configure_watchtower() { echo -e "${OkBullet}Configuring watchtower..." while true; do - read -r -e -p " Do you want to enable automatic updates using watchtower? [y/n]: " yn + read -r -e -p " Do you want to enable automatic node updates using watchtower? [y/n]: " yn case $yn in [Yy]*) sed -i '/#!watchtower/s/# //g' docker-compose.yml @@ -435,13 +435,13 @@ configure_network configure_tls_domain configure_tls_port configure_pruning -configure_lws configure_cors configure_tor +configure_lws # Deployment of explorer disabled until it's stable. # configure_explorer -configure_watchtower configure_grafana +configure_watchtower start_xmrsh completed From f0f02adb81c2603a7945c67422ba20e37cf77111 Mon Sep 17 00:00:00 2001 From: vdo Date: Wed, 8 Jun 2022 14:21:15 +0100 Subject: [PATCH 37/46] add restart rules --- docker-compose.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index d15434d..b34a4da 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -46,6 +46,7 @@ x-tor-service: &tor-service tor: container_name: tor image: vdo1138/tor-hidden-service:${TOR_TAG} + restart: unless-stopped links: - monerod environment: @@ -111,6 +112,7 @@ x-monero-exporter-service: &monero-exporter-service command: - --monero-addr=http://monerod:${MONEROD_RPC_PORT} container_name: monero-exporter + restart: unless-stopped image: vdo1138/monero-exporter:0.0.2 <<: *log-config @@ -120,6 +122,7 @@ x-grafana-service: &grafana-service command: - -config=/etc/grafana/grafana.ini container_name: grafana + restart: unless-stopped image: grafana/grafana:${GRAFANA_TAG} ports: - 3000 @@ -151,6 +154,7 @@ x-prometheus-service: &prometheus-service - --storage.tsdb.path=/data - --storage.tsdb.retention.time=30d container_name: prometheus + restart: unless-stopped image: prom/prometheus:${PROMETHEUS_TAG} volumes: - ./data/prometheus:/data @@ -160,6 +164,7 @@ x-prometheus-service: &prometheus-service x-watchtower-service: &watchtower-service watchtower: container_name: watchtower + restart: unless-stopped image: containrrr/watchtower:latest volumes: - /var/run/docker.sock:/var/run/docker.sock From 821b8cf8a1110aa40996c74506a1893a0d555306 Mon Sep 17 00:00:00 2001 From: vdo Date: Wed, 8 Jun 2022 14:30:24 +0100 Subject: [PATCH 38/46] Version bump, README, lws url --- README.md | 5 +++-- install | 7 +++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 619111d..02f92ff 100644 --- a/README.md +++ b/README.md @@ -31,12 +31,13 @@ Check the [wiki](https://github.com/vdo/xmr.sh/wiki/FAQ) - [x] Make tor service optional - [x] Block explorer (disabled) - [x] Grafana dashboard +- [x] arm64 support for all images +- [x] monerod-lws support (experimental) - [ ] Shellcheck via Github Actions - [ ] Installation documentation -- [ ] arm64 support for all images -- [ ] monerod-lws support - [ ] monerod-proxy support for random node forwarding - [ ] i2p service +- [ ] p2pool mining # Credits diff --git a/install b/install index b54c164..6c909d2 100755 --- a/install +++ b/install @@ -28,7 +28,7 @@ StatInfo="${White}${On_Black}" ################################################################ # Vars # ################################################################ -VERSION="v0.3.2" +VERSION="v0.3.3" XMRSH_INSTALL_CMD="sudo bash -c \"\$(curl -sLSf https://get.xmr.sh)\"" XMRSH_DIR="/opt/xmr.sh" XMRSH_BRANCH="main" @@ -304,7 +304,7 @@ configure_explorer() { configure_lws() { echo -e "${OkBullet}Configuring LWS..." while true; do - read -r -e -p " Do you want to enable the light wallet service? [y/n]: " yn + read -r -e -p " Do you want to enable the light wallet service (experimental)? [y/n]: " yn case $yn in [Yy]*) sed -i '/#!lws/s/# //g' docker-compose.yml @@ -404,6 +404,9 @@ completed() { if [ "$ENABLE_EXPLORER" = true ]; then echo -e " ${Red}│${Stat} Explorer URL: ${StatInfo}https://${HOST}${PORT_SUFF}/explorer" fi + if [ "$ENABLE_LWS" = true ]; then + echo -e " ${Red}│${Stat} LWS URL: ${StatInfo}https://${HOST}${PORT_SUFF}/lws" + fi if [ "$ENABLE_GRAFANA" = true ]; then echo -e " ${Red}│${Stat} Grafana URL: ${StatInfo}https://${HOST}${PORT_SUFF}/grafana" echo -e " ${Red}│${Stat} Grafana user: ${StatInfo}admin" From 02fad44359c302e7f0d4665484e0a63687c49294 Mon Sep 17 00:00:00 2001 From: vdo Date: Wed, 8 Jun 2022 15:06:54 +0100 Subject: [PATCH 39/46] add monero-lws-admin wrapper command --- docker-compose.yml | 2 +- monero-lws-admin | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100755 monero-lws-admin diff --git a/docker-compose.yml b/docker-compose.yml index b34a4da..d5805ec 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -97,7 +97,7 @@ x-monero-lws-service: &monero-lws-service labels: - "traefik.enable=true" - "traefik.http.routers.monero-lws.rule=(PathPrefix(`/lws`) )" #!nole - # - "traefik.http.routers.monero-lws.rule=(Host(`${DOMAIN}`) && PathPrefix(`/monero-lws`) )" #!le + # - "traefik.http.routers.monero-lws.rule=(Host(`${DOMAIN}`) && PathPrefix(`/lws`) )" #!le # - "traefik.http.routers.monero-lws.tls.certresolver=le" #!le - "traefik.http.middlewares.stripprefix-monero-lws.stripprefix.prefixes=/lws" - "traefik.http.routers.monero-lws.middlewares=stripprefix-monero-lws" diff --git a/monero-lws-admin b/monero-lws-admin new file mode 100755 index 0000000..4627df9 --- /dev/null +++ b/monero-lws-admin @@ -0,0 +1,2 @@ +#!/bin/bash +docker exec -ti monero-lws /usr/local/bin/monero-lws-admin ${@} From 8d003479f7bdcb21ccdea8cd72293b1fcce3b815 Mon Sep 17 00:00:00 2001 From: vdo Date: Thu, 9 Jun 2022 09:05:25 +0100 Subject: [PATCH 40/46] lws extra params --- .env | 1 + README.md | 2 +- docker-compose.yml | 4 ++-- install | 2 ++ 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.env b/.env index 9806607..540cba7 100644 --- a/.env +++ b/.env @@ -17,6 +17,7 @@ MONEROD_accessControlAllowOriginList=* LWS_TAG=0.17-15bce7f LWS_PORT=8000 +LWS_EXTRA_PARAMS= #TOR_TAG=latest TOR_TAG=0.4.7.7 diff --git a/README.md b/README.md index 02f92ff..b076a14 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ Check the [wiki](https://github.com/vdo/xmr.sh/wiki/FAQ) - [x] arm64 support for all images - [x] monerod-lws support (experimental) - [ ] Shellcheck via Github Actions -- [ ] Installation documentation +- [ ] Documentation - [ ] monerod-proxy support for random node forwarding - [ ] i2p service - [ ] p2pool mining diff --git a/docker-compose.yml b/docker-compose.yml index d5805ec..b0babed 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -38,7 +38,7 @@ x-monerod-command: &monerod-command --public-node --no-igd --enable-dns-blocklist --rpc-restricted-bind-ip=0.0.0.0 --rpc-restricted-bind-port=${MONEROD_RESTRICTED_RPC_PORT} --confirm-external-bind - --zmq-pub tcp://0.0.0.0:${MONEROD_ZMQ_PUB_PORT}--zmq-rpc-bind-port=${MONEROD_ZMQ_RPC_PORT} --zmq-rpc-bind-ip=0.0.0.0 + --zmq-pub tcp://0.0.0.0:${MONEROD_ZMQ_PUB_PORT} --zmq-rpc-bind-port=${MONEROD_ZMQ_RPC_PORT} --zmq-rpc-bind-ip=0.0.0.0 --rpc-bind-port=${MONEROD_RPC_PORT} --rpc-bind-ip=0.0.0.0 ${MONEROD_EXTRA_PARAMS} @@ -87,7 +87,7 @@ x-monero-lws-service: &monero-lws-service command: >- --rest-server http://0.0.0.0:8000 --daemon=tcp://monerod:${MONEROD_ZMQ_RPC_PORT} --sub=tcp://monerod:${MONEROD_ZMQ_PUB_PORT} --log-level=4 - --confirm-external-bind + --confirm-external-bind ${LWS_EXTRA_PARAMS} volumes: - ./data/monero-lws:/home/monero-lws/.bitmonero/ # ports: diff --git a/install b/install index 6c909d2..00cc806 100755 --- a/install +++ b/install @@ -187,12 +187,14 @@ configure_network() { NETWORK="testnet" sed -i "s/MONEROD_P2P_PORT=.*/MONEROD_P2P_PORT=28080/g" .env sed -i "/MONEROD_EXTRA_PARAMS/s/$/ --testnet/g" .env + sed -i "/LWS_EXTRA_PARAMS/s/$/ --network test/g" .env break ;; "stagenet") NETWORK="stagenet" sed -i "s/MONEROD_P2P_PORT=.*/MONEROD_P2P_PORT=38080/g" .env sed -i "/MONEROD_EXTRA_PARAMS/s/$/ --stagenet/g" .env + sed -i "/LWS_EXTRA_PARAMS/s/$/ --network stage/g" .env break ;; *) echo "Invalid network choice!" ;; From 0b40c1521d572e3a5527583842ff0bf480184a45 Mon Sep 17 00:00:00 2001 From: vdo Date: Thu, 9 Jun 2022 10:12:13 +0100 Subject: [PATCH 41/46] Asciinema v0.3.3 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b076a14..a8fa7b9 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Other distributions with docker pre-installed would probably be compatible as we ## Demo -[![asciicast](https://asciinema.org/a/DvAz3ygotWYfODOP3duvLbDfv.svg)](https://asciinema.org/a/DvAz3ygotWYfODOP3duvLbDfv) +[![asciicast](https://asciinema.org/a/1gL7tNhb3XgPUr26losgZaeCJ.svg)](https://asciinema.org/a/1gL7tNhb3XgPUr26losgZaeCJ) ## FAQ From 290f00e2dcf5e2c0bb1132f9bac5bad9821886b4 Mon Sep 17 00:00:00 2001 From: vdo Date: Thu, 11 Aug 2022 10:39:14 +0100 Subject: [PATCH 42/46] adding p2pool service --- .env | 5 +++++ docker-compose.yml | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/.env b/.env index 540cba7..79108f4 100644 --- a/.env +++ b/.env @@ -26,6 +26,11 @@ TOR_HTTP_PORT=80 EXPLORER_TAG=v0.17 EXPLORER_PORT=8081 +P2POOL_WALLET= +P2POOL_STRATUM_PORT=3333 +P2POOL_P2P_PORT=37889 +P2POOL_PEERS=65.21.227.114:37889,node.sethforprivacy.com:37889 + GRAFANA_TAG=8.5.4 GF_SECURITY_ADMIN_PASSWORD=xmrsh-admin PROMETHEUS_TAG=v2.36.0 diff --git a/docker-compose.yml b/docker-compose.yml index b0babed..c69cb89 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -116,6 +116,24 @@ x-monero-exporter-service: &monero-exporter-service image: vdo1138/monero-exporter:0.0.2 <<: *log-config +x-p2pool-service: &p2pool-service + p2pool: + image: sethsimmons/p2pool:latest + restart: unless-stopped + container_name: p2pool + #tty: true + #stdin_open: true + volumes: + - ./data/p2pool:/home/p2pool + # - /dev/hugepages:/dev/hugepages:rw + ports: + - ${P2POOL_STRATUM_PORT}:${P2POOL_STRATUM_PORT} + - ${P2POOL_P2P_PORT}:${P2POOL_P2P_PORT} + command: >- + --wallet "${P2POOL_WALLET}" + --stratum "0.0.0.0:${P2POOL_STRATUM_PORT}" --p2p "0.0.0.0:${P2POOL_P2P_PORT}" --rpc-port "${MONEROD_RPC_PORT}" + --addpeers "P2POOL_PEERS" --host "monerod" + x-grafana-service: &grafana-service grafana: user: "1000" @@ -213,6 +231,7 @@ services: # <<: *explorer-service #!explorer # <<: *monero-lws-service #!lws # <<: *monero-exporter-service #!monero-exporter + # <<: *p2pool-service #!p2pool # <<: *grafana-service #!grafana # <<: *prometheus-service #!prometheus # <<: *watchtower-service #!watchtower From 3f8df0605875c55ac2f75a3f00188a65a47eaf32 Mon Sep 17 00:00:00 2001 From: vdo Date: Wed, 7 Sep 2022 08:48:07 +0100 Subject: [PATCH 43/46] Bump versions, add p2pool step --- .env | 8 ++++---- docker-compose.yml | 8 ++++---- install | 27 ++++++++++++++++++++++++++- 3 files changed, 34 insertions(+), 9 deletions(-) diff --git a/.env b/.env index 79108f4..efb135f 100644 --- a/.env +++ b/.env @@ -15,18 +15,18 @@ MONEROD_ZMQ_PUB_PORT=18083 MONEROD_EXTRA_PARAMS= MONEROD_accessControlAllowOriginList=* -LWS_TAG=0.17-15bce7f +LWS_TAG=v0.2_0.18 LWS_PORT=8000 LWS_EXTRA_PARAMS= #TOR_TAG=latest -TOR_TAG=0.4.7.7 +TOR_TAG=v0.4.7.8-57f8867 TOR_HTTP_PORT=80 -EXPLORER_TAG=v0.17 +EXPLORER_TAG=v0.18 EXPLORER_PORT=8081 -P2POOL_WALLET= +P2POOL_WALLET=changeme P2POOL_STRATUM_PORT=3333 P2POOL_P2P_PORT=37889 P2POOL_PEERS=65.21.227.114:37889,node.sethforprivacy.com:37889 diff --git a/docker-compose.yml b/docker-compose.yml index c69cb89..6c89394 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -45,7 +45,7 @@ x-monerod-command: &monerod-command x-tor-service: &tor-service tor: container_name: tor - image: vdo1138/tor-hidden-service:${TOR_TAG} + image: goldy/tor-hidden-service:${TOR_TAG} restart: unless-stopped links: - monerod @@ -84,14 +84,14 @@ x-monero-lws-service: &monero-lws-service image: vdo1138/monero-lws:${LWS_TAG} container_name: monero-lws restart: unless-stopped + security_opt: + - "no-new-privileges:true" command: >- --rest-server http://0.0.0.0:8000 --daemon=tcp://monerod:${MONEROD_ZMQ_RPC_PORT} --sub=tcp://monerod:${MONEROD_ZMQ_PUB_PORT} --log-level=4 --confirm-external-bind ${LWS_EXTRA_PARAMS} volumes: - ./data/monero-lws:/home/monero-lws/.bitmonero/ - # ports: - # - ${LWS_PORT} depends_on: - monerod labels: @@ -132,7 +132,7 @@ x-p2pool-service: &p2pool-service command: >- --wallet "${P2POOL_WALLET}" --stratum "0.0.0.0:${P2POOL_STRATUM_PORT}" --p2p "0.0.0.0:${P2POOL_P2P_PORT}" --rpc-port "${MONEROD_RPC_PORT}" - --addpeers "P2POOL_PEERS" --host "monerod" + --addpeers "P2POOL_PEERS" --host "monerod" --no-randomx x-grafana-service: &grafana-service grafana: diff --git a/install b/install index 00cc806..7ed85e7 100755 --- a/install +++ b/install @@ -319,6 +319,28 @@ configure_lws() { done } +configure_p2pool() { + echo -e "${OkBullet}Configuring p2pool..." + while true; do + read -r -e -p " Do you want to enable the p2pool service? [y/n]: " yn + case $yn in + [Yy]*) + read -r -e -p " Enter the desired primary address which will recieve the rewards. []: " P2P_ADDRESS + while ! echo "${P2P_ADDRESS}" | grep -qP '(4|5|9|A)[a-zA-Z|\d]{94}'; do + echo -e "${WarnBullet}Address is not valid. Remember: subaddresses are not supported by p2pool." + read -r -p " Enter again your primary address: " P2P_ADDRESS + done + sed -i "s/P2POOL_WALLET=.*/P2POOL_WALLET=${P2P_ADDRESS}/g" .env + sed -i '/#!p2pool/s/# //g' docker-compose.yml + ENABLE_P2POOL=true + break + ;; + [Nn]*) break ;; + *) echo " Please answer yes or no." ;; + esac + done +} + configure_grafana() { echo -e "${OkBullet}Configuring grafana..." while true; do @@ -409,6 +431,9 @@ completed() { if [ "$ENABLE_LWS" = true ]; then echo -e " ${Red}│${Stat} LWS URL: ${StatInfo}https://${HOST}${PORT_SUFF}/lws" fi + if [ "$ENABLE_P2POOL" = true ]; then + echo -e " ${Red}│${Stat} P2Pool stratum: ${StatInfo}${HOST}:3333" + fi if [ "$ENABLE_GRAFANA" = true ]; then echo -e " ${Red}│${Stat} Grafana URL: ${StatInfo}https://${HOST}${PORT_SUFF}/grafana" echo -e " ${Red}│${Stat} Grafana user: ${StatInfo}admin" @@ -444,7 +469,7 @@ configure_cors configure_tor configure_lws # Deployment of explorer disabled until it's stable. -# configure_explorer +configure_explorer configure_grafana configure_watchtower From 8a741fe0e1f82f5f07a7fae313addf1fe6c82111 Mon Sep 17 00:00:00 2001 From: vdo Date: Mon, 12 Sep 2022 12:35:13 +0100 Subject: [PATCH 44/46] disable explorer, enable p2pool --- install | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install b/install index 7ed85e7..f2eef34 100755 --- a/install +++ b/install @@ -468,8 +468,9 @@ configure_pruning configure_cors configure_tor configure_lws +configure_p2pool # Deployment of explorer disabled until it's stable. -configure_explorer +# configure_explorer configure_grafana configure_watchtower From a5708005388f2fce22c74283eb485dfc53ed0314 Mon Sep 17 00:00:00 2001 From: vdo Date: Fri, 16 Sep 2022 12:25:49 +0100 Subject: [PATCH 45/46] Bump version --- install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install b/install index f2eef34..aca7cb7 100755 --- a/install +++ b/install @@ -28,7 +28,7 @@ StatInfo="${White}${On_Black}" ################################################################ # Vars # ################################################################ -VERSION="v0.3.3" +VERSION="v0.4.0" XMRSH_INSTALL_CMD="sudo bash -c \"\$(curl -sLSf https://get.xmr.sh)\"" XMRSH_DIR="/opt/xmr.sh" XMRSH_BRANCH="main" From 9bf2d794e7a27fdf97434c80d7df80f34b4e67e8 Mon Sep 17 00:00:00 2001 From: vdo Date: Fri, 16 Sep 2022 12:27:22 +0100 Subject: [PATCH 46/46] tor from vdo1138 for arm64 support --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 6c89394..368b5c4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -45,7 +45,7 @@ x-monerod-command: &monerod-command x-tor-service: &tor-service tor: container_name: tor - image: goldy/tor-hidden-service:${TOR_TAG} + image: vdo1138/tor-hidden-service:${TOR_TAG} restart: unless-stopped links: - monerod