api default & curl-example
This commit is contained in:
parent
c19740d3eb
commit
aa3dd9e700
|
@ -20,7 +20,7 @@ pub enum ApiSet {
|
|||
|
||||
impl Default for ApiSet {
|
||||
fn default() -> Self {
|
||||
ApiSet::List(vec![Api::Raw].into_iter().collect())
|
||||
ApiSet::List(vec![Api::Raw, Api::Network].into_iter().collect())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,9 @@ build_rpc_trait! {
|
|||
/// Parity-bitcoin network interface
|
||||
pub trait Network {
|
||||
/// Add/remove/connecto 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", "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/
|
||||
#[rpc(name = "addnode")]
|
||||
fn add_node(&self, String, AddNodeOperation) -> Result<(), Error>;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue