Fix typos in rpc docs.
This commit is contained in:
parent
75389e6169
commit
e6cadced03
|
@ -11,31 +11,31 @@ build_rpc_trait! {
|
||||||
/// Parity-bitcoin blockchain data interface.
|
/// Parity-bitcoin blockchain data interface.
|
||||||
pub trait BlockChain {
|
pub trait BlockChain {
|
||||||
/// Get hash of best block.
|
/// Get hash of best block.
|
||||||
/// @curl-example: curl --data-binary '{"jsonrpc": "2.0", "method": "getbestblockhash", "params": [], "id":1 }' -H 'content-type: application/json;' http://127.0.0.1:8332/
|
/// @curl-example: curl --data-binary '{"jsonrpc": "2.0", "method": "getbestblockhash", "params": [], "id":1 }' -H 'content-type: application/json' http://127.0.0.1:8332/
|
||||||
#[rpc(name = "getbestblockhash")]
|
#[rpc(name = "getbestblockhash")]
|
||||||
fn best_block_hash(&self) -> Result<H256, Error>;
|
fn best_block_hash(&self) -> Result<H256, Error>;
|
||||||
/// Get height of best block.
|
/// Get height of best block.
|
||||||
/// @curl-example: curl --data-binary '{"jsonrpc": "2.0", "method": "getblockcount", "params": [], "id":1 }' -H 'content-type: application/json;' http://127.0.0.1:8332/
|
/// @curl-example: curl --data-binary '{"jsonrpc": "2.0", "method": "getblockcount", "params": [], "id":1 }' -H 'content-type: application/json' http://127.0.0.1:8332/
|
||||||
#[rpc(name = "getblockcount")]
|
#[rpc(name = "getblockcount")]
|
||||||
fn block_count(&self) -> Result<u32, Error>;
|
fn block_count(&self) -> Result<u32, Error>;
|
||||||
/// Get hash of block at given height.
|
/// Get hash of block at given height.
|
||||||
/// @curl-example: curl --data-binary '{"jsonrpc": "2.0", "method": "getblockhash", "params": [0], "id":1 }' -H 'content-type: application/json;' http://127.0.0.1:8332/
|
/// @curl-example: curl --data-binary '{"jsonrpc": "2.0", "method": "getblockhash", "params": [0], "id":1 }' -H 'content-type: application/json' http://127.0.0.1:8332/
|
||||||
#[rpc(name = "getblockhash")]
|
#[rpc(name = "getblockhash")]
|
||||||
fn block_hash(&self, u32) -> Result<H256, Error>;
|
fn block_hash(&self, u32) -> Result<H256, Error>;
|
||||||
/// Get proof-of-work difficulty as a multiple of the minimum difficulty
|
/// Get proof-of-work difficulty as a multiple of the minimum difficulty
|
||||||
/// @curl-example: curl --data-binary '{"jsonrpc": "2.0", "method": "getdifficulty", "params": [], "id":1 }' -H 'content-type: application/json;' http://127.0.0.1:8332/
|
/// @curl-example: curl --data-binary '{"jsonrpc": "2.0", "method": "getdifficulty", "params": [], "id":1 }' -H 'content-type: application/json' http://127.0.0.1:8332/
|
||||||
#[rpc(name = "getdifficulty")]
|
#[rpc(name = "getdifficulty")]
|
||||||
fn difficulty(&self) -> Result<f64, Error>;
|
fn difficulty(&self) -> Result<f64, Error>;
|
||||||
/// Get information on given block.
|
/// Get information on given block.
|
||||||
/// @curl-example: curl --data-binary '{"jsonrpc": "2.0", "method": "getblock", "params": ["000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"], "id":1 }' -H 'content-type: application/json;' http://127.0.0.1:8332/
|
/// @curl-example: curl --data-binary '{"jsonrpc": "2.0", "method": "getblock", "params": ["000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"], "id":1 }' -H 'content-type: application/json' http://127.0.0.1:8332/
|
||||||
#[rpc(name = "getblock")]
|
#[rpc(name = "getblock")]
|
||||||
fn block(&self, H256, Trailing<bool>) -> Result<GetBlockResponse, Error>;
|
fn block(&self, H256, Trailing<bool>) -> Result<GetBlockResponse, Error>;
|
||||||
/// Get details about an unspent transaction output.
|
/// Get details about an unspent transaction output.
|
||||||
/// @curl-example: curl --data-binary '{"jsonrpc": "2.0", "method": "gettxout", "params": ["4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b", 0], "id":1 }' -H 'content-type: application/json;' http://127.0.0.1:8332/
|
/// @curl-example: curl --data-binary '{"jsonrpc": "2.0", "method": "gettxout", "params": ["4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b", 0], "id":1 }' -H 'content-type: application/json' http://127.0.0.1:8332/
|
||||||
#[rpc(name = "gettxout")]
|
#[rpc(name = "gettxout")]
|
||||||
fn transaction_out(&self, H256, u32, Trailing<bool>) -> Result<GetTxOutResponse, Error>;
|
fn transaction_out(&self, H256, u32, Trailing<bool>) -> Result<GetTxOutResponse, Error>;
|
||||||
/// Get statistics about the unspent transaction output set.
|
/// Get statistics about the unspent transaction output set.
|
||||||
/// @curl-example: curl --data-binary '{"jsonrpc": "2.0", "method": "gettxoutsetinfo", "params": [], "id":1 }' -H 'content-type: application/json;' http://127.0.0.1:8332/
|
/// @curl-example: curl --data-binary '{"jsonrpc": "2.0", "method": "gettxoutsetinfo", "params": [], "id":1 }' -H 'content-type: application/json' http://127.0.0.1:8332/
|
||||||
#[rpc(name = "gettxoutsetinfo")]
|
#[rpc(name = "gettxoutsetinfo")]
|
||||||
fn transaction_out_set_info(&self) -> Result<GetTxOutSetInfoResponse, Error>;
|
fn transaction_out_set_info(&self) -> Result<GetTxOutSetInfoResponse, Error>;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,10 +3,10 @@ use jsonrpc_core::Error;
|
||||||
use v1::types::{BlockTemplate, BlockTemplateRequest};
|
use v1::types::{BlockTemplate, BlockTemplateRequest};
|
||||||
|
|
||||||
build_rpc_trait! {
|
build_rpc_trait! {
|
||||||
/// Partiy-bitcoin miner data interface.
|
/// Parity-bitcoin miner data interface.
|
||||||
pub trait Miner {
|
pub trait Miner {
|
||||||
/// Get block template for mining.
|
/// Get block template for mining.
|
||||||
/// @curl-example: curl --data-binary '{"jsonrpc": "2.0", "method": "getblocktemplate", "params": [{"capabilities": ["coinbasetxn", "workid", "coinbase/append"]}], "id":1 }' -H 'content-type: application/json;' http://127.0.0.1:8332/
|
/// @curl-example: curl --data-binary '{"jsonrpc": "2.0", "method": "getblocktemplate", "params": [{"capabilities": ["coinbasetxn", "workid", "coinbase/append"]}], "id":1 }' -H 'content-type: application/json' http://127.0.0.1:8332/
|
||||||
#[rpc(name = "getblocktemplate")]
|
#[rpc(name = "getblocktemplate")]
|
||||||
fn get_block_template(&self, BlockTemplateRequest) -> Result<BlockTemplate, Error>;
|
fn get_block_template(&self, BlockTemplateRequest) -> Result<BlockTemplate, Error>;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,18 +6,18 @@ build_rpc_trait! {
|
||||||
/// Parity-bitcoin network interface
|
/// Parity-bitcoin network interface
|
||||||
pub trait Network {
|
pub trait Network {
|
||||||
/// Add/remove/connect to the node
|
/// Add/remove/connect to the node
|
||||||
/// @curl-example: curl --data-binary '{"jsonrpc": "2.0", "method": "addnode", "params": ["127.0.0.1:8888", "add"], "id":1 }' -H 'content-type: application/json;' http://127.0.0.1:8332/
|
/// @curl-example: curl --data-binary '{"jsonrpc": "2.0", "method": "addnode", "params": ["127.0.0.1:8888", "add"], "id":1 }' -H 'content-type: application/json' http://127.0.0.1:8332/
|
||||||
/// @curl-example: curl --data-binary '{"jsonrpc": "2.0", "method": "addnode", "params": ["127.0.0.1:8888", "remove"], "id":1 }' -H 'content-type: application/json;' http://127.0.0.1:8332/
|
/// @curl-example: curl --data-binary '{"jsonrpc": "2.0", "method": "addnode", "params": ["127.0.0.1:8888", "remove"], "id":1 }' -H 'content-type: application/json' http://127.0.0.1:8332/
|
||||||
/// @curl-example: curl --data-binary '{"jsonrpc": "2.0", "method": "addnode", "params": ["127.0.0.1:8888", "onetry"], "id":1 }' -H 'content-type: application/json;' http://127.0.0.1:8332/
|
/// @curl-example: curl --data-binary '{"jsonrpc": "2.0", "method": "addnode", "params": ["127.0.0.1:8888", "onetry"], "id":1 }' -H 'content-type: application/json' http://127.0.0.1:8332/
|
||||||
#[rpc(name = "addnode")]
|
#[rpc(name = "addnode")]
|
||||||
fn add_node(&self, String, AddNodeOperation) -> Result<(), Error>;
|
fn add_node(&self, String, AddNodeOperation) -> Result<(), Error>;
|
||||||
/// Query node(s) info
|
/// Query node(s) info
|
||||||
/// @curl-example: curl --data-binary '{"jsonrpc": "2.0", "id":"1", "method": "getaddednodeinfo", "params": [true] }' -H 'content-type: application/json;' http://127.0.0.1:8332/
|
/// @curl-example: curl --data-binary '{"jsonrpc": "2.0", "id":"1", "method": "getaddednodeinfo", "params": [true] }' -H 'content-type: application/json' http://127.0.0.1:8332/
|
||||||
/// @curl-example: curl --data-binary '{"jsonrpc": "2.0", "id":"1", "method": "getaddednodeinfo", "params": [true, "192.168.0.201"] }' -H 'content-type: application/json;' http://127.0.0.1:8332/
|
/// @curl-example: curl --data-binary '{"jsonrpc": "2.0", "id":"1", "method": "getaddednodeinfo", "params": [true, "192.168.0.201"] }' -H 'content-type: application/json' http://127.0.0.1:8332/
|
||||||
#[rpc(name = "getaddednodeinfo")]
|
#[rpc(name = "getaddednodeinfo")]
|
||||||
fn node_info(&self, bool, Trailing<String>) -> Result<Vec<NodeInfo>, Error>;
|
fn node_info(&self, bool, Trailing<String>) -> Result<Vec<NodeInfo>, Error>;
|
||||||
/// Query node(s) info
|
/// Query node(s) info
|
||||||
/// @curl-example: curl --data-binary '{"jsonrpc": "2.0", "id":"1", "method": "getconnectioncount", "params": [] }' -H 'content-type: application/json;' http://127.0.0.1:8332/
|
/// @curl-example: curl --data-binary '{"jsonrpc": "2.0", "id":"1", "method": "getconnectioncount", "params": [] }' -H 'content-type: application/json' http://127.0.0.1:8332/
|
||||||
#[rpc(name = "getconnectioncount")]
|
#[rpc(name = "getconnectioncount")]
|
||||||
fn connection_count(&self) -> Result<usize, Error>;
|
fn connection_count(&self) -> Result<usize, Error>;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,22 +9,22 @@ use v1::types::TransactionOutputs;
|
||||||
use v1::types::GetRawTransactionResponse;
|
use v1::types::GetRawTransactionResponse;
|
||||||
|
|
||||||
build_rpc_trait! {
|
build_rpc_trait! {
|
||||||
/// Partiy-bitcoin raw data interface.
|
/// Parity-bitcoin raw data interface.
|
||||||
pub trait Raw {
|
pub trait Raw {
|
||||||
/// Adds transaction to the memory pool && relays it to the peers.
|
/// Adds transaction to the memory pool && relays it to the peers.
|
||||||
/// @curl-example: curl --data-binary '{"jsonrpc": "2.0", "method": "sendrawtransaction", "params": ["01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000"], "id":1 }' -H 'content-type: application/json;' http://127.0.0.1:8332/
|
/// @curl-example: curl --data-binary '{"jsonrpc": "2.0", "method": "sendrawtransaction", "params": ["01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000"], "id":1 }' -H 'content-type: application/json' http://127.0.0.1:8332/
|
||||||
#[rpc(name = "sendrawtransaction")]
|
#[rpc(name = "sendrawtransaction")]
|
||||||
fn send_raw_transaction(&self, RawTransaction) -> Result<H256, Error>;
|
fn send_raw_transaction(&self, RawTransaction) -> Result<H256, Error>;
|
||||||
/// Create a transaction spending the given inputs and creating new outputs.
|
/// Create a transaction spending the given inputs and creating new outputs.
|
||||||
/// @curl-example: curl --data-binary '{"jsonrpc": "2.0", "method": "createrawtransaction", "params": [[{"txid":"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b","vout":0}],{"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa":0.01}], "id":1 }' -H 'content-type: application/json;' http://127.0.0.1:8332/
|
/// @curl-example: curl --data-binary '{"jsonrpc": "2.0", "method": "createrawtransaction", "params": [[{"txid":"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b","vout":0}],{"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa":0.01}], "id":1 }' -H 'content-type: application/json' http://127.0.0.1:8332/
|
||||||
#[rpc(name = "createrawtransaction")]
|
#[rpc(name = "createrawtransaction")]
|
||||||
fn create_raw_transaction(&self, Vec<TransactionInput>, TransactionOutputs, Trailing<u32>) -> Result<RawTransaction, Error>;
|
fn create_raw_transaction(&self, Vec<TransactionInput>, TransactionOutputs, Trailing<u32>) -> Result<RawTransaction, Error>;
|
||||||
/// Return an object representing the serialized, hex-encoded transaction.
|
/// Return an object representing the serialized, hex-encoded transaction.
|
||||||
/// @curl-example: curl --data-binary '{"jsonrpc": "2.0", "method": "decoderawtransaction", "params": ["01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000"], "id":1 }' -H 'content-type: application/json;' http://127.0.0.1:8332/
|
/// @curl-example: curl --data-binary '{"jsonrpc": "2.0", "method": "decoderawtransaction", "params": ["01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000"], "id":1 }' -H 'content-type: application/json' http://127.0.0.1:8332/
|
||||||
#[rpc(name = "decoderawtransaction")]
|
#[rpc(name = "decoderawtransaction")]
|
||||||
fn decode_raw_transaction(&self, RawTransaction) -> Result<Transaction, Error>;
|
fn decode_raw_transaction(&self, RawTransaction) -> Result<Transaction, Error>;
|
||||||
/// Return the raw transaction data.
|
/// Return the raw transaction data.
|
||||||
/// @curl-example: curl --data-binary '{"jsonrpc": "2.0", "method": "getrawtransaction", "params": ["4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"], "id":1 }' -H 'content-type: application/json;' http://127.0.0.1:8332/
|
/// @curl-example: curl --data-binary '{"jsonrpc": "2.0", "method": "getrawtransaction", "params": ["4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"], "id":1 }' -H 'content-type: application/json' http://127.0.0.1:8332/
|
||||||
#[rpc(name = "getrawtransaction")]
|
#[rpc(name = "getrawtransaction")]
|
||||||
fn get_raw_transaction(&self, H256, Trailing<bool>) -> Result<GetRawTransactionResponse, Error>;
|
fn get_raw_transaction(&self, H256, Trailing<bool>) -> Result<GetRawTransactionResponse, Error>;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue