node

Function node 

Source
pub async fn node(ctx: Context) -> Result<Node>
Expand description

Create a default node (with no persistence) Persistent implementations are available by using a builder. For example, you can use a FileStorage backend to support the node vault.

use std::path::Path;
use std::sync::Arc;
use ockam::{Node, Result};
use ockam_node::Context;
use ockam_vault::storage::SecretsSqlxDatabase;

async fn make_node(ctx: Context) -> Result<Node> {
  let node = Node::builder()
      .await?
      .with_secrets_repository(Arc::new(SecretsSqlxDatabase::create().await?))
      .build(&ctx)?;
  Ok(node)
}