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 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_threshold Lowest level dispute category threshold
minor_threshold Middle level dispute category threshold
major_threshold 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.4.tar.gz (90.7 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.4-py3-none-any.whl (18.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: layer_values_monitor-0.1.4.tar.gz
  • Upload date:
  • Size: 90.7 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.4.tar.gz
Algorithm Hash digest
SHA256 aeca756c61343cc327d4762e9db5ac16cda22466e08e05f0b267f0df6de02447
MD5 c0d817356f157f89a2d7de4862edf047
BLAKE2b-256 ec06126f76178956ecf8b270acb3106de3a1d6fe11fd4f273d46206fde3e41f6

See more details on using hashes here.

Provenance

The following attestation bundles were made for layer_values_monitor-0.1.4.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.4-py3-none-any.whl.

File metadata

File hashes

Hashes for layer_values_monitor-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 4048b3a886f37bf071d8502fac1017e4457b44efe70ea7f6ea2406bb4a9b2d64
MD5 790bb6ccc6300e3a33be93993abd2642
BLAKE2b-256 efa7d8da981aa53beada5a40153bf36acbd59dbd25dbe35826b253fe59a9237e

See more details on using hashes here.

Provenance

The following attestation bundles were made for layer_values_monitor-0.1.4-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