Running a PoL Challenger Client

Steps to run a PoL Challenger Client

The PoL Challenger Client Node is a DePIN Challenger node that participates in the PoL (Proof-of-Location) protocol and measures the location claims made by a DePIN Prover.

PoL Challenger Client Nodes can be run on community members’ laptops, desktops or even on cloud instances. As long as the node is running, there is a probabilistic algorithm (based on stake in the upcoming releases) that determines if the node will participate in a PoL challenge from the network.

Prerequisites

Before you begin, ensure you have the following

  • Docker (version 23.0.0 or above, refer: https://docs.docker.com/desktop/install/linux-install/)

  • Instance comparable to a t2 micro (1 vcpu, 1GB RAM and 5GB harddisk), though we recommend 2 cores, 4 GB RAM and 10 GB of storage.

  • Your operator key being whitelisted by Witness Chain.

Running your Challenger client

Key Points to consider before proceeding...

  1. If you are an EigenLayer operator on our Witness Chain AVS, your Operator address would be already whitelisted.

  2. We have 2 sets of keys - Operator Key and Challenger Key.

    1. Operator Key is the EigenLayer Operator Key that you have been using with our Witness Chain AVS. Continue to use that here too. This key is used for registering the Challenger Key(s).

    2. Challenger Key - This is the signing key for the PoL Challenger Client. Create a new Key for the same. Don't reuse the Operator Key for the Challenger Key. It has to be a ECDSA Key.

  3. Both the Operator and the Challenger Key should be funded. Please use the following faucet to fund it: https://blue-orangutan-faucet.eu-north-2.gateway.fm/

  4. Ports to be opened if using public IP:

Incoming ports to be opened (TCP & UDP ):

11112
22223
33334
33335
33336
44445
44446
44447
55556

Outgoing ports: Allow all

1. Setting up the challenger keys and the config file

Use ECDSA Keypairs

  1. Create a ECDSA private key using Metamask or other utilities that will be used as Challenger Key.

  2. Store the challenger's private key in the file (Make sure you keep track of the file name and its location, as it would be refered later)

echo "YOUR_CHALLENGER_PRIVATE_KEY" > my_challenger_private.key
  1. Prepare a configuration file my_challenger_config.json with the following entries

{

  "claims": {
    "latitude": 37.015,
    "longitude": -79.039,
    
    "country": "US",
    "region": "Virginia",
    "city": "Ashburn",
    "radius": 1000
  },
  "walletPublicKey": {
    "ethereum": "YOUR_ETH_ADDRESS_FOR_TRACKING_CONTRIBUTION"
  },
  
  "havePublicIPv4Address": false,
  "havePublicIPv6Address": false,
  
  "havePrivateIPv4Address": false,
  "havePrivateIPv6Address": false,
  
  "saveResultsInDatabase": false,
  
  "submitResultsToContract": true,
  
  "rpcUrl": "https://blue-orangutan-rpc.eu-north-2.gateway.fm",
  
  "projectName": "eigenlayer"
}

Explanation:

  •   "claims": {
        "latitude": 37.015, // Latitude of the machine running the challenger client
        "longitude": -79.039, // Longitude of the machine running the challenger client
        
        "country": "US", // Optional. Country in which the machine is located
        "region": "Virginia", // Optional. State/Region in which the machine is located
        "city": "Ashburn", // Optional. City in which the machine is located
        "radius": 1000 // Optional. Accuracy in meters
      },
  • walletPublicKey.ethereum is the wallet addresses where your contributions go.

  • havePublicIPv4Address (and havePublicIPv6Address) set them to true if you have a public IPv4 (or IPv6)

  • havePrivateIPv4Address (and havePrivateIPv6Address) set them to true if you want to force the use of private IP

  • saveResultsInDatabase saves the login, session, and challenge related data in a .sqlite file within the container

  1. Once you have the config.json ready, the challenger client can be started with

docker run -d \
  --network=host \
  --name pol-challenger \
  -v ./my_challenger_config.json:/app/dart/bin/pol/config/challenger.json \
  -v ./my_challenger_private.key:/root/.config/ethereum/private.key \
  witnesschain/pol-challenger:0.3.4-alpha

you can verify that the challenger is running by looking at the container status

docker ps 

Explanation:

  1. docker run -d: Runs the container in detached mode (in the background).

    • --network=host
      Uses the host's network stack.
    • --name pol-challenger
      Names the container as 'pol-challenger'.
    • -v ./my_challenger_config.json:/app/dart/bin/pol/config/challenger.json 
      Mounts your local config file into the container at the specified path.
    • -v ./my_challenger_private.key:/root/.config/ethereum/private.key
      Mounts your local private key file folder into the container at the specified path.
      
    • witnesschain/pol-challenger: The name of the Docker image to run.

You will observe the following errors in the docker container

"registration is required on DCL contract. Please register your challenger publicKey:"

Don't worry, this is normal. Once you COMPLETE STEP 2, these logs should disappear

2. Registering the Challenger Key

If you are already whitelisted on Witness Chain's AVS on EigenLayer's testnet, then you can move forward with registration, else write to us on our Discord channel or Telegram to get whitelisted.

You can register the challenger key easily with the help of our registration cli, to do so

  1. Download our witness-cli

    curl -sSfL https://witnesschain-com.github.io/install-dcl-cli | bash

    Follow the steps as directed in the output of the script to add the CLI to the shell profile to be able to use the CLI from anywhere.

  2. Prepare the config (challenger registration config),

    1. The above command also downloads a template which you can refer to.

    2. Make sure you set the challenger_private_keys attribute in the json file with the key, that you provided in private.key

  3. Run the following command for challenger registration of watchtower

    witness-cli registerChallenger --config-file <path-to-challenger-registration-config.json>
  4. Prepare the config (prover registration config), (The above command also downloads a template which you can refer to) make sure you set the prover_private_keys to the one you provided to the client in private.key

  5. Run the following command for prover registration of watchtower

    witness-cli registerProver --config-file <path-to-prover-registration-config.json>

Ensure the operator address is correctly set in the watchtower's config.json,as the contributions are attributed to the operator!

Post Setup

Once the setting up and registration is successful, you can check the logs from the challenger client ready for challenges. (docker logs pol-challenger). Congratulations, you are now a part of our DePIN family!

We publish images (x86 & arm64) with the tag latest and by the git tag, the latest will always point to the new and up to date image. In order to pull the latest image, make sure you don't have an older release of latest to avoid using cached images.

You can remove the older images by

docker rmi witnesschain/pol-challenger

Troubleshooting

As the only prerequisite is docker, make sure you are running atleast version 23.0.0 or above for the commands mentioned in the doc to work. The days might be rainy or snowy, but we've got umbrellas and sweaters! Join our Discord or Telegram—we're happy to help. :D

Last updated