diff --git a/crates/client/src/client.rs b/crates/client/src/client.rs
index db89b721..177e720d 100644
--- a/crates/client/src/client.rs
+++ b/crates/client/src/client.rs
@@ -9,7 +9,7 @@ use bitcoin::hashes::Hash;
use bitcoin::{Address as BtcAddress, TxMerkleNode, Txid};
use bitcoin::{Block, Network};
use esplora_client::{AsyncClient, Builder, MerkleProof, Utxo};
-use store::localdb::LocalDB;
+use store::{ipfs::IPFS, localdb::LocalDB};
use uuid::Uuid;
pub struct BitVM2Client {
@@ -17,6 +17,7 @@ pub struct BitVM2Client {
pub esplora: AsyncClient,
pub btc_network: Network,
pub chain_service: Chain,
+ pub ipfs: IPFS,
}
impl BitVM2Client {
@@ -27,6 +28,7 @@ impl BitVM2Client {
btc_network: Network,
goat_network: GoatNetwork,
goat_config: GoatInitConfig,
+ ipfs_endpoint: &str,
) -> Self {
let local_db = LocalDB::new(&format!("sqlite:{db_path}"), true).await;
local_db.migrate().await;
@@ -37,6 +39,7 @@ impl BitVM2Client {
.expect("Could not build esplora client"),
btc_network,
chain_service: Chain::new(get_chain_adaptor(goat_network, goat_config, None)),
+ ipfs: IPFS::new(ipfs_endpoint),
}
}
diff --git a/crates/client/src/lib.rs b/crates/client/src/lib.rs
index 3559e997..421fcc47 100644
--- a/crates/client/src/lib.rs
+++ b/crates/client/src/lib.rs
@@ -31,6 +31,7 @@ mod tests {
Network::Testnet,
GoatNetwork::Test,
global_init_config,
+ "http://localhost:5001",
)
.await;
let tx_id =
diff --git a/crates/store/src/ipfs.rs b/crates/store/src/ipfs.rs
index c18a72ed..c64cca55 100644
--- a/crates/store/src/ipfs.rs
+++ b/crates/store/src/ipfs.rs
@@ -16,36 +16,36 @@ pub struct IPFS {
#[derive(Deserialize, Debug, PartialEq, Hash)]
#[serde(rename_all = "PascalCase")]
pub struct Link {
- hash: String,
- mod_time: String,
- mode: u32,
- name: String,
- size: u32,
- target: String,
+ pub hash: String,
+ pub mod_time: String,
+ pub mode: u32,
+ pub name: String,
+ pub size: u32,
+ pub target: String,
#[serde(rename = "Type")]
- type_: u32,
+ pub type_: u32,
}
#[derive(Deserialize, Debug, PartialEq, Hash)]
#[serde(rename_all = "PascalCase")]
pub struct Object {
- hash: String,
- links: Vec,
+ pub hash: String,
+ pub links: Vec,
}
#[derive(Deserialize, Debug, PartialEq, Hash)]
#[serde(rename_all = "PascalCase")]
pub struct Objects {
- objects: Vec