Truebit CLI reference
This guide provides a practical overview of the Truebit CLI, a command-line tool for developers to interact with the Truebit network. It explains how to submit and run computation tasks, manage wallets, monitor task execution, and integrate results into your workflows. Each command comes with detailed help options, making it easy to discover functionality and incorporate the CLI into scripts, automation pipelines, or custom developer tooling.
Usage: truebit [options] [command]
_____ _ _ _ __ __ _ __
|_ _| __ _ _ ___| |__ (_) |_ \ \ / /__ _ __(_)/ _|_ _
| || '__| | | |/ _ \ '_ \| | __| \ \ / / _ \ '__| | |_| | | |
| || | | |_| | __/ |_) | | |_ \ V / __/ | | | _| |_| |
|_||_| \__,_|\___|_.__/|_|\__| \_/ \___|_| |_|_| \__, |
____ _ ___ |___/
/ ___| | |_ _|
| | | | | |
| |___| |___ | |
\____|_____|___|
A CLI to interact with Truebit Verify node
By accessing and using the Protocol, you hereby agree to our Terms of Use and our Privacy Policy. Patents pending.
Terms of Use: https://www.truebit.io/terms
Privacy Policy: https://www.truebit.io/privacy-policy
Options:
-V, --version output the version number
-h, --help Display help for command
Commands:
help [command] display help for command
setup Initialize user profile configuration
start [options] <taskId> <input> Run a Truebit Task
deploy [options] <namespace> <taskName> Deploy and register a new Truebit Task
build [options] <sourceCodePath> Create a Function Task
create-api <manifestPath> Create an API Task
start-api <manifestPath> <input> [authType] [authString] Run an API Task
status <executionId> Get execution status
quota Check quota status
web-login Sign in to Web UI
contract Manage contract bindings
api-auth <namespace> <taskname> <taskId> <authType> <authString> Set API Task authentication
namespace Manage Namespace operations
task Manage Task operations
auth Manage authorization operationstrueManaging Truebit Account
Setup
Quota
web-login
chain
contract
add
Using the βcontract addβ command, you can associate an existing smart contract that uses Verify Oracles with your Truebit account. Once linked, the contract becomes part of your account, allowing it to benefit from your available quota and the advantages associated with your role.
remove
Using the βcontract removeβ command, you can detach an existing smart contract from your Truebit account. Once removed, the contract will no longer have access to your account quota or the benefits associated with your role.
list
The βcontract listβ command displays all smart contracts currently associated with your Truebit account. From here, you can review linked contracts and manage which ones have access to your account quota and role-based benefits.
Developing Function Tasks
Use the build and start commands to test your function tasks before deploying them to the Coordination Hub.
Build
Output
As a result of running the build command, you will receive a TaskId, which serves as the unique identifier for your task.
-l, --lang Options
Rust
rs (default value)
Javascript
js
Python
py
C
c
C++
c++
Example
Source Code Structure
In order to compile your source code, make sure you have the following file structure within the <sourceCodePath> folder that will be built:
π src
π main.rs
π target
π Cargo.toml
π Cargo.lock
π src
π main.c
π compile.sh
π src
π main.cpp
π compile.sh
π src
π main.js
π dist
π main.js
π package-lock.json
π package.json
π rollup.config.mjs
π src
π task.py
Start
Output
Resources
Gas
Maximum amount of task execution steps.
Call
Amount of nested calls during the task execution.
Frame
Stack memory allocated for the calls.
Memory
Amount of memory used by the task execution.
Metering
Limits
Maximum amount of resources assigned to task execution. See determinism.
Peak
Peak resource usage collected during task execution.
Last
The amount of resources in use when the task finished execution. If it ran successfully, the final values for "Call" and "Frame" should be 0.
Capacity
Resources allocated in excess. If the "Limit" value shows a 4000x number, it means that the required resources exceed the actual needs by that amount.
Remember: resource usage might vary on the same Truebit task depending on the input data.
Developing API Tasks
Use the start-api, create-api commands to test your API tasks before deploying them to the Coordination Hub:
start-api
Output
path
API endpoint path.
method
["GET", "POST", "DELETE", "PUT", "PATCH"]
body
API input parameters.
params
API input parameters.
Base URL
API Base URL.
OpenAPI Manifest check
Manifest check. OK: Manifest is well written and executed. FAIL: There are errors on the manifest schema.
API Task response
API endpoint output.
create-api
Output
Deploying Truebit Tasks
Use the deploy command to deploy your Truebit Task to the Coordination Hub. If API task authentication is required, use the api-auth command.
deploy
Output
api-auth
Output
Managing Truebit Tasks
Use the namespace and task commands to manage access to your Truebit Tasks within your development team. To grant execution access for a deployed task, use the auth command.
namespace
namespace register
Output
namespace transfer
Output
namespace grant
Output
namespace revoke
Output
task
task label
Output
task disable
Output
task enable
Output
task get-task
Output
auth
auth grant
Output
auth revoke
Output
auth register
Output
auth deregister
Output
auth check-authorization
Output
auth get-payer
Output
auth new-apikey
Output
secret.json
The secret.json file is generated when you accept the Terms and Conditions for the first time. It stores essential user information, including your wallet and private key. Keep this file secure, as it contains your credentials for accessing Truebit Verify.
privateKey
Your private key
address
Your wallet address
eula
Eula acceptance timestamp
RPC_URL
Last updated
Was this helpful?