Mangata Docs
Search
K
🗃

Collator Guide

This guide gathers all the relevant information on becoming a collator. Make sure to learn about Proof of Liquidity, and check out the Proof of Liquidity FAQ. To learn more about being a Delegator, visit the Delegator Guide. To allow multiple types of liquidity to be staked on your node take a look at the Aggregator Guide.
There are also some useful guides prepared by the team and the community with simple How-to manuals for typical collator operator actions:

Getting Started

Please make sure to familiarize yourself with Proof of Liquidity. We are currently preparing the transition to permissionless node selection. To understand the transition process, please watch the full presentation
To connect to the Mangata Collator Community, join the collators chat on Mangata Discord.

Watch this first

Requirements

Until we have more empirical data points, we are copying the node requirements for running a Polkadot validator:
  • 4 vCPU
  • 16 GB RAM
  • 1 TB SSD
  • Ubuntu 20.04

Setup Instructions

The recommended way to set up your node is to use the Docker image we provide with every release. You can also choose the manual setup route, but our team will not provide support if you will have issues setting up your node in that way.

1. Set up Node

2. Check Telemetry

See if you can find your node in Telemetry: Link

3. Rotate & Set Keys

3.1 Rotate Keys

docker ps
docker exec -it <containerID> /bin/bash
apt update && apt upgrade && apt install curl
curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "author_rotateKeys", "params":[]}' http://127.0.0.1:9933 -v
Or visit RPCAuthorRotateKeys() in your local node
  • Copy the rpc result for the following step

3.2 Set Keys

  • Select session.setKeys
  • Select your injected account
  • In keys, paste your result from the “rotateKey” step.
  • In proof, set: 0x00
Submit Signed

3.3 Check for Success

Visit Network → Explorer within the same tab that you just set the keys.
You should see a success event.

4. Aquire some initial Liquidity

To prime your node for a liquidity pair, you need to have a few liquidity tokens on your balance. Learn more here:
  1. 2.
    Note down the tokenID of your liquidity: How to look up Token IDs
  2. 3.
    Note down the balance of your liquidity: How to check your LP token balance

5. Join the active set

5.1 Get the current candidate count

  1. 2.
    Add this script:
// Simple script to get candidate pool size
const candidatePool = await api.query.parachainStaking.candidatePool();
console.log(`Candidate pool size is: ${candidatePool.length}`);
  1. 3.
    Note down the result

5.2 Get the current liquidity token count

  1. 1.
    Visit the UI: Developer → Chain State
  2. 2.
    parachainStaking → stakingLiquidityTokens
  3. 3.
    Click the plus button
This will give you a list of liquidity tokens that is possible to deploy to the candidates.
  1. 1.
    Note down the number of allowed liquidity tokens.
5.3 Join Candidates
At least 1,500,000 MGX tokens should back your LP tokens position (this amount is doubled when using not LP tokens but only MGX). This is the minimum required bond for collators: What is the minimum bond for collators?
  1. 1.
    Visit the UI: Developer → Extrinsics
  2. 2.
    Make sure your account is selected
  3. 3.
    parachainStaking.joinCandidates
    1. 1.
      bond: <the amount of your token>
    2. 2.
      liquidityToken: <your liquidity token ID>
    3. 3.
      include option should be enabled
    4. 4.
      candidateCount: <the current candidate count noted down previously in step 5.1
    5. 5.
      liquidityTokenCount: <the current liquidity token count noted down previously in step 5.2

If you're considering using only MGX for your candidate, the process is very similar, except for a difference in the bond amount and liquidity token ID. Technically, single staking can be realized by supplying the same token on both sides of the liquidity pair. Therefore, the minimum requirement should be effectively twice the number of liquidity tokens.
You can check the minimum amount with a query on the chain state:
  1. 1.
    Visit the UI: Developer → Chain State
  2. 2.
    Switch to the Constants tab
  3. 3.
    parachainStaking → minCandidateStk
  4. 4.
    Click the plus button
  5. 5.
    The amount you use should be double this amount.
To use only MGX on your candidate:
  1. 1.
    Visit the UI: Developer → Extrinsics
  2. 2.
    Make sure your account is selected
  3. 3.
    parachainStaking → joinCandidates
    1. 1.
      bond: <double the amount of your token>
    2. 2.
      liquidityToken: <0>
    3. 3.
      include option should be enabled
    4. 4.
      candidateCount: <the current candidate count noted down previously in step 5.1>
    5. 5.
      liquidityTokenCount: <the current liquidity token count noted down previously in step 5.2>

The latest block will contain similar events on this:

Increasing the Stake

If you ever need to increase your stake, follow this procedure
  • Visit the UI: Developer → Extrinsics
    • Make sure your account is selected
    • parachainStaking.scheduleCandidateBondMore
    • the amount of tokens you want to add, followed by 18 zeroes
  • wait 2 sessions (1 session on the testnet is 6 hours)
  • Visit the UI: Developer → Extrinsics
    • Make sure your account is selected
    • parachainStaking.executeCandidateBondRequest

5.4 Wait

The node will join the active set. You will have to wait for one full session, so 4-8 hours.
You can also check the dashboard at https://stakemgx.com/ which shows the current nodes.
Please also share your successful event in Discord.