Task Development Guide
More details on task deployments coming soon!
Easy-Peasy, JavaScript
Our mission is to improve access to decentralized technology, which is why Koii Tasks are written and configured entirely in JavaScript (NodeJS 16, to be exact) and support the majority of popular NPM Modules. It can help to think of Task Executables as Express.js nodes for hire, each of which stake tokens and reputation to participate. Combined with Koii-X, that means you can deploy an entire stack, decentralized, with just JavaScript, while taking advantage of all the existing Node.js modules.
Developing Tasks
When creating a new task, there are three main functions that define the task's logic, how results should be verified, and how rewards will be distributed. These are the functions:
The Task Function This function contains the core logic of the Koii task and submits the proof of the work done by participating nodes to K2.
The Audit Function
This function verifies the validity of the submissions made by nodes. If a node's submission is invalid, an Audit is initiated, and other participating nodes vote for or against the Audit. If they cast a negative vote, the malicious node's stake is slashed and they are not eligible to receive rewards for completing the task.
Any significant aspects of the task, regardless of whether they are directly associated with bounties or not, should be subject to audits. Please see the audit section for details.
The Distribution Function
This function generates a distribution list and submits it on-chain. A distribution list is a JSON object containing a key-value pair, where the key is the public key of the node that made the submission and the value is the number of KOII tokens to be rewarded to the node.
Last updated