Skip to content

Repository files navigation

Monitor

This project is a monitoring program to monitor whether the light client synchronization is normal,

whether the transaction is cross-chain, and the user balance

Configuration

Use a valid config.json for runtime configuration. Keep production config files and keystores out of git.

Options

{
  "lightnode": "0x12345...",                              // the lightnode to sync header
  "waterLine": "5000000000000000000",                     // If the user balance is lower than, an alarm will be triggered, unit : wei
  "changeInterval": "3000",                               // How long does the lightnode height remain unchanged, triggering the alarm, use for near unit : seconds
  "checkHeightCount": "20",                               // How long does the lightnode height not change remain unchanged, triggering the alarm, default 15
  "syncHeightAlarm": "false",                              // Optional: disable other-chain-to-map sync height alarm, default true
}

Env

export hooks="https://hooks.slack.com/services/xxx/yyy/zzz"

Docker Deployment

The container uses /app/runtime as its runtime directory. Map one host directory to it and keep config.json, keys/, and generated state files in that host directory.

sudo mkdir -p /opt/bridge-monitor/keys
sudo cp /path/to/your/config.json /opt/bridge-monitor/config.json

cp .env.example .env
vim .env

docker compose up -d --build
docker compose logs -f bridge-monitor

If the github.com/lbtsm/* Go modules are private, set a GitHub token with read access before building locally:

export LBTSM_REPO_TOKEN="github_pat_xxx"
docker compose up -d --build

After pulling updates on the server:

git pull
docker compose up -d --build

GitHub Actions builds and tests the project on pull requests, and builds the Docker image on pushes to main, master, or version tags. Non-PR builds are published to GitHub Container Registry as ghcr.io/<owner>/<repo>:<branch-or-tag>. The default branch also publishes ghcr.io/<owner>/<repo>:latest.

For private github.com/lbtsm/* dependencies, add a repository secret named LBTSM_REPO_TOKEN with read access to the private dependency repositories.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages