Skip to content

Running a Timelord

Waruta edited this page Dec 8, 2024 · 6 revisions

Installation

To run a timelord, you will need Mac OS or Linux. You will also need to install STAI from source.

In the virtual environment (entered after running . ./activate), run the following command:

sh install-timelord.sh

Benchmarking

You can see how fast yours is per thread with:

./vdf_bench square_asm 40000

Configuration

You may want to change the number of processes the timelord will utilize. The setting for it is under timelord_launcher > process_count. For example, if you have an 8 core/16 thread CPU and want to utilize the whole thing, set process_count to 8, and all 16 hardware threads will be used.

Starting and Stopping

To start the timelord, run:

stai start timelord

To stop the timelord without stopping the full node, run:

stai stop timelord-only
stai stop timelord-launcher-only

Bluebox Timelord

A bluebox timelord compacts random proofs so that they take up less space, therefore reducing the space taken up by the blockchain database on many peers' nodes. To run a bluebox instead, make the following changes to config.yaml:

  • Under timelord, set bluebox_mode to True.
  • Under full_node, set send_uncompact_interval to a value greater than 0. This is the interval in seconds the full node will send uncompacted proofs to the bluebox timelord. A value of 300 is recommended.

Once, that's done, starting the timelord will cause it to run as a bluebox.

Monitoring

To see if your bluebox is working, set log_level to INFO. The bluebox will log VDF Client: Sent proof for every compacted proof it sends out. You can count the number of logged proof compactions by running grep "Sent proof" ~/.stai/mainnet/log/debug.log | wc -l.

Running Both Timelords

Chia and forks like STAI don't officially support running both timelords on the same system, but it should be possible in theory. This method requires a separate mainnet directory. We'll use ~/.stai/bluebox for our example. It is assumed the full node, regular timelord and other services like the farmer, harvester and wallet are started in the usual manner.

  1. You will need a separate terminal session for the bluebox timelord. This could be another terminal window/tab or a tmux session.
  2. Run export STAI_ROOT=$HOME/.stai/bluebox. This will only apply to the current terminal session.
  3. In the same terminal session, enter the virtual environment.
  4. Run stai init to generate the bluebox's mainnet folder.
  5. In the newly generated config.yaml, in addition to the usual changes required for a bluebox, make the following port changes:
    1. daemon_port to something unused.
    2. timelord > port to something unused.
  6. Start the bluebox with:
stai start timelord-launcher-only
stai start timelord-only
  1. To stop the bluebox, run the following commands in the same terminal session:
stai stop timelord-only
stai stop timelord-launcher-only

The next time you want to start the bluebox, simply repeat steps 1, 2, 3, 6 and 7.