Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs Request: Add a "Base Node Issue solving Guide" to tutorials/run-a-base-node/ ,to help operators solve their issues. #1210

Open
azeonmarket opened this issue Nov 6, 2024 · 0 comments
Labels
base docs review To be reviewed by the Base docs team

Comments

@azeonmarket
Copy link

azeonmarket commented Nov 6, 2024

What is the issue you are encountering with the docs?

### Base website GitHub issue – Base Node Issue solving Guide

Running a base node can come with its own set of challenges and common errors with the configurations & resources. You can always get help from team, moderators or community helpers, on Base Discord in the “node-operators” channel.
Therefore sometimes it can be solved faster with these next little tips. Here are some issues that may affect the proper functioning of your base node:

  1. Network Connectivity Issues:
    • Problems with your internet connection can prevent your node from communicating with the network. Ensure that your internet connection is stable and that you have the correct ports open.
  • Ensure your node is connected to the network:
    curl http://localhost: 8545 (or 7545 if its stetted with this port)  ```
    
  1. Firewall/Router Settings:
    • Incorrect firewall settings may block incoming and outgoing connections. You may need to modify your firewall and router settings to allow traffic on the necessary ports.
  • Make sure that the necessary ports are open. For Base network nodes, it might involve different ports:
    sudo ufw allow 8545 (or 7545 if its stetted with this port)  # Allow JSON-RPC
    sudo ufw allow 30303 # Allow P2P communications (if applicable)
  1. Resource Limitations:
    • Insufficient CPU, RAM, or disk space can cause the node to underperform or crash. Ensure your hardware meets the recommended specifications for the node you are running.
  • Monitor your system's resource usage:
    top                # For CPU and memory
    free -h           # Check memory availability
    df -h             # Check disk space
  1. Software Bugs:

    • Your node software may contain bugs or compatibility issues. Ensure you're running the latest version of the software, and check for known issues or bug reports from the development community.
       Check on Base Discord Channel : “mainnet-announcements”
  2. Configuration Errors:

    • Misconfiguration in node settings can prevent proper operation. Double-check configuration files to ensure all settings are correct.
  • Verify your configuration settings, which may be in a file like config.json:
    nano /path/to/base-node/config/config.json
  1. Data Corruption:

    • If the blockchain data or node data directory becomes corrupted, it may cause your node to malfunction. Ensure data integrity and consider running repair commands if necessary.
  2. Synchronization Issues:

    • Your node may struggle to sync with the network due to high latency, poor network conditions, or a low number of peers. Monitor the sync status and peer connections.
  • If your node is not syncing, check the synchronization status:
    curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' http://localhost: 8545 (or 7545 if its stetted with this port)

https://github.com/base-org/node/blob/main/README.md

  1. Peer Connectivity:
    • If your node can’t find peers to connect to, it may be isolated from the network. Check your peer list and consider adding more peers manually if necessary.
  • Check the number of peers connected to your node:
    curl -X POST --data '{"jsonrpc":"2.0","method":"net_peerCount","params":[],"id":1}' http://localhost: 8545 (or 7545 if its stetted with this port)
  1. Resource Limits from the Operating System:
    • Some operating systems impose limits on the number of file descriptors or processes. Adjust these limits if you encounter errors related to resource availability.
      Context for Using the Prune Command
  • Space Constraints: If your node is running on a device with limited disk space, pruning can significantly reduce the storage requirements. This is especially applicable for full nodes, which need to store the entire blockchain history.
  • Performance Optimization: Reducing the size of the data can also help improve performance, as it decreases the amount of data that the node has to manage, which can lead to faster synchronization and responsiveness.
    Geth ethereum clients :
    Check Your Current Configuration: Before using the prune command, check your current node configuration and data size:
geth --datadir /path/to/your/data/folder

Run the Node with Pruning: When starting your node, you can specify pruning options. For instance, with Geth, you can start your node with the --prune flag and specify a pruning mode. Here’s an example command:

geth --syncmode=fast --prune=64

In this command, 64 means that you'll keep the most recent 64MB of historical data.
Reth ethereum clients:

  1. Check Documentation: Always begin by consulting the official Reth documentation for the most up-to-date commands and features related to pruning, as client architectures are subject to change.
  2. Command-Line Arguments: When starting your Reth node, you can use command-line arguments to enable pruning. Here’s an example command that might typically be used:
reth --pruning-mode=fast

