diff --git a/.gitignore b/.gitignore index ada663fe..444005ec 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,8 @@ local.properties *.log *.dylib *.so +*.db +*/data/signet .DS_Store testdb xcuserdata diff --git a/bdk-android/lib/build.gradle.kts b/bdk-android/lib/build.gradle.kts index 4e240092..a7f540d9 100644 --- a/bdk-android/lib/build.gradle.kts +++ b/bdk-android/lib/build.gradle.kts @@ -52,11 +52,13 @@ java { dependencies { implementation("net.java.dev.jna:jna:5.14.0@aar") implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1") implementation("androidx.appcompat:appcompat:1.4.0") implementation("androidx.core:core-ktx:1.7.0") api("org.slf4j:slf4j-api:1.7.30") androidTestImplementation("com.github.tony19:logback-android:2.0.0") + testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1") androidTestImplementation("androidx.test.ext:junit:1.1.3") androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0") androidTestImplementation("org.jetbrains.kotlin:kotlin-test:1.6.10") diff --git a/bdk-android/lib/src/androidTest/kotlin/org/bitcoindevkit/KyotoTest.kt b/bdk-android/lib/src/androidTest/kotlin/org/bitcoindevkit/KyotoTest.kt new file mode 100644 index 00000000..27379d00 --- /dev/null +++ b/bdk-android/lib/src/androidTest/kotlin/org/bitcoindevkit/KyotoTest.kt @@ -0,0 +1,24 @@ +package org.bitcoindevkit + +import org.junit.Test +import androidx.test.ext.junit.runners.AndroidJUnit4 +import kotlinx.coroutines.runBlocking +import org.junit.runner.RunWith + +@RunWith(AndroidJUnit4::class) +class KyotoTest { + private val descriptor: Descriptor = Descriptor("wpkh(tprv8ZgxMBicQKsPf2qfrEygW6fdYseJDDrVnDv26PH5BHdvSuG6ecCbHqLVof9yZcMoM31z9ur3tTYbSnr1WBqbGX97CbXcmp5H6qeMpyvx35B/84h/1h/0h/0/*)", Network.SIGNET) + private val changeDescriptor: Descriptor = Descriptor("wpkh(tprv8ZgxMBicQKsPf2qfrEygW6fdYseJDDrVnDv26PH5BHdvSuG6ecCbHqLVof9yZcMoM31z9ur3tTYbSnr1WBqbGX97CbXcmp5H6qeMpyvx35B/84h/1h/0h/1/*)", Network.SIGNET) + + @Test + fun testKyoto() { + // val wallet: Wallet = Wallet(descriptor, changeDescriptor, Network.SIGNET) + runBlocking { + println("Running test Kyoto") + val (node, client) = buildKyotoClient() + runNode(node) + client.update() + println("Done running test Kyoto") + } + } +} diff --git a/bdk-ffi/Cargo.lock b/bdk-ffi/Cargo.lock index 032ccbe1..5e71ad61 100644 --- a/bdk-ffi/Cargo.lock +++ b/bdk-ffi/Cargo.lock @@ -2,6 +2,21 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "addr2line" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + [[package]] name = "ahash" version = "0.4.8" @@ -134,6 +149,21 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +[[package]] +name = "backtrace" +version = "0.3.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + [[package]] name = "base58ck" version = "0.1.0" @@ -180,9 +210,11 @@ dependencies = [ "bdk_core", "bdk_electrum", "bdk_esplora", + "bdk_kyoto", "bdk_wallet", "bitcoin-ffi", "thiserror", + "tokio", "uniffi", ] @@ -243,6 +275,17 @@ dependencies = [ "miniscript", ] +[[package]] +name = "bdk_kyoto" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d62efc9759199cd703e5c5b7eba22da84df4830a3e275e11c600f538cf8fc3c6" +dependencies = [ + "bdk_chain", + "bdk_wallet", + "kyoto-cbf", +] + [[package]] name = "bdk_wallet" version = "1.0.0-beta.5" @@ -273,6 +316,16 @@ dependencies = [ "serde", ] +[[package]] +name = "bip324" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2205cbdbe6a8ed43ea3b37ba6670a45d6617aceefcc85388672115bdf1efc91" +dependencies = [ + "bitcoin", + "rand", +] + [[package]] name = "bip39" version = "2.0.0" @@ -549,6 +602,12 @@ dependencies = [ "wasi", ] +[[package]] +name = "gimli" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" + [[package]] name = "glob" version = "0.3.1" @@ -600,6 +659,12 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + [[package]] name = "hex-conservative" version = "0.2.1" @@ -639,6 +704,19 @@ dependencies = [ "serde_json", ] +[[package]] +name = "kyoto-cbf" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84a2967a219e0c6e43e06e0f048592bba49b80612f22ce57a024df4ab1ab96de" +dependencies = [ + "bip324", + "bitcoin", + "bitcoin_hashes 0.14.0", + "rusqlite", + "tokio", +] + [[package]] name = "libc" version = "0.2.155" @@ -701,6 +779,15 @@ dependencies = [ "serde", ] +[[package]] +name = "miniz_oxide" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +dependencies = [ + "adler", +] + [[package]] name = "minreq" version = "2.11.2" @@ -717,6 +804,18 @@ dependencies = [ "webpki-roots", ] +[[package]] +name = "mio" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +dependencies = [ + "hermit-abi", + "libc", + "wasi", + "windows-sys", +] + [[package]] name = "nom" version = "7.1.3" @@ -727,6 +826,15 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "object" +version = "0.36.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" +dependencies = [ + "memchr", +] + [[package]] name = "once_cell" version = "1.19.0" @@ -739,6 +847,12 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "pin-project-lite" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" + [[package]] name = "pkg-config" version = "0.3.30" @@ -834,6 +948,12 @@ dependencies = [ "smallvec", ] +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + [[package]] name = "rustls" version = "0.21.12" @@ -1003,6 +1123,16 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" +[[package]] +name = "socket2" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +dependencies = [ + "libc", + "windows-sys", +] + [[package]] name = "spin" version = "0.9.8" @@ -1082,6 +1212,33 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" +[[package]] +name = "tokio" +version = "1.40.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "pin-project-lite", + "socket2", + "tokio-macros", + "windows-sys", +] + +[[package]] +name = "tokio-macros" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "toml" version = "0.5.11" diff --git a/bdk-ffi/Cargo.toml b/bdk-ffi/Cargo.toml index 09ea6661..aded8987 100644 --- a/bdk-ffi/Cargo.toml +++ b/bdk-ffi/Cargo.toml @@ -22,10 +22,12 @@ bdk_wallet = { version = "=1.0.0-beta.5", features = ["all-keys", "keys-bip39", bdk_core = { version = "0.3.0" } bdk_esplora = { version = "0.19.0", default-features = false, features = ["std", "blocking", "blocking-https-rustls"] } bdk_electrum = { version = "0.19.0", default-features = false, features = ["use-rustls-ring"] } +bdk_kyoto = { version = "0.1.0", default-features = false, features = ["wallet", "rusqlite"] } bdk_bitcoind_rpc = { version = "0.16.0" } bitcoin-ffi = { git = "https://github.com/bitcoindevkit/bitcoin-ffi", tag = "v0.1.2" } uniffi = { version = "=0.28.0" } +tokio = { version = "1", default-features = false, features = [ "rt-multi-thread", "sync" ] } thiserror = "1.0.58" [build-dependencies] diff --git a/bdk-ffi/src/bdk.udl b/bdk-ffi/src/bdk.udl index 8e79f301..c55867ad 100644 --- a/bdk-ffi/src/bdk.udl +++ b/bdk-ffi/src/bdk.udl @@ -1,4 +1,9 @@ -namespace bdk {}; +namespace bdk { + [Throws=LightClientBuilderError] + NodePair build_light_client([ByRef] Wallet wallet, sequence peers, u8 connections, u32? recovery_height, string data_dir); + + void run_node(LightNode node); +}; // ------------------------------------------------------------------------ // bdk crate - error module @@ -264,6 +269,17 @@ interface TxidParseError { InvalidTxid(string txid); }; +[Error] +interface LightClientBuilderError { + DatabaseError(string reason); + ParseIpAddrError(); +}; + +[Error] +enum LightClientError { + "NodeStopped", +}; + // ------------------------------------------------------------------------ // bdk_wallet crate - types module // ------------------------------------------------------------------------ @@ -624,6 +640,86 @@ dictionary SentAndReceivedValues { Amount received; }; +// ------------------------------------------------------------------------ +// bdk-kyoto crate +// ------------------------------------------------------------------------ + +interface LightClient { + [Async] + Update? update(NodeMessageHandler? logger); + + [Async, Throws=LightClientError] + void broadcast(Transaction transaction); + + [Async, Throws=LightClientError] + void watch_address(Address address); + + [Async, Throws=LightClientError] + void shutdown(); + +}; + +interface LightNode { + [Async] + void run(); +}; + +dictionary NodePair { + LightNode node; + LightClient client; +}; + +[Enum] +interface Peer { + V4(u8 q1, u8 q2, u8 q3, u8 q4); + V6(string addr); + SocketAddr(string socket_addr); +}; + +[Trait, WithForeign] +interface NodeMessageHandler { + void dialog(string dialog); + + void warning(Warning warning); + + void state_changed(NodeState state); + + void connections_met(); + + void tx_sent(Txid txid); + + void tx_failed(Txid txid); + + void blocks_disconnected(sequence blocks); + + void synced(u32 tip); +}; + +[Enum] +interface Warning { + NotEnoughConnections(); + PeerTimedOut(); + CouldNotConnect(); + NoCompactFilters(); + PotentialStaleTip(); + UnsolicitedMessage(); + UnlinkableAnchor(); + CorruptedHeaders(); + TransactionRejected(); + FailedPersistance(string warning); + EvaluatingFork(); + EmptyPeerDatabase(); + UnexpectedSyncError(string warning); +}; + +enum NodeState { + "Behind", + "HeadersSynced", + "FilterHeadersSynced", + "FiltersSynced", + "TransactionsSynced" +}; + // ------------------------------------------------------------------------ // bdk_wallet crate - bitcoin re-exports // ------------------------------------------------------------------------ diff --git a/bdk-ffi/src/bitcoin.rs b/bdk-ffi/src/bitcoin.rs index 29439fe3..3780f191 100644 --- a/bdk-ffi/src/bitcoin.rs +++ b/bdk-ffi/src/bitcoin.rs @@ -77,7 +77,7 @@ impl From for Address { } #[derive(Debug, Clone, PartialEq, Eq)] -pub struct Transaction(BdkTransaction); +pub struct Transaction(pub(crate) BdkTransaction); impl Transaction { pub fn new(transaction_bytes: Vec) -> Result { diff --git a/bdk-ffi/src/error.rs b/bdk-ffi/src/error.rs index aa0265f4..499955a6 100644 --- a/bdk-ffi/src/error.rs +++ b/bdk-ffi/src/error.rs @@ -620,6 +620,20 @@ pub enum TxidParseError { InvalidTxid { txid: String }, } +#[derive(Debug, thiserror::Error)] +pub enum LightClientBuilderError { + #[error("the database could not be opened or created: {reason}")] + DatabaseError { reason: String }, + #[error("the ip address provided could not be parsed correctly")] + ParseIpAddrError, +} + +#[derive(Debug, thiserror::Error)] +pub enum LightClientError { + #[error("the node is no longer running")] + NodeStopped, +} + // ------------------------------------------------------------------------ // error conversions // ------------------------------------------------------------------------ @@ -1215,6 +1229,20 @@ impl From for SqliteError { } } +impl From for LightClientBuilderError { + fn from(value: bdk_kyoto::builder::BuilderError) -> Self { + LightClientBuilderError::DatabaseError { + reason: value.to_string(), + } + } +} + +impl From for LightClientError { + fn from(_value: bdk_kyoto::ClientError) -> Self { + LightClientError::NodeStopped + } +} + // ------------------------------------------------------------------------ // error tests // ------------------------------------------------------------------------ diff --git a/bdk-ffi/src/kyoto.rs b/bdk-ffi/src/kyoto.rs new file mode 100644 index 00000000..17916a28 --- /dev/null +++ b/bdk-ffi/src/kyoto.rs @@ -0,0 +1,151 @@ +use bdk_kyoto::builder::LightClientBuilder; +use bdk_kyoto::logger::{NodeMessageHandler, PrintLogger}; +use bdk_kyoto::NodeDefault; +use bdk_kyoto::{Client, TrustedPeer}; +use bdk_wallet::bitcoin::Transaction as BdkTransaction; +use bdk_wallet::KeychainKind; +use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr}; +use std::path::PathBuf; +use std::str::FromStr; +use std::sync::Arc; +use std::time::Duration; +use tokio::sync::Mutex; + +use crate::bitcoin::{Address, Transaction}; +use crate::error::{LightClientBuilderError, LightClientError}; +use crate::wallet::Wallet; +use crate::Update; + +const TIMEOUT: u64 = 10; + +pub struct LightClient { + client: Mutex>, +} + +pub struct LightNode { + node: Mutex, +} + +pub struct NodePair { + pub node: Arc, + pub client: Arc, +} + +pub fn build_light_client( + wallet: &Wallet, + peers: Vec, + connections: u8, + recovery_height: Option, + data_dir: String, +) -> Result { + let mut trusted_peers = Vec::new(); + for peer in peers { + match peer { + Peer::V4 { q1, q2, q3, q4 } => { + let ip = IpAddr::V4(Ipv4Addr::new(q1, q2, q3, q4)); + trusted_peers.push(TrustedPeer::from_ip(ip)); + } + Peer::V6 { addr } => { + let ip = IpAddr::V6( + Ipv6Addr::from_str(&addr) + .map_err(|_| LightClientBuilderError::ParseIpAddrError)?, + ); + trusted_peers.push(TrustedPeer::from_ip(ip)); + } + Peer::SocketAddr { socket_addr } => { + let socket_addr = SocketAddr::from_str(&socket_addr) + .map_err(|_| LightClientBuilderError::ParseIpAddrError)?; + trusted_peers.push(TrustedPeer::from_socket_addr(socket_addr)); + } + } + } + + let wallet = wallet.get_wallet(); + + let mut builder = LightClientBuilder::new(&wallet) + .connections(connections) + .data_dir(PathBuf::from_str(&data_dir).map_err(|e| { + LightClientBuilderError::DatabaseError { + reason: e.to_string(), + } + })?) + .timeout_duration(Duration::from_secs(TIMEOUT)) + .peers(trusted_peers); + + if let Some(recovery) = recovery_height { + builder = builder.scan_after(recovery) + } + + let (node, bdk_kyoto_client) = builder.build()?; + + let node = LightNode { + node: Mutex::new(node), + }; + + let client = LightClient { + client: Mutex::new(bdk_kyoto_client), + }; + + Ok(NodePair { + node: Arc::new(node), + client: Arc::new(client), + }) +} + +pub fn run_node(node: Arc) { + std::thread::spawn(|| { + tokio::runtime::Builder::new_multi_thread() + .enable_all() + .build() + .unwrap() + .block_on(async move { + node.as_ref().run().await; + }) + }); +} + +impl LightClient { + pub async fn update(&self, logger: Option>) -> Option> { + let logger = logger.unwrap_or(Arc::new(PrintLogger::new())); + let update = self.client.lock().await.update(logger.as_ref()).await; + update.map(|update| Arc::new(Update(update.into()))) + } + + pub async fn broadcast(&self, transaction: Arc) -> Result<(), LightClientError> { + let client = self.client.lock().await; + let tx: BdkTransaction = match Arc::try_unwrap(transaction) { + Ok(val) => val.0, + Err(arc) => arc.0.clone(), + }; + client + .broadcast(tx, bdk_kyoto::TxBroadcastPolicy::RandomPeer) + .await + .map_err(From::from) + } + + pub async fn watch_address(&self, address: Arc
) -> Result<(), LightClientError> { + let client = self.client.lock().await; + let script = match Arc::try_unwrap(address.script_pubkey()) { + Ok(script) => script.into(), + Err(arc) => arc.0.clone(), + }; + client.add_script(script).await.map_err(From::from) + } + + pub async fn shutdown(&self) -> Result<(), LightClientError> { + let client = self.client.lock().await; + client.shutdown().await.map_err(From::from) + } +} + +impl LightNode { + pub async fn run(&self) { + let _ = self.node.lock().await.run().await; + } +} + +pub enum Peer { + V4 { q1: u8, q2: u8, q3: u8, q4: u8 }, + V6 { addr: String }, + SocketAddr { socket_addr: String }, +} diff --git a/bdk-ffi/src/lib.rs b/bdk-ffi/src/lib.rs index 110b21cc..560dcbc1 100644 --- a/bdk-ffi/src/lib.rs +++ b/bdk-ffi/src/lib.rs @@ -4,6 +4,7 @@ mod electrum; mod error; mod esplora; mod keys; +mod kyoto; mod store; mod tx_builder; mod types; @@ -29,6 +30,8 @@ use crate::error::ElectrumError; use crate::error::EsploraError; use crate::error::ExtractTxError; use crate::error::FromScriptError; +use crate::error::LightClientBuilderError; +use crate::error::LightClientError; use crate::error::LoadWithPersistError; use crate::error::PersistenceError; use crate::error::PsbtError; @@ -69,10 +72,21 @@ use bitcoin_ffi::FeeRate; use bitcoin_ffi::Network; use bitcoin_ffi::OutPoint; use bitcoin_ffi::Script; +use bitcoin_ffi::Txid; use bdk_wallet::keys::bip39::WordCount; use bdk_wallet::tx_builder::ChangeSpendPolicy; use bdk_wallet::ChangeSet; use bdk_wallet::KeychainKind; +use bdk_kyoto::logger::NodeMessageHandler; +use bdk_kyoto::NodeState; +use bdk_kyoto::Warning; +use kyoto::build_light_client; +use kyoto::run_node; +use kyoto::LightClient; +use kyoto::LightNode; +use kyoto::NodePair; +use kyoto::Peer; + uniffi::include_scaffolding!("bdk"); diff --git a/bdk-jvm/lib/build.gradle.kts b/bdk-jvm/lib/build.gradle.kts index d314c8d0..15b1d3ce 100644 --- a/bdk-jvm/lib/build.gradle.kts +++ b/bdk-jvm/lib/build.gradle.kts @@ -61,12 +61,14 @@ tasks.withType { dependencies { implementation(platform("org.jetbrains.kotlin:kotlin-bom")) implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1") implementation("net.java.dev.jna:jna:5.14.0") api("org.slf4j:slf4j-api:1.7.30") // testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.1") // testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.10.1") // testRuntimeOnly("org.junit.vintage:junit-vintage-engine:5.8.2") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1") testImplementation("ch.qos.logback:logback-classic:1.2.3") testImplementation("ch.qos.logback:logback-core:1.2.3") } diff --git a/bdk-jvm/lib/src/test/kotlin/org/bitcoindevkit/KyotoTest.kt b/bdk-jvm/lib/src/test/kotlin/org/bitcoindevkit/KyotoTest.kt new file mode 100644 index 00000000..782ddc59 --- /dev/null +++ b/bdk-jvm/lib/src/test/kotlin/org/bitcoindevkit/KyotoTest.kt @@ -0,0 +1,19 @@ +package org.bitcoindevkit + +import kotlinx.coroutines.runBlocking +import kotlin.test.Test + +class KyotoTest { + private val descriptor: Descriptor = Descriptor("wpkh(tprv8ZgxMBicQKsPf2qfrEygW6fdYseJDDrVnDv26PH5BHdvSuG6ecCbHqLVof9yZcMoM31z9ur3tTYbSnr1WBqbGX97CbXcmp5H6qeMpyvx35B/84h/1h/0h/0/*)", Network.SIGNET) + private val changeDescriptor: Descriptor = Descriptor("wpkh(tprv8ZgxMBicQKsPf2qfrEygW6fdYseJDDrVnDv26PH5BHdvSuG6ecCbHqLVof9yZcMoM31z9ur3tTYbSnr1WBqbGX97CbXcmp5H6qeMpyvx35B/84h/1h/0h/1/*)", Network.SIGNET) + + @Test + fun testKyoto() { + // val wallet: Wallet = Wallet(descriptor, changeDescriptor, Network.SIGNET) + runBlocking { + val (node, client) = buildKyotoClient() + runNode(node) + client.update() + } + } +} diff --git a/bdk-python/scripts/generate-linux.sh b/bdk-python/scripts/generate-linux.sh index c8d5e713..93040137 100644 --- a/bdk-python/scripts/generate-linux.sh +++ b/bdk-python/scripts/generate-linux.sh @@ -5,6 +5,7 @@ ${PYBIN}/python --version ${PYBIN}/pip install -r requirements.txt cd ../bdk-ffi/ + rustup default 1.77.1 echo "Generating native binaries..." @@ -17,3 +18,13 @@ echo "Copying linux libbdkffi.so..." cp ./target/release-smaller/libbdkffi.so ../bdk-python/src/bdkpython/libbdkffi.so echo "All done!" + +# cd ../bdk-python + +# echo "Building wheel" + +# python3 setup.py --verbose bdist_wheel + +# echo "Installing BDK Python" + +# pip3 install ./dist/bdkpython-1.0.0b2.dev0-cp310-cp310-linux_x86_64.whl --force-reinstall \ No newline at end of file