[−][src]Trait grin_api::OwnerRpc
Public definition used to generate Node jsonrpc api.
- When running
grin
with defaults, the V2 api is available atlocalhost:3413/v2/owner
- The endpoint only supports POST operations, with the json-rpc request as the body
Required methods
pub fn get_status(&self) -> Result<Status, ErrorKind>
[src]
Networked version of Owner::get_status.
Json rpc example
{ "jsonrpc": "2.0", "method": "get_status", "params": [], "id": 1 } { "id": 1, "jsonrpc": "2.0", "result": { "Ok": { "protocol_version": "2", "user_agent": "MW/Grin 2.x.x", "connections": "8", "tip": { "height": 371553, "last_block_pushed": "00001d1623db988d7ed10c5b6319360a52f20c89b4710474145806ba0e8455ec", "prev_block_to_last": "0000029f51bacee81c49a27b4bc9c6c446e03183867c922890f90bb17108d89f", "total_difficulty": 1127628411943045 }, "sync_status": "header_sync", "sync_info": { "current_height": 371553, "highest_height": 0 } } } }
pub fn validate_chain(&self) -> Result<(), ErrorKind>
[src]
Networked version of Owner::validate_chain.
Json rpc example
{ "jsonrpc": "2.0", "method": "validate_chain", "params": [], "id": 1 } { "id": 1, "jsonrpc": "2.0", "result": { "Ok": null } }
pub fn compact_chain(&self) -> Result<(), ErrorKind>
[src]
Networked version of Owner::compact_chain.
Json rpc example
{ "jsonrpc": "2.0", "method": "compact_chain", "params": [], "id": 1 } { "id": 1, "jsonrpc": "2.0", "result": { "Ok": null } }
pub fn get_peers(
&self,
peer_addr: Option<SocketAddr>
) -> Result<Vec<PeerData>, ErrorKind>
[src]
&self,
peer_addr: Option<SocketAddr>
) -> Result<Vec<PeerData>, ErrorKind>
Networked version of Owner::get_peers.
Json rpc example
{ "jsonrpc": "2.0", "method": "get_peers", "params": ["70.50.33.130:3414"], "id": 1 } { "id": 1, "jsonrpc": "2.0", "result": { "Ok": [ { "addr": "70.50.33.130:3414", "ban_reason": "None", "capabilities": { "bits": 15 }, "flags": "Defunct", "last_banned": 0, "last_connected": 1570129317, "user_agent": "MW/Grin 2.0.0" } ] } }
pub fn get_connected_peers(&self) -> Result<Vec<PeerInfoDisplay>, ErrorKind>
[src]
Networked version of Owner::get_connected_peers.
Json rpc example
{ "jsonrpc": "2.0", "method": "get_connected_peers", "params": [], "id": 1 } { "id": 1, "jsonrpc": "2.0", "result": { "Ok": [ { "addr": "35.176.195.242:3414", "capabilities": { "bits": 15 }, "direction": "Outbound", "height": 374510, "total_difficulty": 1133954621205750, "user_agent": "MW/Grin 2.0.0", "version": 1 }, { "addr": "47.97.198.21:3414", "capabilities": { "bits": 15 }, "direction": "Outbound", "height": 374510, "total_difficulty": 1133954621205750, "user_agent": "MW/Grin 2.0.0", "version": 1 }, { "addr": "148.251.16.13:3414", "capabilities": { "bits": 15 }, "direction": "Outbound", "height": 374510, "total_difficulty": 1133954621205750, "user_agent": "MW/Grin 2.0.0", "version": 1 }, { "addr": "68.195.18.155:3414", "capabilities": { "bits": 15 }, "direction": "Outbound", "height": 374510, "total_difficulty": 1133954621205750, "user_agent": "MW/Grin 2.0.0", "version": 1 }, { "addr": "52.53.221.15:3414", "capabilities": { "bits": 15 }, "direction": "Outbound", "height": 0, "total_difficulty": 1133954621205750, "user_agent": "MW/Grin 2.0.0", "version": 1 }, { "addr": "109.74.202.16:3414", "capabilities": { "bits": 15 }, "direction": "Outbound", "height": 374510, "total_difficulty": 1133954621205750, "user_agent": "MW/Grin 2.0.0", "version": 1 }, { "addr": "121.43.183.180:3414", "capabilities": { "bits": 15 }, "direction": "Outbound", "height": 374510, "total_difficulty": 1133954621205750, "user_agent": "MW/Grin 2.0.0", "version": 1 }, { "addr": "35.157.247.209:23414", "capabilities": { "bits": 15 }, "direction": "Outbound", "height": 374510, "total_difficulty": 1133954621205750, "user_agent": "MW/Grin 2.0.0", "version": 1 } ] } }
pub fn ban_peer(&self, peer_addr: SocketAddr) -> Result<(), ErrorKind>
[src]
Networked version of Owner::ban_peer.
Json rpc example
{ "jsonrpc": "2.0", "method": "ban_peer", "params": ["70.50.33.130:3414"], "id": 1 } { "id": 1, "jsonrpc": "2.0", "result": { "Ok": null } }
pub fn unban_peer(&self, peer_addr: SocketAddr) -> Result<(), ErrorKind>
[src]
Networked version of Owner::unban_peer.
Json rpc example
{ "jsonrpc": "2.0", "method": "unban_peer", "params": ["70.50.33.130:3414"], "id": 1 } { "id": 1, "jsonrpc": "2.0", "result": { "Ok": null } }
Trait Implementations
impl Handler for dyn OwnerRpc
[src]
pub fn handle(&self, method: &str, params: Params) -> Result<Value, Error>
[src]
pub fn handle_request(&self, raw_request: Value) -> MaybeReply
[src]
Implementors
impl OwnerRpc for Owner
[src]
pub fn get_status(&self) -> Result<Status, ErrorKind>
[src]
pub fn validate_chain(&self) -> Result<(), ErrorKind>
[src]
pub fn compact_chain(&self) -> Result<(), ErrorKind>
[src]
pub fn get_peers(
&self,
addr: Option<SocketAddr>
) -> Result<Vec<PeerData>, ErrorKind>
[src]
&self,
addr: Option<SocketAddr>
) -> Result<Vec<PeerData>, ErrorKind>