BenchmarkersSetting Up Master Node

Setting up a Master Node

This guide will help you set up a Master node for running a Benchmarker. The Master node is responsible for scheduling and splitting benchmarks into batches for Slave nodes to run.

Setting up

Clone the TIG Monorepo:

git clone https://github.com/tig-foundation/tig-monorepo.git

Switch to the appropriate branch based on the network you want to benchmark on:

git switch test/main
## OR
git switch test/blank_slate

Navigate to the tig-monorepo/tig-benchmarker directory:

cd tig-monorepo/tig-benchmarker

For the next steps, you will need to have docker and docker-compose installed on your machine.

Starting the Master node

Start the Master node using docker-compose:

docker-compose -f master.yml up
ℹ️

docker-compose uses the .env file. For security, it is recommended that you adjust ports and passwords. See Advanced Tips.

After running the command, the Master node UI should be accessible on http://localhost:80

Master node UI

ℹ️

At this point your docker-compose logs should be showing invalid API key errors. This is expected

Obtaining the API Key

The API Key can be either obtained from the Main Dashboard/Testnet Dashboard.

To obtain the API Key from the UI, you need to connect your wallet and then click on the copy icon:

Obtain API-Key

Configuring the Master

Visit your Master’s Config page on http://localhost:80/config. Copy, paste and edit the below config with your api_key, player_id, api_url.

https://testnet-api.tig.foundation
{
  "slaves": [
    {
      "name_regex": ".*",
      "algorithm_id_regex": ".*",
      "max_concurrent_batches": 1
    }
  ],
  "api_key": "<YOUR_TESTNET_OR_MAINNET_API_KEY>",
  "api_url": "<TESTNET_OR_MAINNET_API_URL>",
  "player_id": "<YOUR_PLAYER_ID>",
  "algo_selection": [
    {
      "weight": 1,
      "batch_size": 8,
      "num_nonces": 40,
      "algorithm_id": "c001_a004",
      "difficulty_range": [
        0,
        0.5
      ],
      "selected_difficulties": []
    }
  ],
  "time_before_batch_retry": 60000,
  "max_concurrent_benchmarks": 4,
  "time_between_resubmissions": 60000
}

Click Save to apply your changes.

ℹ️

The above is a simple working config. To earn TIG on mainnet from benchmarking, you will need to edit the algo_selection field to include at least one algorithm for each challenge. See Advanced Tips

Next steps