Tora CLI - Tutorial
https://github.com/ora-io/tora-docker-compose/releases
Prerequisites
Please confirm that your computer has Docker installed and ensure there is a smooth network connection. The installation, operation, and upgrade of Tora validator client will be based on Docker.
Minimal requirements
To run a Tora validator client, your computer must have:
Any Operating System with Docker installed.
1-core CPU that exceeds 8 GB RAM (12GB recommended). This configuration is sufficient to run an OpenLM model server.
💡 Set up a new fresh wallet to run the node. Do not use "everyday wallet".
💡 Please ensure that there is sufficient balance in the wallet used for confirmation
, which can be used to pay for transaction.Gas
.
💡 Make sure to set appropriate RAM limit in the docker engine configuration.
Setup
Download the latest version of Tora validator client at releases page.
Enter the project directory
tora-docker-compose
and write the configuration file.env
.
For the parameters that need to be configured in .env
, please refer to the next subsection.
Config
RPC (required)
You need to modify the following four environment variables.
MAINNET_WSS
MAINNET_HTTP
SEPOLIA_WSS
SEPOLIA_HTTP
The Tora validator client does not currently provide a default public RPC. To create your own API key, please register an provider account like the Alchemy.
CONFIRM_CHAINS (required)
Currently, running multiple networks in one node is not supported.
The Tora validator client currently supports Ethereum Mainnet and Sepolia.
You need to modify the CONFIRM_CHAINS
environment variable to select the chain you want to listen to.
This variable requires a string type, but you can listen to multiple chains at the same time by using a JSON-formatted string.
The following examples are feasible:
PRIV_KEY (required)
You need to modify the PRIV_KEY environment variable to set the wallet used for confirmation.
Please ensure that the wallet has enough balance to pay transaction gas.
For example:
CONFIRM_MODELS (required)
The TORA validator currently supports OpenLM model.
You can modify the CONFIRM_MODELS
environment variable to select the model you want to validate.
This variable requires a number Array type encoded in JSON.
The following example is feasible:
CONFIRM_USE_CROSSCHECK (optional)
When CONFIRM_USE_CROSSCHECK
is set to true
, the node will periodically check if any events are missed.
If set to false
, it will not check for misses.
The following example is feasible:
CONFIRM_CC_POLLING_INTERVAL (optional)
This environment variable is the time interval between each crosscheck.
CONFIRM_CC_BATCH_BLOCKS_COUNT ( optional )
This environment variable is used to set how many blocks crosscheck checks each time. It is recommended to set a relative large block number that takes at least 1 hr to generate.
💡 There won’t be any overlapping or missing blocks as long as this value is greater than 0, because crosschecks always start from the last checkpoint height
CONFIRM_TASK_TTL ( optional )
Confirm Task will be processed within a certain period of time. After the timeout, the node will skip this Task.
CONFIRM_CC_TTL ( optional )
This environment variable can be set to determine how often crosscheck should be performed. note that this can be safely set to a small number, since the crosschecker also waits for fulfilling the BATCH_BLOCKS_COUNT
for each check.
TORA_ENV ( optional )
This environment variable will affect the log level. The default is production, changing it to other values will generate more detailed logs.
REDIS_TTL ( optional )
This environment variable determines the lifespan of redis connections, which is set to one day by default.
Start
This will start 4 docker containers:
ora-tora
ora-redis
ora-openlm
diun
Watch the logs
If Docker Desktop is installed, you can view the logs by following docker desktop - container - tora-olm
Otherwise, you can use the following command line to view.
Test the Node
Initialization
After executing the command "docker compose up", the Tora validator starts the initialization process.
When you see [confirm] [+] RPC Server running on port 5001
, it means that the Tora validator has completed initialization and everything is ready.
Initiate an OLM model request
To test that the node is behaving correctly, request inference from OpenLM model through https://www.ora.io/app/opml/models.
inference
Shortly after the request is initiated, the Tora validator will log receive event in tx ...
. This indicates that the Tora validator has received the request and started to perform inference.
confirm done
If “confirmed at txhash: 0x....” appears in docker logs, it means that node running inference was successful and confirmed successfully.
By default node uses GPU and caching mechanism, which completes confirmation process within just a few seconds. Running on CPU without cache would typically require about 15 minutes.
💡 The inference results will be cached, and the same prompt will no longer be inferred in the future. Once a prompt has been cached, the process will be completed instantly.
Errors
1. not support model
Currently, there are multiple models running in ORA. This error indicates that the modelId of the detected OAO event is not in your support_models.
Since Tora validator currently only supports OpenLM (model id: 13), this error message can be temporarily ignored.
2. invoke confirm function error
This error indicates that model inference off-chain is functioning, but the on-chain contract call fails. This may be caused by various reasons and debugging needs to be done in conjunction with specific error information.
If you encounter this error, please record the failed txHash
and contact community developers.
3. not match modelHash and programHash
This error indicates that the on-chain model has been upgraded, and the old version of the model is deprecated.
Please use the docker images rm
command and docker container rm
command to delete the existing Tora validator node, download the latest version of Tora validator again, and start the node.
Last updated