How to develop an Orca Task
Prerequisitesβ
Task Templateβ
The Orca task template allows developers to quickly create a containerized task by providing sensible defaults.
Understanding a Koii Taskβ
Before beginning to develop a Koii Task, it's useful to understand the basic flow. We recommend going through EZSandbox Lesson 1 to get an introduction to Koii Tasks.
Designing Your Taskβ
Your task will need to handle the 4 stages of a Koii Task: task, submission, audit, and distribution. The task, submission, and audit stages will be handled by your container. The distribution stage will be handled by the JavaScript distribution()
function in the task template.
During the task
stage, nodes will perform the work you specify in your container. When the work is complete, nodes must create and store proofs that can be verified during the audit
stage. P We recommend using your preferred database solution within your container to store proofs.
During the submission
stage, nodes will retrieve the stored proofs and submit them to be audited. The task template already takes care of the actual submission logic, you simply need to provide an endpoint that retrieves the proofs from your database.
During the audit
stage, nodes will receive proofs from other nodes and check that the work was completed correctly. This stage is critical to ensure that nodes behave honestly; see our EZ Sandbox lesson on auditing for tips on designing good audits.
Creating Your Taskβ
The task template readme walks through the steps for creating an Orca task, but we'll summarize them here:
1. Create a Docker Containerβ
Create a Docker container with your application and a web server that provides the necessary endpoints as specified in the readme. Upload your container to Docker Hub or another container repository.
2. Define Your Compensation Logic (optional)β
During the distribution
stage, rewards and penalties are given out to nodes that made submissions. The default compensation logic will be sufficient for many projects; it distributes the bounty equally between all successful nodes and confiscates 70% of the stake of nodes that failed audit.
3. Deploy Your Taskβ
See the EZ Sandbox instructions on deploying a KOII task or a KPL task for details.
Run Your Taskβ
That's it! Add your task ID to the desktop node to run your task.
Got a great idea and looking for funding? Check out Koii Ocean! It's a community-funded launchpad thatβs all about supporting projects directly through Koii. No need for venture capitalists or middlemen - just a straightforward way to get your project off the ground!