How to become a collator on PolkaFoundry

With the release of Halongbay Testnet v0.01, you can run your own collator node and authors blocks on the parachain.
In our test net, the relay chain is hosted and run by PolkaFoundry team.

Requirements

The minimum specs recommend for running a node in our Testnet are shown below

  • CPU - 8 core CPU
  • Storage - 50GB
  • Memory - 16GB.

Instructions

A Halongbay testnet node can run quickly by using Docker

docker run -p 9933:9933 -p 9944:9944 -p 30333:30333 -v "YOUR_VOLUME:/data" \
tungicetea/halongbay:29be30f \
--ws-external \
--rpc-external \
--chain halongbay.json \
--name="YOUR-NODE-NAME" \
--collator \
--author-id PUBLIC_KEY \
--parachain-id 1111 \
--pruning archive \
-- \
--pruning archive \
--chain=rococo-local.json

You can get the chain specs at the following link:
halongbay.json: https://raw.githubusercontent.com/polkafoundry/newpolka/halongbay-v1/node/res/halongbay.json
rococo-local.json: https://raw.githubusercontent.com/polkafoundry/newpolka/halongbay-v1/node/res/rococo-local.json

Once Docker pulls the necessary images, your node will run and display a lot of information such as genesis-state, parachain-id, node name, …

Your node will start syncing with the relay chain


(ignore some useless log from parachain, will delete it in the next version)

Once synced, you have a Halongbay node running.

Bonding

In the Halongbay Testnet, token holders can bond(staking) and earn rewards

Once your node is running, and in sync with the network, you become a collator candidate by following the steps below in PolkadotJS:

  1. Go to Developers > Extrinsics
  2. Select the account to correspond with the public key you pass when running a node
  3. Confirm your collator account is funded with at least 500 tokens plus some extra for transaction fees
  4. Select staking pallet
  5. Open the drop-down menu, which lists all the possible extrinsic related to staking, and select the bond() function
  6. Set the bond to at least 500
  7. Submit the transaction

Reward Distribution

At the end of every round (600 blocks), collators are rewarded for their work from 2 rounds ago.

The reward distribution will be calculated like:

reward = 0.5 x commission + 0.5 x staking_rate

commission = (number of block produced in the current round x 20)/ total point
staking rate = token stake in the current round/total stake in current round

Example:

Alice is staking 1000 token and producing 20 blocks
Bob is staking 500 token and producing 20 blocks

The inflation tokens will be calculated like: PolkaFoundry Staking implementation.
I will assume it will be 12 for this round.
→ The total stake in this round is : 1000 + 500 = 1500, and the total point is (20 + 20) * 20 = 800
Alice will earn: 12 x (0.5 x (1000/1500) + 0.5 x (20 x 20)/800) = 7 token
Bob will earn: 12 x (0.5 x (500/1500) + 0.5 x (20 x 20)/800) = 5 token