Management API
The APIs supported by abeychain are mainly based on function modules: admin, miner, personal, etc. These APIs are provided using JSON-RPC.
gabey comes with a JavaScript console that supports all of the APIs described here. To provide these APIs through gabey RPC, specify them with the --${interface}api command line argument. Where ${interface} can be HTTP rpc, WebSocket ws and Unix socket ipc or Windows pipe
For example: gabey --ipcapi admin, abey,miner --rpc api abey,web3 --rpc
- 1.Enable administrators, official DApp and miner APIs via IPC interface
- 2.Enable official DApp and web3 API via HTTP interface
The HTTP RPC interface must be explicitly enabled using the
--rpc
flag.Please note, offering an API over the HTTP (
rpc
) or WebSocket (ws
) interfaces will give everyone access to the APIs who can access this interface (DApps, browser tabs, etc). Be careful which APIs you enable. By default gabey enables all APIs over the IPC (ipc
) interface and only the db
, abey
, net
and web3
APIs over the HTTP and WebSocket interfaces.To determine which APIs an interface provides, the
modules
JSON-RPC method can be invoked. For example over an ipc
interface on unix systems:echo '{"jsonrpc":"2.0","method":"rpc_modules","params":[],"id":1}' | nc -U $datadir/gabey.ipc
will give all enabled modules including the version number:
{
"id":1,
"jsonrpc":"2.0",
"result":{
"admin":"1.0",
"debug":"1.0",
"abey":"1.0",
"miner":"1.0",
"net":"1.0",
"personal":"1.0",
"rpc":"1.0",
"txpool":"1.0",
"web3":"1.0"
}
}
​ | ​ | |||||
​ | ​ | |||||
​ | ​ | |||||
​ | ​ | ​ | ​ | |||
​ | ​ | ​ | ​ | |||
​ | ​ | ​ | ​ | ​ | ||
​ | ​ | ​ | ​ | ​ | ||
​ | ​ | ​ | ​ | ​ | ||
​ | ​ | ​ | ​ | ​ | ||
​ | ​ | ​ | ​ | ​ | ||
​ | ​ | ​ | ​ | ​ | ||
​ | ​ | ​ | ​ | ​ | ||
​ | ​ | ​ | ​ | ​ | ||
​ | ​ | ​ | ​ | ​ | ||
​ | ​ | ​ | ​ | ​ | ||
​ | ​ | ​ | ​ | ​ | ||
​ | ​ | ​ | ​ | ​ | ||
​ | ​ | ​ | ​ | ​ | ||
​ | ​ | ​ | ​ | ​ | ||
​ | ​ | ​ | ​ | ​ | ||
​ | ​ | ​ | ​ | ​ | ||
​ | ​ | ​ | ​ | ​ | ||
​ | ​ | ​ | ​ | ​ | ​ | |
​ | ​ | ​ | ​ | ​ | ​ | |
​ | ​ | ​ | ​ | ​ | ​ | |
​ | ​ | ​ | ​ | ​ | ​ | |
​ | ​ | ​ | ​ | ​ | ​ | |
​ | ​ | ​ | ​ | ​ | ​ | |
​ | ​ | ​ | ​ | ​ | ​ | |
​ | ​ | ​ | ​ | ​ | ​ | |
​ | ​ | ​ | ​ | ​ |