Layer values monitor
Project description
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:
- Command-line parameters: Pass the
--use-custom-configflag 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file layer_values_monitor-0.1.1.tar.gz.
File metadata
- Download URL: layer_values_monitor-0.1.1.tar.gz
- Upload date:
- Size: 88.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e02b50107827b71c0ac3ec61b60897a6add4e02e6826096f775b60c9822d403a
|
|
| MD5 |
e5353857bca70058b484f88de8edd9b6
|
|
| BLAKE2b-256 |
ba713722fe0068ea7f1e9069a07f8d0a7a266ce62a6ccafe18aa8007c56b03a3
|
Provenance
The following attestation bundles were made for layer_values_monitor-0.1.1.tar.gz:
Publisher:
release.yml on tellor-io/layer-values-monitor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
layer_values_monitor-0.1.1.tar.gz -
Subject digest:
e02b50107827b71c0ac3ec61b60897a6add4e02e6826096f775b60c9822d403a - Sigstore transparency entry: 186543194
- Sigstore integration time:
-
Permalink:
tellor-io/layer-values-monitor@04d8c825018d3bea772ecc6a9f0137f8ba4a79ee -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/tellor-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@04d8c825018d3bea772ecc6a9f0137f8ba4a79ee -
Trigger Event:
release
-
Statement type:
File details
Details for the file layer_values_monitor-0.1.1-py3-none-any.whl.
File metadata
- Download URL: layer_values_monitor-0.1.1-py3-none-any.whl
- Upload date:
- Size: 14.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9fc3820210a942ff75df1127197cf8140157ee77751e945521fc3f39e364fe92
|
|
| MD5 |
736a168e88351227217554a8f6447d5d
|
|
| BLAKE2b-256 |
9b7c5eeeb1446f62bde481ab2286edb961bd7e450f246a7f9341fdaf7307c703
|
Provenance
The following attestation bundles were made for layer_values_monitor-0.1.1-py3-none-any.whl:
Publisher:
release.yml on tellor-io/layer-values-monitor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
layer_values_monitor-0.1.1-py3-none-any.whl -
Subject digest:
9fc3820210a942ff75df1127197cf8140157ee77751e945521fc3f39e364fe92 - Sigstore transparency entry: 186543195
- Sigstore integration time:
-
Permalink:
tellor-io/layer-values-monitor@04d8c825018d3bea772ecc6a9f0137f8ba4a79ee -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/tellor-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@04d8c825018d3bea772ecc6a9f0137f8ba4a79ee -
Trigger Event:
release
-
Statement type: