use anya_core::{api::server::ApiServer, bitcoin::BitcoinNode};
use anyhow::Result;
use log::info;
fn create_bitcoin_node() -> Result<BitcoinNode> {
let config = anya_core::bitcoin::config::BitcoinConfig {
network: "testnet".to_string(),
rpc_url: Some("http://localhost:18332".to_string()),
auth: Some(("rpcuser".to_string(), "rpcpassword".to_string())),
..Default::default()
};
BitcoinNode::new(config).map_err(|e| anyhow::anyhow!("Bitcoin node error: {}", e))
}
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let bitcoin_node = create_bitcoin_node()?;
let _api_server = ApiServer::new();
bitcoin_node
.start()
.await
.map_err(|e| anyhow::anyhow!("Failed to start Bitcoin node: {}", e))?;
info!("Bitcoin node initialized successfully");
info!("API server created - ready for configuration");
info!("Example completed successfully");
Ok(())
}