@_koii/k2-node v1.1.4
K2-Node:
TL;DR
How to to run a node:
- Clone the repo repo : https://gitlab.com/koii-network/task-node
- do
yarn install
- do
yarn build:watch
- on another terminal do
yarn start
this will start a K2 node with attention game running.
Full Guide
How Attention game works
The node collects PoRTs for a whole epoch and generates a distribution list and add its to the attention account of the node using a uploader contract which breaks the data into small chunks and then combines it into a big data chunk in the program. The node will also expose the port list on an endpoint On the next Epoch the node will do voting by getting all the attention accounts and pings all the registered nodes and get all the posts the generates distribution list after verifying that teh list is correct or not.
How to run
Deploy Uploader Program
First airdrop 1000 tokens to your default wallet.
after that clone https://github.com/koii-network/k2-contracts this repo and deployed the uploader program by running init.sh
file after installing dependencies using yarn install
. This will deploy the uploader program used by attention game.
Run Node:
Prerequisites:
- You will need to create a task staking account in order to run tasks other than the attention contract.
1.1 You can create a staking wallet by using the staking cli
yarn stake
Running a Node:
To run a node run yarn build:watch
and ona different terminal run yarn start
to start the node.
Working of stakes
The attention program needs 2 accounts one is the attentions staking account and data program account. Which executable makes from the mainAccount according to the stake amount set in the env variable (no preconfiguration needed)
In-order to run tasks other than attention program, you need to make a staking account yarn stake
, allocate some funds in that wallet and then the task you want to execute stake some tokens to that task id using the cli. After that you will be able to execute task and make rewards out of that.
Note: Attention task is different than the other tasks
Trouble Shooting:
Insufficient Balance:
You might get this error if you have restated the network and you are trying to run deploy uploader program or running attention game. In this cases try solana airdrop <AMOUNT> <ADDRESS>
.
Program doesn't exists
You will get this error if you have restarted the network (Wiped out the data) and you are trying to run run attention game attention game, deleting namespace/Attention22222222222222222222222222222222222/attentionAccountWallet.json
and namespace/Attention22222222222222222222222222222222222/uploadAccountWallet.json
will fix the issue.