Get Started
Last updated
Was this helpful?
Last updated
Was this helpful?
If you’re a developer ready to start building Truebit tasks, follow our Getting Started guide to install the Truebit CLI and connect to one of our pre-configured Hosted Nodes, available for community use
or higher
or higher
During the Public Beta, Truebit will cover the cost of the blockchain transactions. To qualify, please ensure you’re registered on our platform.
Install the Truebit CLI globally using the command:
If you already registered into Truebit:
Please run the following command to setup a new Truebit account:
You will be asked to accept the Terms of Use. Once accepted, you will see the following result.
Once you Type "Y"
Step 2 - Create an Account
The system will ask the following information:
Name: Your full name.
Verification Email: An email address.
Company Name: Your company’s name.
Job Position: Your job position.
EULA Acceptance: Accept the End User License Agreement (EULA). [ Y|N ]
If you'd like to view your personal information again, please run truebit setup
.
Clone the examples repository to start working with Truebit
For now we will use one of the examples (Fibonacci) to demonstrate how to use the CLI to test and deploy Function tasks, and the platform's REST API to execute and verify them.
This command will build the Fibonacci task.
This command will run the Fibonacci task and provide the result and total steps executed.
[taskId]: Add the taskId generated in the previous step.
This command will deploy and register the Fibonacci task.
[namespace]: Use your default namespace registered in Step 2 - User Creation
[taskname]: Choose a representative name for your task. i.e: fibonacci
[taskId]: Add the taskId generated in the previous step.
Open the /task/function/execute-by-name endpoint and click "Try it Out" to test it.
Update the following parameters in the request body:
namespace: Use the namespace from Step 3 – Deploy and register your Function task.
taskname: Use the task name from Step 3 – Deploy and register your Function task.
async: Set to false.
Add your API Key from Step 2 – Register into Truebit in the x-api-key parameter.
You should receive the following answer
Use the /task/{executionId}/transcript
endpoint, passing the executionId
value obtained from the previous execution as a parameter.
This command will create the API task.
This command will deploy and register the Fibonacci task.
[namespace]: Use your default namespace registered in Step 2 - User Creation
[taskname]: Choose a representative name fr your task. i.e: petstore
[taskId]: Add the taskId generated in the previous step.
Open the /task/api/execute-by-name endpoint and click "Try it Out" to test it.
Add your API Key from Step 2 – Register into Truebit in the x-api-key parameter.
Update the following parameters in the request body and click on "Execute":
namespace: Use the namespace from Step 6 – Deploy and register your API task.
taskname: Use the task name from Step 6 – Deploy and register your API task.
async: Set to false.
input:
You should receive the following answer
Use the /task/{executionId}/transcript
endpoint, passing the executionId
value obtained from the previous execution as a parameter.
By now, you’ve gone through the full journey: From installing and registering with Truebit to creating your first task locally, deploying it to the Truebit cloud, and obtaining a verifiable transcript. Now, it's time to see everything in action on a website.
Update the file located in the ~/.truebit
directory
A new file containing your account information has been created at:
/Users/<username>/.truebit/secret.json
.
We have created so you can get familiar with the process of testing and deploying code. You can learn more about creating your own and tasks.
Access the Task execution Swagger UI here: .
Access the Transcript swagger UI here: .
You should get the associated with the given executionId
Access the Task execution Swagger UI here: .
Access the Transcript swagger UI here: .
You should get the associated with the given executionId
To demonstrate this, we’ve built a page that executes a verifiable Fibonacci computation. How does it work? The page calls the Truebit execution endpoint and retrieves the corresponding verification transcript.
.
.