The --pruning-mode option specifies the pruning strategy. Options may include:
o fast: Keeps some recent blockchain state data and prunes older data.
o full: May indicate a mode where all historical data is kept (if available).
o archive: Typically indicates that the node keeps all historical data and doesn’t prune.

  1. Missing Dependencies:
    • Ensure that all software dependencies required by your node are installed. Missing libraries, drivers, or other software can impede functionality.
  npm install <package-name>
  1. Upgrade Issues:

    • Problems can arise during upgrades if new versions introduce breaking changes or if the upgrade process is not completed properly.
  2. Logs and Monitoring:

    • Ignoring log files can lead to missing critical error messages that diagnose issues. Regularly check your logs for any alarming messages or warnings.
  • Access the log files generated by your Base network node to spot any issues or anomalies:
    tail -f /path/to/base-node/logs/base.log
  1. Insufficient Security:
    • Without proper security measures (like encryption, secure keys, etc.), your node may be at risk of attacks, leading to downtime or data loss.
  • Make sure your node is secured, with strong passwords and firewalls. Regularly apply security updates.
  • Use tools to monitor for unauthorized access.
  1. Outdated Blockchain Data:
    • If your node is not kept up to date with the blockchain network, it may become non-functional or obsolete. Regular software updates are essential.

By proactively monitoring your node for these common issues and addressing them as they arise, you can ensure that your base node runs smoothly and effectively contributes to the network.
You can download snapshot with bash wget <snapshot_url> . https://docs.base.org/tutorials/run-a-base-node/#snapshots

Bonus :
15. Common Issues and Troubleshooting

  • Slow Syncing: Investigate network connectivity and consider adjusting gas limits or performance optimization settings.
  • Insufficient Peers: Make sure your port configurations are correct and examine your connectivity to the Base network.

16. Shutting Down Your Node safely to change parameters, do updates, or improvements

  • To stop your node without losing data or disrupting operations:
    -Using nmp :
    npm stop
  • Or if using Docker:
    docker stop <container_id>

To restart :
• Restarting the Node: After making your changes, restart your node using:

npm start (for a Node.js application.)

-Or if using Docker:

docker start <container_id> (for a Docker container.)

Bonus of the Bonus:
16 ** Issue with : Docker configuration problem with RETH (tells the node software to use implementation of the Layer 2 engine—reth) :

The variable OP_NODE_L2_ENGINE_KIND=reth is likely an environment variable that needs to be set in your Docker configuration to specify the Layer 2 engine being used by your node for the Base network. Here’s how you can use it in the context of a Docker Compose setup:
Using Docker Compose
If you’re using Docker Compose, you can set this environment variable in your docker-compose.yml file. Here’s an example:

version: '3.8'

services:
base_node:
  image: base-org/node:latest  # Replace with the actual image you are using
  environment:
    - OP_NODE_L2_ENGINE_KIND=reth
    # Add other necessary environment variables here
  volumes:
    - reth_data:/path/to/reth_data  # Use Docker volumes
  ports:
    - "port:port"  # Replace with actual ports you need

volumes:
reth_data:

Running Docker Directly
If you're running a Docker container directly without Docker Compose, you can set the environment variable with the -e flag when starting your container. For example:

docker run -e OP_NODE_L2_ENGINE_KIND=reth \
         -v reth_data:/path/to/reth_data \  # Use Docker volumes
         -p port:port \  # Replace with actual ports you need
         base-org/node:latest  # Replace with the actual image

Summary of Steps:

  1. Modify your docker-compose.yml or Docker command to include
- OP_NODE_L2_ENGINE_KIND=reth (in the Compose file) ``` or ```bash -e OP_NODE_L2_ENGINE_KIND=reth  (in the docker run command).
  1. Use Docker volumes instead of bind mounts for better performance, as you noted in your experience.
  2. Make sure to include any other necessary environment variables depending on your specific node setup.
    After making these changes, restart your Docker container or your Docker Compose setup. The node should now recognize the OP_NODE_L2_ENGINE_KIND configuration, and it should operate as expected with the specified Layer 2 engine.
    If you encounter any issues, check the logs for more information and verify that all required environment variables are set correctly.

If you need extra help from team, moderators or community helpers, please reach out for help on Base Discord in the “node-operators” channel. Stay based.

Useful docs :

Links to Impacted Docs

https://docs.base.org/tutorials/run-a-base-node/

Describe the solution you'd like to see.

Add a "Base Node Issue solving Guide" to tutorials/run-a-base-node/ ,to help operators solve their issues. In this way they could solve their Node problems/issues, faster and with less difficulty. Meaning that they could run it back turbo faster and with less struggle. This is a Draft of my Idea, it could be wrapped up more with less infos too.

Additional context

Base website github issue-Base Node Issue solving Guide Final.docx

@wbnns wbnns added state: backlog base docs review To be reviewed by the Base docs team and removed state: backlog labels Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
base docs review To be reviewed by the Base docs team
Projects
None yet
Development

No branches or pull requests

2 participants