以太坊系列五:Geth環境下在JsonRPC中的以太坊交互操作

一、簡介

以太坊的交互操作方式有console和JsonRPC,JsonRPC又有IPC、HTTP、WS等方式,例如開啓挖礦操作可以有以下方式:

  • Console: miner.start()

  • IPC: echo '{"jsonrpc":"2.0","method":"miner_start","params":[],"id":1}' | nc -U $datadir/geth.ipc

  • HTTP: curl -X POST --data '{"jsonrpc":"2.0","method":"miner_start","params":[],"id":74}' localhost:8545

console交互操作在系列四中已作介紹,在此介紹JsonRPC的交互接口(編寫程序時,在代碼中可使用RPC接口)

二、JsonRPC接口

詳情https://github.com/ethereum/wiki/wiki/JSON-RPC

JSON RPC API

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章