Skip to main content

interstice_cli/
start.rs

1use crate::data_directory::data_file;
2use interstice_core::{IntersticeError, Node, NodeId};
3
4pub async fn start_new(port: u32) -> Result<(), IntersticeError> {
5    let node = Node::new(&data_file(), port)?;
6    node.start().await?;
7    Ok(())
8}
9
10pub async fn start(id: NodeId, port: u32) -> Result<(), IntersticeError> {
11    let node = Node::load(&data_file(), id, port).await?;
12    node.start().await?;
13    Ok(())
14}