Skip to content
/ task-template Public template

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.

Notifications You must be signed in to change notification settings

koii-network/task-template

Repository files navigation

Koii Task Template

Development Guide

First time writing a task? Start with the Development Guide.

Task Flow

Tasks operate within a periodic structure known as 'rounds'. Each round consists of the following steps:

  1. Perform the Task: Execute the necessary actions for the round.
  2. Audit Work: Review the work completed by other nodes.
  3. Rewards and Penalties: Distribute rewards and apply penalties as necessary.

For more detailed information about the task flow, refer to the runtime flow documentation.

Looking to bring better structure to your task? Explore our Task Organizer for better organization.

Tips

  • Always ensure your secret files, such as .env files, are secure! Implement a robust .gitignore strategy.
  • Continue innovating with Koii!

Should you encounter any issues, don't hesitate to reach out by opening a ticket on Discord.

Environment Requirements

Tool Requirements

Available Scripts

npm test

Simulate rounds using unitTest.js.

npm jest-test

Runs tests using Just.

npm run webpack

Builds the project and generates the main script: dist/main.js.

npm run prod-debug

Runs the live debugger (must have the task running in the desktop node).

Runtime Options

There are two ways to run your task during development:

  1. With GLOBAL_TIMERS="true" (refer to .env.local.example) - When this option is enabled, IPC calls are made by calculating the average time slots of all tasks running on your node.

  2. With GLOBAL_TIMERS="false" - This option allows for manual calls to K2 and disables the automatic triggers for round management on K2. Transactions are only accepted during the correct time period. Instructions for manual calls can be found in Manual K2 Calls.

About

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published