GQLite Daily Tips
Index CutestUI Docs
  • Getting started +
    • Installation
    • Quick start
    • Configuration
  • Fundamentals +
    • Overview
    • Architecture
    • Core concepts
  • Interacting with Geth +
    • JSON-RPC Server +
      • Introduction
      • Batch requests
      • Real-time Events
    • JSON-RPC Namespaces +
      • admin
      • clique
      • debug
      • eth
      • les
      • miner (deprecated)
      • net
      • personal (deprecated)
      • txpool
      • objects
    • JS Console
    • JS Console 2: Contracts
    • GraphQL server
  • Developers +
    • Building from source
    • Contributing
    • Development guide
    • API documentation
  • Monitoring +
    • Metrics
    • Logging
    • Health checks
  • Tools +
    • Command line options
    • Account management
    • Network setup
  • FAQs +
    • General questions
    • Troubleshooting
    • Security
  • Resources +
    • Documentation
    • Tutorials
    • Community
    • GitHub

JSON-RPC Server Introduction

The JSON-RPC server is one of the primary interfaces for interacting with Geth. It allows external applications to communicate with the Ethereum node using JSON-RPC protocol over HTTP, WebSocket, or IPC.

Overview

Geth provides a JSON-RPC API that can be accessed through different transport protocols. By default, the JSON-RPC server is disabled for security reasons, but it can be enabled with various command-line options.

Enabling the JSON-RPC Server

To start Geth with the JSON-RPC server enabled, you can use the following command:

geth --http --http.api eth,net,web3

API Methods

The JSON-RPC API provides various methods for interacting with the Ethereum blockchain. These methods are organized into namespaces such as eth, net, web3, and more.

Security Considerations

When enabling the JSON-RPC server, it's important to consider security implications. By default, the server only accepts connections from localhost. If you need to allow remote connections, use the --http.addr and --http.corsdomain options carefully.

Batch Requests

JSON-RPC supports batch requests, which allow you to send multiple requests in a single HTTP call. This can improve performance when you need to make multiple consecutive API calls.

Next Steps

  • Learn more about batch requests
  • Explore real-time events with WebSockets
  • Check out the available JSON-RPC namespaces

© 2025 Daily Tips. 保留所有权利。