Skip to main content

Become a collator

Introduction

Setting up a Glue collator node is essential for securing the network and earning staking rewards. This guide walks you through the technical steps to set up a collator, from installing the necessary software to managing keys and synchronizing your node with the chain.

Running a collator requires a commitment to maintaining a stable, secure infrastructure. Collators are responsible for their own stakes and those of nominators who trust them with their tokens. Proper setup and ongoing management are critical to ensuring smooth operation and avoiding potential penalties such as slashing.

System setup

Before you can begin running your validator, you'll need to configure your server environment to meet the operational and security standards required for validating. Configuration includes setting up time synchronization, ensuring critical security features are active, and installing the necessary binaries. Proper setup at this stage is essential to prevent issues like block production errors or being penalized for downtime. Below are the essential steps to get your system ready.

Install Network Time Protocol Client

Accurate timekeeping is critical to ensure your validator is synchronized with the network. Validators need local clocks in sync with the blockchain to avoid missing block authorship opportunities. Using Network Time Protocol (NTP) is the standard solution to keep your system's clock accurate.

If you are using Ubuntu version 18.04 or newer, the NTP Client should be installed by default. You can check whether you have the NTP client by running:

timedatectl

If NTP is running, you should see a message like the following:

System clock synchronized: yes

If NTP is not installed or running, you can install it using:

sudo apt-get install ntp

After installation, NTP will automatically start. To check its status:

sudo ntpq -p

This command will return a message with the status of the NTP synchronization. Skipping this step could result in your validator node missing blocks due to minor clock drift, potentially affecting its network performance.

Verify Landlock is Activated

Landlock is an important security feature integrated into Linux kernels starting with version 5.13. It allows processes, even those without special privileges, to limit their access to the system to reduce the machine's attack surface. This feature is crucial for validators, as it helps ensure the security and stability of the node by preventing unauthorized access or malicious behavior.

To use Landlock, ensure you use the reference kernel or newer versions. Most Linux distributions should already have Landlock activated. You can check if Landlock is activated on your machine by running the following command as root:

dmesg | grep landlock || journalctl -kg landlock

If Landlock is not activated, your system logs won't show any related output. In this case, you will need to activate it manually or ensure that your Linux distribution supports it. Most modern distributions with the required kernel version should have Landlock activated by default. However, if your system lacks support, you may need to build the kernel with Landlock activated. For more information on doing so, refer to the official kernel documentation.

Implementing Landlock ensures your node operates in a restricted, self-imposed sandbox, limiting potential damage from security breaches or bugs. While not a mandatory requirement, enabling this feature greatly improves the security of your validator setup.

Increase network connection pool limit

We can check the limit with

sysctl net.netfilter.nf_conntrack_max

and the actual usage with

cat /proc/sys/net/netfilter/nf_conntrack_count

and check that we are not close to the limit.

Read more about conntrack.

Synchronize a node

The next step is to sync your node with the blockchain network. Synchronization is necessary to download and validate the blockchain data, ensuring your node is ready to participate as a validator.

We need a synchronized full node. To achieve this follow Setup parachain node and make sure that in the parachain arguments (first block before --),

  • you use --pruning archive argument,
  • you add an additional --collator that tells the node to try authoring.

Bond Glue

Ask an admin to bond the desired amount above minimum of currently 50'000 GLUE from your funded account. He will need an extra 100 GLUE for bonding (apart from stake) at the first time creating a session key mapping. Also some GLUE should be on same account on top to pay for transactions.

Rotate session keys

curl -X POST --data '{"method":"author_rotateKeys","params":[],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST http://localhost:9963

(Use the parachain rpc port.)

E.g. return something like

{"jsonrpc":"2.0","id":1,"result":"0x2aea8ff351f9139cb22fb27e33978b2c283cea4c913a591e4698f9ba1796885f120268cfdef745e54e9d27dff7cc9d503727fd57044053071ba6ab2f840fca10"}

Issue the following transaction to any parachain node:

const tx = api.tx.authorMapping.setKeys(
"0x2aea8ff351f9139cb22fb27e33978b2c283cea4c913a591e4698f9ba1796885f120268cfdef745e54e9d27dff7cc9d503727fd57044053071ba6ab2f840fca10",
);

Observe block production

The block production should eventually (depdending on when new round starts) include your newly setup collator: