<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Quick Start Guide - Anya Documentation</title>
<link rel="stylesheet" href="../styles.css">
</head>
<body>
<header>
<h1>Quick Start Guide</h1>
<nav>
<a href="../index.html">Home</a>
<a href="#installation">Installation</a>
<a href="#configuration">Configuration</a>
<a href="#basic-usage">Basic Usage</a>
</nav>
</header>
<main>
<section id="installation">
<h2>Installation</h2>
<p>Add Anya to your Rust project by including it in your <code>Cargo.toml</code>:</p>
<pre><code>[dependencies]
anya = "0.2.0"
tokio = { version = "1.34", features = ["full"] }
anyhow = "1.0"</code></pre>
<h3>Prerequisites</h3>
<ul>
<li>Rust 1.70 or later</li>
<li>Bitcoin Core (optional, for full node functionality)</li>
<li>Windows 10/11 or compatible OS</li>
</ul>
</section>
<section id="configuration">
<h2>Configuration</h2>
<p>Create a configuration file <code>anya.toml</code> in your project root:</p>
<pre><code>[bitcoin]
network = "testnet" # or "mainnet"
rpc_url = "http://127.0.0.1:8332"
rpc_user = "your_rpc_user"
rpc_password = "your_rpc_password"
[security]
encryption_type = "aes256gcm"
key_derivation = "pbkdf2"
[storage]
path = "./data"
backup_enabled = true</code></pre>
</section>
<section id="basic-usage">
<h2>Basic Usage</h2>
<p>Here's a simple example of using Anya in your Rust application:</p>
<pre><code>use anya::Anya;
use anyhow::Result;
#[tokio::main]
async fn main() -> Result<()> {
// Initialize Anya
let anya = Anya::new().await?;
// Initialize the system
anya.init().await?;
// Create a new Bitcoin wallet
let wallet = anya.create_wallet("my_wallet").await?;
// Get wallet balance
let balance = wallet.get_balance().await?;
println!("Wallet balance: {} BTC", balance);
// Create a new transaction
let tx = wallet
.create_transaction("tb1qw508d6qejxtdg4y5r3zarvary0c5xw7kxpjzsx", 0.001)
.await?;
// Sign and broadcast the transaction
let tx_id = wallet.send_transaction(tx).await?;
println!("Transaction sent! ID: {}", tx_id);
Ok(())
}</code></pre>
<h3>Error Handling</h3>
<p>Anya uses the <code>anyhow</code> crate for error handling. All errors are properly wrapped and contain context:</p>
<pre><code>use anya::Anya;
use anyhow::Result;
async fn handle_errors() -> Result<()> {
let anya = Anya::new().await?;
match anya.init().await {
Ok(_) => println!("Initialization successful"),
Err(e) => eprintln!("Error during initialization: {:#}", e),
}
Ok(())
}</code></pre>
</section>
<section id="next-steps">
<h2>Next Steps</h2>
<ul>
<li><a href="../architecture/core.html">Learn about Anya's architecture</a></li>
<li><a href="../api/wallet.html">Explore wallet management features</a></li>
<li><a href="../security/best-practices.html">Review security best practices</a></li>
</ul>
</section>
</main>
<footer>
<p>© 2025 Anya Core Contributors. All rights reserved.</p>
<p>
<a href="https://github.com/anya-org/anya-core">GitHub</a> |
<a href="../changelog.html">Changelog</a> |
<a href="../contributing.html">Contributing</a>
</p>
</footer>
</body>
</html>