mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-12 21:01:21 +00:00
wrote docs for rpc methods [ci skip]
for all of them except unsafe
This commit is contained in:
committed by
Zach Ramsay
parent
e9b7221292
commit
83ec9f773a
@ -6,8 +6,45 @@ import (
|
||||
ctypes "github.com/tendermint/tendermint/rpc/core/types"
|
||||
)
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Query the application for some information.
|
||||
//
|
||||
// ```shell
|
||||
// curl 'localhost:46657/abci_query?path=""&data="abcd"&prove=true'
|
||||
// ```
|
||||
//
|
||||
// ```go
|
||||
// client := client.NewHTTP("tcp://0.0.0.0:46657", "/websocket")
|
||||
// result, err := client.ABCIQuery("", "abcd", true)
|
||||
// ```
|
||||
//
|
||||
// > The above command returns JSON structured like this:
|
||||
//
|
||||
// ```json
|
||||
// {
|
||||
// "error": "",
|
||||
// "result": {
|
||||
// "response": {
|
||||
// "log": "exists",
|
||||
// "height": 0,
|
||||
// "proof": "010114FED0DAD959F36091AD761C922ABA3CBF1D8349990101020103011406AA2262E2F448242DF2C2607C3CDC705313EE3B0001149D16177BC71E445476174622EA559715C293740C",
|
||||
// "value": "61626364",
|
||||
// "key": "61626364",
|
||||
// "index": -1,
|
||||
// "code": 0
|
||||
// }
|
||||
// },
|
||||
// "id": "",
|
||||
// "jsonrpc": "2.0"
|
||||
// }
|
||||
// ```
|
||||
//
|
||||
// ### Query Parameters
|
||||
//
|
||||
// | Parameter | Type | Default | Required | Description |
|
||||
// |-----------+--------+---------+----------+---------------------------------------|
|
||||
// | path | string | false | false | Path to the data ("/a/b/c") |
|
||||
// | data | []byte | false | true | Data |
|
||||
// | prove | bool | false | false | Include a proof of the data inclusion |
|
||||
func ABCIQuery(path string, data data.Bytes, prove bool) (*ctypes.ResultABCIQuery, error) {
|
||||
resQuery, err := proxyAppQuery.QuerySync(abci.RequestQuery{
|
||||
Path: path,
|
||||
@ -23,6 +60,31 @@ func ABCIQuery(path string, data data.Bytes, prove bool) (*ctypes.ResultABCIQuer
|
||||
}, nil
|
||||
}
|
||||
|
||||
// Get some info about the application.
|
||||
//
|
||||
// ```shell
|
||||
// curl 'localhost:46657/abci_info'
|
||||
// ```
|
||||
//
|
||||
// ```go
|
||||
// client := client.NewHTTP("tcp://0.0.0.0:46657", "/websocket")
|
||||
// info, err := client.ABCIInfo()
|
||||
// ```
|
||||
//
|
||||
// > The above command returns JSON structured like this:
|
||||
//
|
||||
// ```json
|
||||
// {
|
||||
// "error": "",
|
||||
// "result": {
|
||||
// "response": {
|
||||
// "data": "{\"size\":3}"
|
||||
// }
|
||||
// },
|
||||
// "id": "",
|
||||
// "jsonrpc": "2.0"
|
||||
// }
|
||||
// ```
|
||||
func ABCIInfo() (*ctypes.ResultABCIInfo, error) {
|
||||
resInfo, err := proxyAppQuery.InfoSync()
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user