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.

주의하세요!
안녕하세요! 참고하실 점: 이 페이지는 Curl/Http 요청 작업에 대한 개요를 제공하기 위한 것입니다. 실습 코드 예제는 저희의 API Methods documentation 을 확인해 보세요. 거기서 모든 지원되는 언어로 바로 사용할 수 있는 예제를 찾을 수 있습니다!

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

더 나아지도록 도와주세요!
이 페이지를 공유하고 더 나은 제품을 만들 수 있도록 도와주세요.