Skip to main content

Layer values monitor

Project description

Unit Tests Ruff

Layer Values Monitor

Install uv

https://docs.astral.sh/uv/#installation

Create virtual environment

uv venv
# https://docs.astral.sh/uv/reference/cli/#uv-venv

Tests

uv run pytest

Values monitor

uv run layer-values-monitor \
--use-custom-config \
binary_path=./layer \
key_name=alice \
keyring_backend=test \
keyring_dir=~/.layer/alice \
payfrom_bond=False

Configuration

The Layer Values Monitor can be configured using either a configuration file or command-line parameters.

Global Configuration

The global configurations are set in the command-line and requires setting the alert threshold plus the different categories warning, minor, and major for all three threshold types: percentage, range, and equality. The configuration file is located in the parent directory at config.toml. This is where you can customize setting threshold values for monitoring by specific query ids.

Custom Configuration

To use custom configuration settings:

  1. Command-line parameters: Pass the --use-custom-config flag followed by key=value pairs as shown in the example above.

Required args for starting the monitor

Args Description
binary_path Path to the Layer executable
key_name Name of the key to use for signing transactions
keyring_backend Keyring backend to use (ie os, test)
keyring_dir Directory for the keyring
payfrom_bond Whether to use the bond for paying transaction fees

Option 1

Set the global threshold for monitoring all the submitted values.

Args Description
--global-percentage-alert-threshold Percentage alert threshold
--global-percentage-warning-threshold Percentage warning level threshold
--global-percentage-minor-threshold Percentage minor level threshold
--global-percentage-major-threshold Percentage major level threshold
--global-range-alert-threshold Range alert threshold
--global-range-warning-threshold Range warning level threshold
--global-range-minor-threshold Range minor level threshold
--global-range-major-threshold Range major level threshold
--global-equality-threshold Directory for the keyring

Option 2

For only monitoring the config.toml file set the following flag: --use-custom-config with the above required args.

Option 3

Do both option 1 and 2. Set the global thresholds without the --use-custom-config flag and add custom configurations to the config.toml

ENV file configs (required)

Variables Description
CHAIN_ID Chain ID of the Layer network (ie layer-testnet)
URI URI of the Layer node to connect to (ie http://localhost:26657)
DISCORD_WEBHOOK_URL_1 Discord webhook url to recieve to notifications on

Threshold Settings

The configuration file also allows you to set thresholds for monitoring values. These thresholds determine when the monitor should take action.

Threshold Description
metric The metric to use for a specific query (percentage, range, equality)
alert_threshold the threshold for alerts only
warning Lowest level dispute category threshold
minor Middle level dispute category threshold
major Highest level in dispute category threshold

NOTE For disputing at minimum the warning category has to be set greater than 0. The thresholds should float types. The equality metric is 1.0 for True and 0.0 for False.

Example Config File (TOML format)

[some_random_query_id]
metric = "equality"
alert_threshold = 1.0
warning_threshold = 0.0
minor_threshold = 0.0
major_threshold = 0.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

layer_values_monitor-0.1.0.tar.gz (86.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

layer_values_monitor-0.1.0-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file layer_values_monitor-0.1.0.tar.gz.

File metadata

  • Download URL: layer_values_monitor-0.1.0.tar.gz
  • Upload date:
  • Size: 86.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for layer_values_monitor-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e9f85485ccfcf048e9c9486ea55fa81a052876859e6d756cd19e6a383cd8b9a2
MD5 6c19f894860239ab52a455cf92c234c0
BLAKE2b-256 ed1f15d76d99136d498b62f9551493bb3c781238ec82b5d315b806b5ac55fe9e

See more details on using hashes here.

Provenance

The following attestation bundles were made for layer_values_monitor-0.1.0.tar.gz:

Publisher: release.yml on tellor-io/layer-values-monitor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file layer_values_monitor-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for layer_values_monitor-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9a93affcaed2eb7f3119044bbc539b62b461a59f006d7ebae307cc3ab9562435
MD5 e127ce077fb25b01ba032a44eb7be19c
BLAKE2b-256 33604141fce4a773789744f938d529349129cb66788838b54b4efb5ac0abc23b

See more details on using hashes here.

Provenance

The following attestation bundles were made for layer_values_monitor-0.1.0-py3-none-any.whl:

Publisher: release.yml on tellor-io/layer-values-monitor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page