Skip to content

Instantly share code, notes, and snippets.

@code-machina
Created December 16, 2018 23:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save code-machina/10787a430b64a6039135f42d14eeb95a to your computer and use it in GitHub Desktop.
Save code-machina/10787a430b64a6039135f42d14eeb95a to your computer and use it in GitHub Desktop.
Ethereum JSON-RPC 명령어 모음 (geth, ethereum, json-rpc)
# ethereum 마이닝이 진행 중인지 확인한다.
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0", "method":"eth_mining","params":[], "id":10}' ${RPC_HOST}:8545
# output: {"jsonrpc":"2.0","id":10,"result":true}
# ethereum 계정의 목록을 확인한다.
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0", "method":"personal_listAccounts","params":[], "id":10}' ${RPC_HOST}:8545
# {"jsonrpc":"2.0","id":10,"result":["0x4.........."]}
# 현재 블록 수를 확인한다.
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0", "method":"eth_blockNumber","params":[], "id":10}' ${RPC_HOST}:8545
# output: {"jsonrpc":"2.0","id":10,"result":"0x1f2"}
@code-machina
Copy link
Author

curl 을 이용해 private network 의 geth json-rpc 인터페이스를 이용 할 수 있음

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment