Monitoring Bot Setup

Overview of How To Set-up and Run an oSnap Monitoring Bot

The oSnap Monitoring Bot monitors all transactions to your oSnap module. It also verifies that proposed transactions are valid according to the rules of the oSnap module (ie. the snapshot quorum and voting period meet the oSnap rules). Any unverified proposed transactions should be reviewed further and possibly disputed.

All oSnap propsals are already monitored by bots run by UMA's core team and a decentralized group of human verifiers. You may wish to run this bot so you can monitor your oSnap module yourself.

This tutorial walks through an example of how to setup the oSnap monitoring bot from UMA's protocol repository that watches for emitted contract events and sends alerts.

The Node package method described below is also available on Youtube.


Docker method

The instructions assume you have Docker installed and its server daemon is running.

Get the latest UMA protocol image that among others includes the required monitoring bot:

docker pull umaprotocol/protocol:latest

Node package method

The instructions assume you have already the latest long term support version of Node.js.

Initialize new project directory and install @uma/monitor-v2 package that contains the oSnap monitoring bot:

mkdir monitor-osnap
cd monitor-osnap
npm init -y
npm install @uma/monitor-v2

Basic configuration

All configuration for the monitor bot should be set in a .env file in your working directory. Please see basic configuration variables below:

# Note on formatting: Do not enclose variable values in quotes as this is not supported when running the bot in Docker container.

# Name of the bot identifier as shown in alerts.
BOT_IDENTIFIER=oSnap Monitor Bot

# the address of the deployed Optimistic Governor that this bot will monitor. This does not necessarily need to be deployed through factory.

# network number (ie. Ethereum mainnet = 1)

# a single RPC node URL replacing `X` in variable name with `CHAIN_ID`. This is considered only if matching `NODE_URLS_X` in the advanced config section is not provided.

# boolean enabling/disabling monitoring transactions proposed (`false` by default).

# boolean enabling/disabling monitoring transactions executed (`false` by default).

# boolean enabling/disabling monitoring proposal executed (`false` by default).

# boolean enabling/disabling monitoring proposal deleted (`false` by default).

# boolean enabling/disabling monitoring set collateral and bond amount (`false` by default).

# boolean enabling/disabling monitoring set rules (`false` by default).

# boolean enabling/disabling monitoring set liveness (`false` by default).

# boolean enabling/disabling monitoring set identifier (`false` by default).

# boolean enabling/disabling monitoring set escalation manager (`false` by default).

  # used to simulate proposed transaction execution on Tenderly. If any of these are missing, the bot will skip the simulation.

Running the bot

Docker method

Instruct docker to run the oSnap monitor bot by appending COMMAND environment variable to the same .env file where other configuration is stored:

# Command to run when starting docker container:
COMMAND=node ./packages/monitor-v2/dist/monitor-og/index.js

Start the monitoring bot from the same working directory where the .env configuration file is located:

docker run -d --env-file .env --name osnap-monitor --rm umaprotocol/protocol:latest

This should start the oSnap module monitoring bot in a looping mode detached from console where all configured events will be sent to the provided notification channels.

Stop the running bot container with:

docker stop -t 0 osnap-monitor

Node package method

Start the monitoring bot from the root of your project directory where node package was installed and .env configuration file is stored:

node node_modules/@uma/monitor-v2/dist/monitor-og/index.js

This starts the oSnap module monitoring bot in a looping mode where all configured events will be logged in the console.

Last updated