Key Components
When a task is created, there are two key components that must be uploaded to the Koii Network to initiate the task.
Executable
Every task is compiled into a single JavaScript executable file that contains all of the functions required to run the task. We go into detail throughout the tutorial. Three functions are required to be defined:
Task function β This function contains the core logic of the task executable and submits the proof of the work done by participating nodes to K2. Learn more
Audit function β This function audits other participating nodes. Learn More
Distribution function β This function creates the distribution list and submits it on-chain. Learn More
Metadata
The task metadata is structured data that contains information about a Koii task. Node operators can easily learn more details about a specific task by looking at its metadata.
Task Metadata Sample:
{
name: 'Sample Task',
description: 'This a demo task',
author: 'KOII-networks',
githubURL: 'https://github.com',
imageURL: 'image.png',
createdAt: '',
nodeSpec: {
storage: '',
cpu: '4',
memory: '8',
os: [ 'Linux', 'Windows', 'MacOS' ],
network: '20'
}
}
There are two types of task metadata:
Data that is stored in an IPFS Metadata file - which is done on task creation
Task Manager β K2 wallet address of task creator.
Task description β An optional field for adding a detailed description of the task.
Task Name β Name of the task.\
Data that are stored on K2 - updated over time and reflect the latest state of the task
Last updated