[−][src]Struct grin_servers::Server
Grin server holding internal structures.
Fields
config: ServerConfig
server config
p2p: Arc<Server>
handle to our network server
chain: Arc<Chain>
data store access
stop_state: Arc<Mutex<StopState>>
Stop flag
Methods
impl Server
[src]
pub fn start<F>(config: ServerConfig, info_callback: F) -> Result<(), Error> where
F: FnMut(Arc<Server>),
[src]
F: FnMut(Arc<Server>),
Instantiates and starts a new server. Optionally takes a callback for the server to send an ARC copy of itself, to allow another process to poll info about the server status
pub fn new(config: ServerConfig) -> Result<Server, Error>
[src]
Instantiates a new server associated with the provided future reactor.
pub fn connect_peer(&self, addr: PeerAddr) -> Result<(), Error>
[src]
Asks the server to connect to a peer at the provided network address.
pub fn ping_peers(&self) -> Result<(), Error>
[src]
Ping all peers, mostly useful for tests to have connected peers share their heights
pub fn peer_count(&self) -> u32
[src]
Number of peers
pub fn start_stratum_server(&self, config: StratumServerConfig)
[src]
Start a minimal "stratum" mining service on a separate thread
pub fn start_test_miner(
&self,
wallet_listener_url: Option<String>,
stop_state: Arc<Mutex<StopState>>
)
[src]
&self,
wallet_listener_url: Option<String>,
stop_state: Arc<Mutex<StopState>>
)
Start mining for blocks internally on a separate thread. Relies on internal miner, and should only be used for automated testing. Burns reward if wallet_listener_url is 'None'
pub fn head(&self) -> Result<Tip, Error>
[src]
The chain head
pub fn header_head(&self) -> Result<Tip, Error>
[src]
The head of the block header chain
pub fn get_server_stats(&self) -> Result<ServerStats, Error>
[src]
Returns a set of stats about this server. This and the ServerStats structure can be updated over time to include any information needed by tests or other consumers
pub fn stop(&self)
[src]
Stop the server.
pub fn pause(&self)
[src]
Pause the p2p server.
pub fn resume(&self)
[src]
Resume p2p server. TODO - We appear not to resume the p2p server (peer connections) here?
pub fn stop_test_miner(&self, stop: Arc<Mutex<StopState>>)
[src]
Stops the test miner without stopping the p2p layer
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Erased for T
impl<T> UnsafeAny for T where
T: Any,
T: Any,
impl<T> SafeBorrow for T where
T: ?Sized,
T: ?Sized,
fn borrow_replacement(ptr: &T) -> &T
impl<T> Same for T
type Output = T
Should always be Self