Erste Schritte mit TheRPC

Curl

This guide demonstrates how to interact with Ethereum nodes directly using Curl commands. This is useful for testing, debugging, and understanding the underlying API calls.

Aufgepasst!
Hallo! Nur ein freundlicher Hinweis: Diese Seite soll Ihnen einen soliden Überblick über die Arbeit mit Curl/Http Anfragen geben. Für praktische Codebeispiele schauen Sie sich unsere API Methods documentation an, wo Sie einsatzbereite Beispiele in allen unterstützten Sprachen finden!

Basic Usage

Here's a basic example of getting the latest block number:

curl -X POST \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \
  YOUR_ETHEREUM_NODE_URL

Authentication

When using authenticated endpoints:

curl -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \
  YOUR_ETHEREUM_NODE_URL

Common Operations

Get Balance

curl -X POST \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0x742d35Cc6634C0532925a3b844Bc454e4438f44e","latest"],"id":1}' \
  YOUR_ETHEREUM_NODE_URL

Get Transaction

curl -X POST \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0x88df016429689c079f3b2f6ad39fa052532c56795b733da78a91ebe6a713944b"],"id":1}' \
  YOUR_ETHEREUM_NODE_URL

See also

Helfen Sie uns, besser zu werden!
Teilen Sie diese Seite und helfen Sie uns, ein noch besseres Produkt für Sie zu erstellen.