pharos exporter for validators
Run the start command with your RPC endpoint, BLS key, validator address and log path:
go run . start \
-rpc https://YOUR_RPC \
-my-bls-key 0xYOUR_BLS_KEY \
-my-address 0xYOUR_VALIDATOR_ADDRESS \
-my-node-id YOUR_NODE_ID \
-log-path /data/pharos-node/domain/light/log/consensus.log-log-from-startreads the log from the beginning; omit it to tail only new lines.- The log tailer follows file rotation (e.g.
consensus.logrenamed toconsensus.log.x). -check-block-proof,-check-validator-set,-check-proposeand-check-endorseare enabled by default.
Use -h to see all available flags and defaults:
go run . start -hExample output:
Usage of start:
-check-block-proof
check signedBlsKeys metrics (default true)
-check-endorse
check endorse metrics (default true)
-check-propose
check propose metrics (default true)
-check-validator-set
check validator set metrics (default true)
-exporter-port string
metrics listen port (default "9123")
-log-from-start
start reading log from beginning (default: false)
-log-path string
path to log file to tail
-log-poll-interval duration
poll interval for log tailing (default 1s)
-my-address string
my EVM address to track balance (0x...)
-my-node-id string
my node id
-my-bls-key string
my BLS pubkey (0x...)
-rpc string
JSON-RPC endpoint (default "https://atlantic-rpc.dplabs-internal.com/")
-rpc-poll-interval duration
poll interval for latest block (default 1s)
The /metrics endpoint includes default Go/process/promhttp metrics. Custom metrics exposed by this exporter:
validator_active_timestamp(gauge): Unix timestamp when validator active status was last observed.validator_active_total(counter): Total number of blocks where the validator was active in the validator set.validator_endorse_total(counter): Total number of endorse events observed in logs.validator_last_endorse_timestamp(gauge): Unix timestamp of the last endorse event observed in logs.validator_last_propose_timestamp(gauge): Unix timestamp of the last propose event observed in logs.validator_propose_total(counter): Total number of propose attempts observed in logs.validator_vote_inclusion_timestamp(gauge): Unix timestamp when the validator vote was last included.validator_vote_inclusion_total(counter): Total number of blocks where the validator vote was included.validator_address_balance_eth(gauge): ETH balance of the validator address
Build the binary and install it to /usr/local/bin:
go build -o pharos-exporter .
sudo mv pharos-exporter /usr/local/bin/Copy the example service unit and update the placeholders:
sudo cp pharos-exporter.service.example /etc/systemd/system/pharos-exporter.service
sudo sed -i 's|<https://YOUR_RPC>|https://YOUR_RPC|g' /etc/systemd/system/pharos-exporter.service
sudo sed -i 's|<0xYOUR_BLS_KEY>|0xYOUR_BLS_KEY|g' /etc/systemd/system/pharos-exporter.service
sudo sed -i 's|<0xYOUR_VALIDATOR_ADDRESS>|0xYOUR_VALIDATOR_ADDRESS|g' /etc/systemd/system/pharos-exporter.service
sudo sed -i 's|<YOUR_NODE_ID>|YOUR_NODE_ID|g' /etc/systemd/system/pharos-exporter.service
sudo sed -i 's|<YOUR_LOG_PATH>|YOUR_LOG_PATH|g' /etc/systemd/system/pharos-exporter.serviceReload systemd and start the service:
sudo systemctl daemon-reload
sudo systemctl enable --now pharos-exporter