|
|
||
|---|---|---|
| .. | ||
| common | ||
| master | ||
| nginx | ||
| postgres | ||
| tests | ||
| ui | ||
| .env | ||
| calc_apy.py | ||
| calc_reward_share.py | ||
| check_reliability.py | ||
| docker-compose.yml | ||
| README.md | ||
| slave.py | ||
| update_config.py | ||
| verify_batch.py | ||
tig-benchmarker
Benchmarker for TIG. Expected setup is a single master and multiple slaves on different servers.
Starting Your Master
Simply run:
docker-compose up --build
This uses the .env file:
POSTGRES_USER=postgres
POSTGRES_PASSWORD=mysecretpassword
POSTGRES_DB=postgres
UI_PORT=80
DB_PORT=5432
MASTER_PORT=5115
VERBOSE=
See last section on how to find your player_id & api_key.
Notes:
- Interaction with the master is via UI:
http://localhost- If your UI port is not 80, then your UI is accessed via
http://localhost:<UI_PORT> - If you are running on a server, then your UI is access via:
http://<SERVER_IP> - Alternatively, you can ssh port forward
- If your UI port is not 80, then your UI is accessed via
- The config of the master can be updated via the UI
- Recommend to run dockers in detached mode:
docker-compose up --detach - You can view the logs of each service individually:
docker-compose logs -f <service>- There are 4 services:
db,master,ui,nginx
- There are 4 services:
- To query the database, recommend to use pgAdmin
Hard Resetting Your Master
- Kill the services:
docker-compose down - Delete the database:
rm -rf db_data - Start your master
Connecting Slaves
- Compile
tig-worker:cargo build -p tig-worker --release - Run
slave.py:# assume you are in tig-benchmarker folder python3 slave.py ../target/release/tig-worker
Notes:
- If your master is on a different server to your slave, you need to add the option
--master <SERVER_IP> - To set the number of workers (threads), use the option
--workers <NUM_WORKERS> - To use a different port, use the option
--port <MASTER_PORT> - To see all options, use
--help
Hard Resetting Your Slave
- Stop your slave
- Remove the output folder (defaults to results):
rm -rf results - Start your slave
Optimising your Config
-
difficulty_sampler_configallows you to configure the difficulty your benchmarker selects for each challenge:selected_difficultiesexpects a list of difficulties. If any of those difficulties are within the valid range, they will be pickeddifficulty_rangesexpects a range defined by 2 numbers:[lower, higher]. This is used to sample a random difficulty in the valid range. Examples:[0.0, 1.0]samples the full range of valid difficulties[0.0, 0.1]samples the easiest 10% of valid difficulties
-
job_manager_configallows you to set thebatch_sizefor each challenge.batch_sizeis the number of nonces that are part of a batch. Must be a power of 2- Recommend to pick a
batch_sizefor your slave with lowestnum_workerssuch that it takes a few seconds to compute (e.g. 5 seconds) batch_sizeshouldn't be too small, or else network latency between master and slave will affect performance- Use
slave_manager_configto support slaves with differentnum_workers
-
precommit_manager_configallows you to control your benchmarks:-
max_pending_benchmarksis the maximum number of pending benchmarks. You dont want benchmarks to take too long, nor do you want your slaves to be idle too much -
num_noncesis the number of nonces to compute per benchmark. See Discord #community-tools channel for stats to help pick -
weightaffects how likely the challenge will be picked (weight of 0 will never be picked). Observe your cutoff and imbalance on the benchmarker page
-
-
slave_manager_configallows you to control your slaves:- Slave names are matched to regexes (or else rejected).
max_concurrent_batchesis the max number of concurrent batches a slave can work onselected_challengesis a whitelist of challenges for that slave. If you don't want a slave to benchmark a specific challenge, remove its entry from the list
Finding your API Key
Mainnet
- Navigate to https://play.tig.foundation/
- Connect your wallet
- Run the following command in the console:
JSON.parse(Cookies.get("account"))addressis your Mainnetplayer_idapi_keyis your Mainnet API key
Testnet
- Navigate to https://test.tig.foundation/
- Connect your wallet
- Run the following command in the console:
JSON.parse(Cookies.get("account"))addressis your Testnetplayer_idapi_keyis your Testnet API key