Skip to content

Latest commit

 

History

History

sentinel

Orakl sentinel

Orakl sentinel is a service for monitoring Orakl Service. It checks the service state regularly and sends a Slack message if required.

Project Structure

  • cmd: Holds the entry point (./cmd/main.go) to run the service.
  • pkg: Packages with implementations

Packages

  • alert: Alert package to send Slack messages on request.
  • checker: Checker implementations
  • request: HTTP Request Helper

Setup .env

# Log level for running the application, options such as `debug`, `info`, `error` are possible
LOG_LEVEL=error
# Infra chain info, defaults to baobab
CHAIN=baobab
# Health checker interval, defaults to 10s
HEALTH_CHECK_INTERVAL=10s
# Balance checker interval, this is balance update interval and defaults to 10s
BALANCE_CHECK_INTERVAL=10s
# Balance alarm interval, this is alarm interval and defaults to 30m
BALANCE_ALARM_INTERVAL=30m
# Minimal required balance for submitters, defaults to 25
SUBMITTER_ALARM_AMOUNT=25
# Minimal required balance for fee payer, defaults to 10000
DELEGATOR_ALARM_AMOUNT=10000

# (required) JSON RPC URL for on-chain calls
JSON_RPC_URL=
# (required) Orakl API URL to retrieve reporter addresses
ORAKL_API_URL=
# (required) Orakl Node Admin URL to retrieve wallet addresses
ORAKL_NODE_ADMIN_URL=
# (required) Orakl Delegator URL to retrieve fee payer address
ORAKL_DELEGATOR_URL=
# (required) POR URL to retrieve POR reporter address
POR_URL=
# (required) Slack webhook URL
SLACK_WEBHOOK_URL=
# (required) Submission proxy contract to read signer expiration
SUBMISSION_PROXY_CONTRACT=

Checkers

Health Checker

Calls health check URLs regularly and sends an alarm if the service is not alive.

  • Prerequisites

Ensure that JSON files are correctly defined in ./pkg/checker/health. The JSON file containing the health check URL can be generated by running the ./script/collect-healthcheck-urls script.

go run ./script/collect-healthcheck-urls --chain={CHAIN} --kubeconfig={PATH_TO_KUBECONFIG} --context={K9S_CONTEXT}

Default values are as follows:

chain = "baobab"
kubeconfig = "/Users/${USER}/.kube/config"
contextName = "orakl-baobab-admin@bisonai"

Balance Checker

Reads Orakl service wallets regularly and sends an alarm if the amount is less than the minimum.

Event Checker (TBD)

Reads events from the Graphnode DB and sends an alarm message if the expected event is not emitted after the expected time.