MCPcopy Create free account
hub / github.com/ddimaria/rust-blockchain-tutorial / server

Function server

chain/src/helpers.rs:58–62  ·  view source on GitHub ↗
(blockchain: Option<Arc<Mutex<BlockChain>>>)

Source from the content-addressed store, hash-verified

56 }
57
58 pub(crate) async fn server(blockchain: Option<Arc<Mutex<BlockChain>>>) -> ServerHandle {
59 let blockchain = blockchain
60 .unwrap_or_else(|| Arc::new(Mutex::new(BlockChain::new((*STORAGE).clone()).unwrap())));
61 serve(ADDRESS, blockchain).await.unwrap()
62 }
63
64 pub(crate) fn client() -> HttpClient {
65 let url = format!("http://{}", ADDRESS);

Callers

nothing calls this directly

Calls 1

serveFunction · 0.85

Tested by

no test coverage detected