# Installing DVM

### Prerequisites:

Follow the install instructions from [installing-telliot](https://docs.fetchoracle.com/reporting-data/installing-telliot "mention") and choose the option to install DVM when running the script. \
\[If you are a more advanced user, you can clone the [DVM repo](https://github.com/fetchoracle/disputable-values-monitor/tree/testnet) inside `telliot-feeds` folder, enter `venv` environment, cd into dvm folder and install it with `pip install -e .`]

Once installed, make sure you're in python's virtual environment `(venv)`:

{% hint style="warning" %}
Everytime you run Telliot or DVM you need to enter this virtual environment. To enter it, go to `telliot-feeds` folder and run `source venv/bin/activate`. To exit it, run `deactivate`.
{% endhint %}

Navigate to the `disputable-values-monitor` directory installed on your machine, under `telliot-feeds` folder:&#x20;

```bash
cd ~/telliot-feeds/disputable-values-monitor/
```

### .env file

Before running the DVM check the `.env` file inside `telliot-feeds`. That's where the variables for DVM are stored and where you'll set your Discord Webhook for alerts.

You may do this later, but DVM won't send alerts for disputes or extra features.

### Endpoints.yaml file

{% hint style="danger" %}
It's also important to check your `telliot` folder in /Home. Open the `endpoints.yaml` file and comment out the endpoints you're not going to use.&#x20;

For example, if you're going to be reporting and monitoring only pulsechain Mainnet, comment out (with a '#') the endpoints for Testnet or any other ones that may be present.

Remember DVM will be scanning all chains in this folder for events.

```yaml
type: EndpointList
endpoints:
#- type: RPCEndpoint
 # chain_id: 943
  #network: Pulsechain Testnet
  #provider: Pulsechain
  #url: https://rpc.v4.testnet.pulsechain.com
  #explorer: https://scan.v4.testnet.pulsechain.com/
- type: RPCEndpoint
  chain_id: 369
  network: Pulsechain Mainnet
  provider: Pulsechain
  url: https://rpc.pulsechain.com
  explorer: https://scan.pulsechain.com/
```

{% endhint %}

{% hint style="warning" %}
Always stop all services if editing .env files or parameters for DVM or Telliot, in case you have both running.

It's recommended, if possible, to run each service on different machines.
{% endhint %}

### Dispute Mode <a href="#usage" id="usage"></a>

To start the DVM in dispute mode, run the following command:

```
cli -d -a <yourAccName>
```

### Alerts <a href="#usage" id="usage"></a>

To enable Discord alerts you need to set up the `.env` file inside `telliot-feeds` with your discord webhook. &#x20;

If you don't have a Discord webhook, here's Discord's [official tutorial](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks) on how to get one following quick easy steps.

### Alerts Only

To send alerts only and monitor events, start the DVM running:

```bash
cli
```

The console will ask if you want to run alerts only. Type "y" and press enter.

{% hint style="warning" %}
The DVM will then monitor the queries you set in the `telliot-feeds/disputable-values-monitor/disputer-config.yaml` file, inside the dvm folder, and will **NOT** dispute them if they meet their thresholds. It will **only send alerts** according to your specification.

You can generate queryIDs at <https://go.fetchoracle.com/#/generate-query-id>
{% endhint %}

The console screen doesn't change until there's a new report submitted. After that, a table with detailed info on the reports will take place.

Run cli `--help` for a help guide on DVM options available.
