(blockchain: Option<Arc<Mutex<BlockChain>>>)
| 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); |