The Moonbeam tracing node has a size of 1.5TB on May 2, 2024
Run a tracing node
Geth's debug and txpool APIs and OpenEthereum's trace module provide non-standard RPC methods for getting a deeper insight into transaction processing. Supporting these RPC methods is important because many protocols, such as The Graph, rely on them to index blockchain data.
To use the supported RPC methods, you need to run a tracing node. This guide covers the steps of how to set up and sync a tracing node on Moonbeam.
Move the Wasm overrides into your on-chain data directory:
Delete the override files for the networks that you aren't running
Set permissions for the overrides
Create the Configuration File
The next step is to create the systemd configuration file, you'll need to:
ReplaceINSERT_YOUR_NODE_NAME in two different places with the preffered name (it specifies a human-readable name for the node, which can be seen on telemetry, if enabled)
--db-cache specifies the memory the database cache is limited to use. It is recommended to set it to 50% of the actual RAM your server has. For example, for 128 GB RAM, the value must be set to 64000. The minimum value is 2000, but it is below the recommended specs
Double-check that the binary is in the proper path as described below (ExecStart)
Double-check the base path if you've used a different directory
Name the file /etc/systemd/system/moonbeam.service
Ensure that you grant execute permission to the binary file
Copy/Paste and edit INSERT_YOUR_NODE_NAME and --db-cache according to your parameters:
Ctrl+X and Y to save changes
--rpc-port sets the unified port for both HTTP and WS connections. The default port for parachains is 9944 and 9945 for the embedded relay chain
We run an RPC endpoint so we must use the --unsafe-rpc-external flag to run the Moonbeam node with external access to the RPC ports
To check or modify moonbeam.service parameters simply run
sudo nano /etc/systemd/system/moonbeam.service
Ctrl+X and Y to save changes
Maintain Your Node
As Moonbeam development continues, it will sometimes be necessary to upgrade your node software.
IMPORTANT NOTE: Make sure you update your tracing runtime overrides each time there is a new runtime upgrade, otherwise you won't be able to support the trace/debug/txpool API properly
For trace/debug/txpool API support
To update moonbeam client, you can keep your existing chain data in tact, and only update the binary by following these steps:
Stop the systemd service
Remove the old binary file
Get the latest version of the Moonbeam release binary on GitHub and run the following command to update to that version (ensure to replace INSERT_NEW_VERSION_TAGwith actual version)
systemctl enable moonbeam.service #enable moonbeam service at system startup
sudo systemctl daemon-reload #refresh systemd configuration when changes made
sudo systemctl start moonbeam.service #start moonbeam
sudo systemctl stop moonbeam.service #stop moonbeam
journalctl -f -u moonbeam.service #follow logs of moonbeam service
The logs should look like the below example and indicate that your node syncs and is expected to reach chainhead in 3-4 days
Syncing 27.0 bps, target=#6051603 (30 peers), best: #3053702 (0xe669…1876), finalized #918931 (0x6587…f763), ⬇ 484.9kiB/s ⬆ 0.5kiB/s