| Crates.io | holochain_env_setup |
| lib.rs | holochain_env_setup |
| version | 0.1.0 |
| created_at | 2025-03-11 20:59:56.595039+00 |
| updated_at | 2025-03-11 20:59:56.595039+00 |
| description | Test utilities for setting up Holochain environments with conductor and lair-keystore |
| homepage | |
| repository | https://github.com/holochain/ham |
| max_upload_size | |
| id | 1588508 |
| size | 167,158 |
Test utilities for setting up Holochain environments with conductor and lair-keystore.
This crate provides utilities for setting up a complete Holochain environment for testing purposes. It handles:
use holochain_env_setup::environment::setup_environment;
use tempfile::tempdir;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create temporary directories
let tmp_dir = tempdir()?.into_path();
let log_dir = tmp_dir.join("log");
std::fs::create_dir_all(&log_dir)?;
// Setup the environment
let env = setup_environment(&tmp_dir, &log_dir, None, None).await?;
// The environment is now ready with:
// - A running Holochain conductor on port 4444
// - A running Lair keystore
// - All necessary configuration
// Use the environment...
let _agent_key = env.keystore.new_sign_keypair_random().await?;
Ok(())
}
This crate requires:
This project is licensed under the GNU General Public License v3.0 (GPL-3.0). This means:
For more details, see the LICENSE file or visit https://www.gnu.org/licenses/gpl-3.0.html