How To Set Up A Collator For Moonbeam With OnFinality
OnFinality is a blockchain infrastructure platform that saves web3 builders time and makes their lives easier. We deliver easy-to-use, reliable and scalable API endpoints for the biggest blockchain networks and empower developers to automatically test, deploy, scale and monitor their own blockchain nodes in minutes.
We are already supporting over 70 networks including Avalanche, BNB Chain, Cosmos, Polkadot, Ethereum, and Polygon, and are continuously expanding these mission-critical services to other ecosystems to help developers build the decentralised future, faster!
In this How-To Guide, you will learn how to set up your own Collator for Moonbeam, which will enable you to earn block rewards. This guide should be used alongside Moonbeam’s official guide which is kept up to date and includes more detail.
What is Moonbeam? ($GLMR)
Moonbeam is a smart contract platform for building cross-chain connected applications that can access users, assets, and services on any chain. By uniting functionality from Ethereum, Cosmos, Polkadot and more into a single platform, Moonbeam solves today’s fragmented user experience — unlocking true interoperability and paving the way for the next generation of applications.
Why run a Collator for Moonbeam
A collator plays an essential role in the Moonbeam network and is responsible for crucial tasks, including block production and transaction confirmation.
Collators are a key element of XCMP (Cross-Chain Message Passing). By being full-nodes of the Relay Chain, they are all aware of each other as peers. This makes it possible for them to send messages from parachain A to parachain B.
At every block you produce as a collator, rewards will automatically be transferred to your account. The reward includes block reward + fees.
- Run a Collator Node | Moonbeam Docs
- Collators FAQ | Moonbeam Docs
- Collator Account Management | Moonbeam Docs
- Managing an Identity | Moonbeam Docs
- Moonbeam Collator Requirements
- Moonbeam Collator Activities
- Run A Validator with OnFinality (Video Guide)
Running a Collator or Validator comes with a high risk and requires a high level of technical knowledge and skill. As per our Terms of Service, OnFinality is neither responsible for any rewards nor losses, such as from slashing, incurred when running a Validator or Collator node on OnFinality. Users should read and fully understand the relevant documentation for the Network before setting up the node, and get in touch directly with the Network if they have any questions or concerns.
HOW TO SET UP A MOONBEAM COLLATOR
1. Log in to OnFinality
Create an account and log in to OnFinality, then add a payment method.
2. Create Dedicated Node
Select the Dedicated Nodes menu and press “Deploy New Node”
2.1 Select Network
Search for Moonbeam and then click “Deploy Node”
2.2 Configure Moonbeam Node
Enter an easily identifiable Display Name and select the Collator Node Type. Select the latest Image Version.
Scroll down to set the Cloud Provider and Region where you will run the node. Networks may have a preference of where you should run your validator or collator, so check with their official documentation.
Look out for the Lightning Restore indicator to get the node running as fast as possible.
Use at least the recommended configuration suggested by the network, then press “Next”
2.3 Configure Launch Arguments
Next, review the node’s Launch Configuration. The recommended settings are usually sufficient, but we recommend comparing with official documentation to be certain.
Press “Next” at the bottom of the screen
2.4 Review Node
Finally, review the node’s settings and press “Deploy Node”
3. Sync Your Dedicated Node
Once your node is successfully deployed, you can find it in the “Dedicated Nodes” section on our portal. Click on your node and confirm the following:
- Relay chain/ parachain blocks are syncing appropriately
- No configuration errors in the console log. You can find your console by clicking on “Console logs” on the top right hand.
- CPU, Memory, and Storage are within reasonable range of use.
You can cross-reference the respective network blocks on the PolkadotJS App.
4. Set up Accounts and Stake
To run a collator you will need to set up two accounts:
This account holds funds bonded for staking, but delegates some functions to the Controller account. It can be kept in a cold wallet, meaning it can stay offline all the time.
This account acts on behalf of the Stash account, signalling decisions and necessary execution for staking. It only needs enough funds to pay transaction fees.
Follow Polkadex’s walkthrough video to Set Up Your Stake.
5. Generate Session Keys
Session keys are what links the validator or collator to your account.
First, locate your Dedicated Node’s RPC endpoints under API Endpoints. Access is secured by an API Key at the end of the URL, so keep it safe and private.
Option 1 — Polkadot-JS:
Copy your RPC — Websocket endpoint into the Polkadot-JS Custom Endpoint and press save to connect to the node
Navigate to Developer > RPC Calls and submit an author rotateKeys call.
Record the result.
Option 2 — CLI:
Generate the session keys on your Dedicated Node via the author_rotateKeys RPC Request, using your Dedicated Node’s RPC — Http url.
curl **Node’s RPC Http endpoint here** -H \ “Content-Type:application/json;charset=utf-8” -d \
You will get a response like this
The content after “result” is the session keys of your collator node
6. Set Session Keys
In Polkadot.js portal open Developer > Extrinsic
Select your collator account and extrinsic type: session / setKeys
Enter the session keys using the response from author_rotateKeys in step 5, which is the concatenated public keys of your Nimbus ID and VRF key
Submit the transaction.
7. Set Identity
Go to the Polkadot.js portal: Accounts
Open the 3 dots next to your collators address: Set on-chain identity
Enter all fields you want to set.
After you’re done filling in your information and the deposit amount looks alright to you, click “Set Identity”.
You will then be prompted to sign the transaction. If everything looks good, you can enter your password and click “Sign and Submit” to sign and send the transaction.
8. Request Judgement
Go to the Polkadot.js portal: Developer > Extrinsic
Select your collator account and extrinsic type: identity / requestJudgment
Send the transaction.
9. Bond Funds
To start collating, you need to have 100 000 GLMR for Moonbeam.
Go to the Polkadot.js portal: Developer > Extrinsics
Select your collator account and extrinsic type: CollatorSelection / joinCandidates
Submit the transaction.
If you have followed all of these steps, and been selected to be a part of the collator set, you are now running a Moonbeam Collator!
Once your collator is active, you will see your name inside “Network” tab every time you produce a block:
Developer documentation: https://documentation.onfinality.io/support/
OnFinality is a blockchain infrastructure platform that saves web3 builders time and makes their lives easier. OnFinality delivers scalable API endpoints for the biggest blockchain networks and empowers developers to automatically test, deploy, scale and monitor their own blockchain nodes in minutes. To date, OnFinality has served over 300 billion RPC requests across 70 networks including Avalanche, BNB Chain, Cosmos, Polkadot, and Ethereum, and is continuously expanding these mission-critical services so developers can build the decentralised future, faster!