Run a Collator

Bifrost Parachain Testnet:

https://polkadot.js.org/apps/?rpc=wss://bifrost.bifrost-staking-test.liebi.com/ws#/explorer

Download Chain Spec

Run a Collator Node

bifrost \\
--collator \\
--chain </path/to/bifrost-polkadot-testnet-raw.json> \\
--base-path <DATA_PATH> \\
--rpc-port 9933 \\
-- \\
--chain rococo-local.json

You can also use docker run the collator with a command

docker run --name  add-parachain-staking-test \\
   -v ./data:/bifrost \\
   -p 9933:9933 \\
   bifrostnetwork/bifrost:add-parachain-staking \\
   --base-path "/bifrost" \\
   --chain /spec/bifrost-polkadot-testnet-raw.json \\
   --collator \\
   -- \\
   --chain /spec/rococo-local.json

Set SessionKey

Generate SessionKey

curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "author_rotateKeys", "params":[]}' http://<COLLATOR_IP>:9933

Set SessionKey

Get the Size of the Candidate Pool

First, you need to get the candidatePool size (this can change through governance) as you'll need to submit this parameter in a later transaction. To do so, you'll have to run the following JavaScript code snippet from within Polkadot.js:

// Simple script to get candidate pool size
const candidatePool = await api.query.parachainStaking.candidatePool();
console.log(`Candidate pool size is: ${candidatePool.length}`);

Head to the Developer tab, select JavaScript from the dropdown, and take the following steps:

  1. Copy the code from the previous snippet and paste it inside the code editor box. (Optional) Click the save icon and set a name for the code snippet, for example, "Get candidatePool size". This will save the code snippet locally

  2. To execute the code, click on the run button

  3. Copy the result, as you'll need it when joining the candidate pool

Apply for Candidate

  • extrinsic

parameters:

bond: candidate bonding amount 5,000,000,000,000,000 (5,000 BNCs)

candidateCount: existing candidate amount

  • event

If the total amount of Total Bonded is in the top 16, after 2 rounds, the new Collator can start to generate blocks and receive rewards.

And you can find the collator in chainstate

And you will see your collator in dapp page

Last updated