docs: update RPC server documentation, add missing methods
And drop doc.go from server package as it duplicates docs/rpc.md and has no value of its own (TODO list is managed with GitHub issues, really). Also, RPC server is not really expected to be used by non-neo-go packages (contrary to the client).
This commit is contained in:
parent
7480ad1a4d
commit
f747b39bc6
2 changed files with 26 additions and 48 deletions
26
docs/rpc.md
26
docs/rpc.md
|
@ -42,7 +42,9 @@ which would yield the response:
|
|||
| `getblock` | Yes |
|
||||
| `getblockcount` | Yes |
|
||||
| `getblockhash` | Yes |
|
||||
| `getblockheader` | No (#711) |
|
||||
| `getblocksysfee` | Yes |
|
||||
| `getclaimable` | Yes |
|
||||
| `getconnectioncount` | Yes |
|
||||
| `getcontractstate` | Yes |
|
||||
| `getnep5balances` | No (#498) |
|
||||
|
@ -51,8 +53,11 @@ which would yield the response:
|
|||
| `getrawmempool` | Yes |
|
||||
| `getrawtransaction` | Yes |
|
||||
| `getstorage` | Yes |
|
||||
| `gettransactionheight` | No (#713) |
|
||||
| `gettxout` | Yes |
|
||||
| `getunclaimed` | No (#712) |
|
||||
| `getunspents` | Yes |
|
||||
| `getvalidators` | No (#714) |
|
||||
| `getversion` | Yes |
|
||||
| `invoke` | Yes |
|
||||
| `invokefunction` | Yes |
|
||||
|
@ -61,6 +66,27 @@ which would yield the response:
|
|||
| `submitblock` | No (#344) |
|
||||
| `validateaddress` | Yes |
|
||||
|
||||
### Unsupported methods
|
||||
|
||||
Methods listed down below are not going to be supported for various reasons
|
||||
and we're not accepting issues related to them.
|
||||
|
||||
| Method | Reason |
|
||||
| ------- | ------------|
|
||||
| `claimgas` | Doesn't fit neo-go wallet model, use CLI to do that |
|
||||
| `dumpprivkey` | Shouldn't exist for security reasons, see `claimgas` comment also |
|
||||
| `getbalance` | Use `getaccountstate` instead, see `claimgas` comment also |
|
||||
| `getmetricblocktimestamp` | Not really useful, use other means for node monitoring |
|
||||
| `getnewaddress` | See `claimgas` comment |
|
||||
| `getunclaimedgas` | Use `getunclaimed` instead, see `claimgas` comment also |
|
||||
| `getwalletheight` | Not applicable to neo-go, see `claimgas` comment |
|
||||
| `importprivkey` | Not applicable to neo-go, see `claimgas` comment |
|
||||
| `listaddress` | Not applicable to neo-go, see `claimgas` comment |
|
||||
| `listplugins` | neo-go doesn't have any plugins, so it makes no sense |
|
||||
| `sendfrom` | Not applicable to neo-go, see `claimgas` comment |
|
||||
| `sendmany` | Not applicable to neo-go, see `claimgas` comment |
|
||||
| `sendtoaddress` | Not applicable to neo-go, see `claimgas` comment |
|
||||
|
||||
#### Implementation notices
|
||||
|
||||
##### `invokefunction` and `invoke`
|
||||
|
|
|
@ -1,48 +0,0 @@
|
|||
/*
|
||||
Package server implements NEO-specific JSON-RPC 2.0 server.
|
||||
This package is currently in alpha and is subject to change.
|
||||
|
||||
Server
|
||||
|
||||
The server is written to support as much of the JSON-RPC 2.0 Spec as possible.
|
||||
The server is run as part of the node currently.
|
||||
|
||||
TODO:
|
||||
Implement HTTPS server.
|
||||
Add remaining methods (Documented below).
|
||||
Add Swagger spec and test using dredd in circleCI.
|
||||
|
||||
Example call
|
||||
|
||||
An example would be viewing the version of the node:
|
||||
|
||||
$ curl -X POST -d '{"jsonrpc": "2.0", "method": "getversion", "params": [], "id": 1}' http://localhost:20332
|
||||
|
||||
which would yield the response:
|
||||
|
||||
{
|
||||
"jsonrpc" : "2.0",
|
||||
"id" : 1,
|
||||
"result" : {
|
||||
"port" : 20333,
|
||||
"useragent" : "/NEO-GO:0.36.0-dev/",
|
||||
"nonce" : 9318417
|
||||
}
|
||||
}
|
||||
|
||||
Unsupported methods
|
||||
|
||||
getblocksysfee
|
||||
getcontractstate (needs to be implemented in pkg/core/blockchain.go)
|
||||
getrawmempool (needs to be implemented on in pkg/network/server.go)
|
||||
getrawtransaction (needs to be implemented in pkg/core/blockchain.go)
|
||||
getstorage (lacks VM functionality)
|
||||
gettxout (needs to be implemented in pkg/core/blockchain.go)
|
||||
invoke (lacks VM functionality)
|
||||
invokefunction (lacks VM functionality)
|
||||
invokescript (lacks VM functionality)
|
||||
sendrawtransaction (needs to be implemented in pkg/core/blockchain.go)
|
||||
submitblock (needs to be implemented in pkg/core/blockchain.go)
|
||||
|
||||
*/
|
||||
package server
|
Loading…
Reference in a new issue