Erigon Run
Overview
The erigon command runs Erigon on an existing Erigon datadir.
Command Syntax
cd <erigon_home> && ./build/bin/erigon --datadir=<path> --http.api admin,debug,eth,parity,erigon,trace,web3,txpool,ots,net --ws [other-flags]
Required Flags
--datadir: Path to the Erigon datadir (required)
Usage Patterns
Change HTTP port
cd <erigon_home_path> && ./build/bin/erigon --datadir=<datadir_path> --http.port=8546
WebSocket support
cd <erigon_home_path> && ./build/bin/erigon --datadir=<datadir_path> --ws
GraphQL support
cd <erigon_home_path> && ./build/bin/erigon --datadir=<datadir_path> --graphql
Important Considerations
Before Running
- Ask for Erigon home: Ask the user which Erigon home folder to use if not already provided
- Stop Erigon and RpcDaemon: Ensure Erigon and/or RpcDaemon are not running on the target datadir
- Ensure Erigon binary is built: run
make erigonto build it
After Running
- Wait until the HTTP port (value provided with --http.port or default 8545) is reachable
Workflow
When the user wants to run Erigon:
Confirm parameters
- Ask for Erigon home path to use if not provided or know in context
- Ask for target datadir path
Safety checks
- Verify Erigon home exists
- Verify datadir exists
- Check if Erigon and/or RpcDaemon are running (should not be)
Error Handling
Common issues:
- "datadir not found": Verify the path is correct
- "database locked": Stop Erigon process first
Examples
Example 1: All API namespaces and WebSocket enabled
cd ../erigon_devel && ./build/bin/erigon --datadir=~/Library/erigon-eth-mainnet --http.api admin,debug,eth,parity,erigon,trace,web3,txpool,ots,net --ws
Tips
- If building from source, use
make erigonwithin to build the binary atbuild/bin/erigon