# Checkpoint Notifier

This script is useful for checking validator activity, notifying you whenever the validator misses a checkpoint.

```bash
import requests
import time


api_url = "https://monitor.vn.stakepool.dev.br/missing_signers"

my_validator_ids = input("Enter the validator IDs to monitor (comma-separated): ").split(",")

my_validator_ids = [validator_id.strip() for validator_id in my_validator_ids]

while True:
    try:
        response = requests.get(api_url)

        
        if response.status_code == 200:
            data = response.json()
  
            missed_checkpoints = {validator_id: False for validator_id in my_validator_ids}

            
            for item in data:
                validator_id = str(item.get("ID"))  
                validator_signer = item.get("signer")  

               
                if validator_id in my_validator_ids:
                    print(f"Validator {validator_id} ({validator_signer}) missed a checkpoint!")
                    missed_checkpoints[validator_id] = True

            
            for validator_id, missed in missed_checkpoints.items():
                if not missed:
                    print(f"Validator {validator_id} has not missed checkpoints.")

        else:
            print("Request error:", response.status_code)

    except Exception as e:
        print("Error:", e)

    
    time.sleep(60)

```

Python and Requests Installation:

Make sure you have Python installed on your system. Open the terminal or command prompt. Execute the following command to install the `requests` library:

```bash
pip install requests
```

Script Execution:

Save the Python script (`Your_script.py`) in the directory of your choice. Place a file named "addresses.txt" in the same directory as the script, containing the addresses of the validators.

Run the Script:

In the terminal or command prompt, navigate to the directory where the script is located. Execute the script using the following command:

```bash
python3 your_script.py
```

Results:

The script will begin monitoring the validator's activity and display messages whenever the validator signs a new checkpoint. You can stop the script at any time by pressing Ctrl + C in the terminal.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.stakepool.dev.br/polygon/scripts/checkpoint-notifier.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
