Run a Verifier Node
Learn how to run a Verifier Node
A Verifier Node is a crucial component in securing your rollup by verifying the accuracy of data posted by the sequencer on the settlement layer. It acts as an observation node that monitors the rollup protocol, ensuring its integrity and security.
Downloading the Client
To begin, download the appropriate client based on your operating system:
verifier-linux.zip
verifier-macos.zip
verifier-win.zip
Unzip the downloaded file to get a folder containing the verifier node application:
- Linux:
verifier-linux/verifier-node-app-linux
- macOS:
verifier-macos/verifier-node-app-macos
- Windows:
verifier-win/verifier-node-app-win.exe
Minting the Node Key
Before running a node, an ERC2771 node key is required.
Getting the Gas Token
To mint the node key, you need the custom gas token of the chain. Visit the network’s public page and request the custom gas token from the faucet. After receiving it on the testnet, bridge it to the target chain following the instructions on the page.
Minting the Key
Once you have the gas token, mint the node key by calling the mint function on the contract:
- Navigate to
NodeKey.mint
- Fill in the required parameters:
_to
: Address to mint to_amount
: Number of NFTs to mint
Note: Projects can build a frontend page to make this process seamless and customized for users.
Delegating the Key
After minting your node key, delegate rights to an Operator to sign attestation transactions on your behalf. This ensures secure and efficient operation of your node.
- Navigate to
DelegateRegistry.delegateERC721
- Fill in the required parameters:
to
: Operator addresscontract_
: NodeKey contract addresstokenId
: ID of node key NFTrights
:0x0000000000000000000000000000000000000000000000000000000000000000
enable
: truesend native CGT
: 0
Note: For production projects, this step will be done on delegate.xyz.
Getting a Gelato Relay API Key
The Gelato API Key is crucial for running the node as it allows the node to use Gelato Relay for transaction fees. This simplifies the process by enabling the use of various tokens (like USDC) to pay for gas fees.
To obtain the Gelato API Key:
- Go to Gelato Relay
- Connect your wallet to create your account
- Click “Create App” and complete the basic details
- After creating the app, go to the details and copy the API key
Running the Node Client
On a Personal Computer
Using the CLI
- Open the terminal or command prompt
- Navigate to the directory containing the verifier node application
- Execute the application:
- Linux:
./verifier-node-app-linux
- macOS:
./verifier-node-app-macos
- Windows:
verifier-node-app-win.exe
- Linux:
- When prompted, enter the required details:
- Operator private key
- Gelato Relay API Key
- Node key IDs
Using the .env File
To avoid entering settings each time you launch the application, you can use a .env
file:
- Create a
.env
file in the folder containing the node application - Add the following environment variables:
On a Server
The verifier node is also available as a Docker image. Follow these steps to run it on a server:
- Create a Cloud Run job pulling the
gelatodigital/verifier-node
image - Set up the environment variables
- Add a scheduler trigger to execute the container every hour
Claiming Rewards
To claim rewards, call the claimReward
function on the Referee smart contract:
With foundry cast:
You will get the payload to call that looks like 0x86bb8f3700000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000032
Send a transaction with the payload:
Smart Contracts
As part of the Verifier Node package, Gelato provides essential smart contracts for this service:
- NodeKey: NFT contract for node licenses
- Referee: Manages attestations and rewards
- NodeRewards: Handles reward distribution
These contracts serve as the baseline and can be customized by projects to fit their specific requirements.
Benefits of Running a Verifier Node
- Community Engagement: Encourage community members to take an active role in securing the rollup
- Revenue Source: Projects can use Verifier Nodes as a revenue source through Node License sales
- Decentralization: Enable users to verify blocks and secure the network in exchange for rewards
- Security and Reliability: All smart contracts and the node client undergo rigorous audits
Package Includes
- Smart Contracts: Essential contracts for running the Node Sale
- Node Client: User-friendly client for easy setup and operation
- Hosted Node Integrations: Partnerships with node hosting providers for simplified deployment