2019-09-18 07:55:39 +00:00
# RPC
## Client
Client is provided as a Go package, so please refer to the
[relevant godocs page ](https://godoc.org/github.com/nspcc-dev/neo-go/pkg/rpc ).
## Server
The server is written to support as much of the [JSON-RPC 2.0 Spec ](http://www.jsonrpc.org/specification ) as possible. The server is run as part of the node currently.
### Example call
An example would be viewing the version of the node:
```bash
$ curl -X POST -d '{"jsonrpc": "2.0", "method": "getversion", "params": [], "id": 1}' http://localhost:20332
```
which would yield the response:
```json
{
"jsonrpc" : "2.0",
"id" : 1,
"result" : {
"port" : 20333,
"useragent" : "/NEO-GO:0.36.0-dev/",
"nonce" : 9318417
}
}
```
### Supported methods
| Method | Implemented |
| ------- | ------------|
| `getaccountstate` | Yes |
2019-11-16 21:33:42 +00:00
| `getapplicationlog` | No (#500) |
2019-09-18 07:55:39 +00:00
| `getassetstate` | Yes |
| `getbestblockhash` | Yes |
| `getblock` | Yes |
| `getblockcount` | Yes |
| `getblockhash` | Yes |
2019-11-16 21:33:42 +00:00
| `getblocksysfee` | No (#341) |
2019-09-18 07:55:39 +00:00
| `getconnectioncount` | Yes |
2019-11-16 21:33:42 +00:00
| `getcontractstate` | No (#342) |
| `getnep5balances` | No (#498) |
| `getnep5transfers` | No (#498) |
2019-09-18 07:55:39 +00:00
| `getpeers` | Yes |
2019-11-16 21:33:42 +00:00
| `getrawmempool` | No (#175) |
| `getrawtransaction` | Yes |
| `getstorage` | No (#343) |
| `gettxout` | No (#345) |
| `getunspents` | Yes |
2019-09-18 07:55:39 +00:00
| `getversion` | Yes |
2019-11-16 21:33:42 +00:00
| `invoke` | No (#346) |
2019-11-26 10:13:17 +00:00
| `invokefunction` | Yes |
2019-11-16 21:33:42 +00:00
| `invokescript` | Yes |
| `sendrawtransaction` | Yes |
| `submitblock` | No (#344) |
2019-09-18 07:55:39 +00:00
| `validateaddress` | Yes |
2019-11-26 10:13:17 +00:00
#### Implementation notices
##### `invokefunction`
neo-go's implementation of `invokefunction` does not return `tx` field in the
answer because that requires signing the transaction with some key in the
server which doesn't fit the model of our node-client interactions. Lacking
this signature the transaction is almost useless, so there is no point in
returning it.
2019-09-18 07:55:39 +00:00
## Reference
* [JSON-RPC 2.0 Specification ](http://www.jsonrpc.org/specification )
* [NEO JSON-RPC 2.0 docs ](https://docs.neo.org/en-us/node/cli/apigen.html )