From 4eaf9c645d73ae8444d19e24732e29e7bd1dd851 Mon Sep 17 00:00:00 2001 From: cezary-stroczynski Date: Mon, 21 Oct 2024 12:32:46 +0200 Subject: [PATCH] Add printing processed files in ow_data_provider-cli --- contracts/hardhat.config.ts | 2 +- ow_data_provider_cli/src/constants.rs | 3 ++- ow_data_provider_cli/src/ipfs.rs | 22 ++++++++++++++++++++++ ow_validator_node/src/constants.rs | 2 +- ow_validator_node/src/ddex_sequencer.rs | 2 +- 5 files changed, 27 insertions(+), 4 deletions(-) diff --git a/contracts/hardhat.config.ts b/contracts/hardhat.config.ts index 9734944..2257c07 100644 --- a/contracts/hardhat.config.ts +++ b/contracts/hardhat.config.ts @@ -18,7 +18,7 @@ const config: HardhatUserConfig = { ], }, kurtosis_testnet: { - url: "http://127.0.0.1:32827", + url: "http://127.0.0.1:32780", accounts: [ "0xbcdf20249abf0ed6d944c0288fad489e33f66b3960d9e6229c1cd214ed3bbe31", ], diff --git a/ow_data_provider_cli/src/constants.rs b/ow_data_provider_cli/src/constants.rs index f7f5e1f..3f2c94e 100644 --- a/ow_data_provider_cli/src/constants.rs +++ b/ow_data_provider_cli/src/constants.rs @@ -1,6 +1,6 @@ use alloy::primitives::{address, Address}; -pub const DDEX_SEQUENCER_ADDRESS: Address = address!("B965D10739e19a9158e7f713720B0145D996E370"); +pub const DDEX_SEQUENCER_ADDRESS: Address = address!("00c042C4D5D913277CE16611a2ce6e9003554aD5"); #[cfg(any(not(test), rust_analyzer))] pub const IPFS_API_BASE_URL: &str = "http://localhost:5001"; @@ -11,4 +11,5 @@ pub const IMAGE_FILE_CID_TAG: &str = "ImageIpfsCid"; #[cfg(all(test, not(rust_analyzer)))] pub const IPFS_API_BASE_URL: &str = "http://ipfs:5001"; +#[cfg(all(test, not(rust_analyzer)))] pub const IPFS_API_CAT_FILE: &str = "/api/v0/cat"; diff --git a/ow_data_provider_cli/src/ipfs.rs b/ow_data_provider_cli/src/ipfs.rs index 9ece384..4db9004 100644 --- a/ow_data_provider_cli/src/ipfs.rs +++ b/ow_data_provider_cli/src/ipfs.rs @@ -177,9 +177,31 @@ pub async fn create_output_files( folder_path.to_string(), ))); } + + print_output(&result)?; Ok(result) } +fn print_output(output: &Vec) -> Result<(), Box> { + for entry in output { + println!("PROCESSED DDEX MESSAGE:"); + println!( + "Source files: image: {}; XML: {}", + entry.input_image_path, entry.input_xml_path + ); + println!( + "Image file {} was pined to IPFS under CID: {}", + entry.input_image_path, entry.image_cid + ); + println!( + "CID: {} was included in the output file: {}", + entry.image_cid, entry.output_xml_path + ); + println!("----------") + } + Ok(()) +} + #[cfg(test)] mod tests { use super::*; diff --git a/ow_validator_node/src/constants.rs b/ow_validator_node/src/constants.rs index ccaa34d..03dedc2 100644 --- a/ow_validator_node/src/constants.rs +++ b/ow_validator_node/src/constants.rs @@ -1,6 +1,6 @@ use alloy::primitives::{address, Address, FixedBytes}; -pub const DDEX_SEQUENCER_ADDRESS: Address = address!("B965D10739e19a9158e7f713720B0145D996E370"); +pub const DDEX_SEQUENCER_ADDRESS: Address = address!("00c042C4D5D913277CE16611a2ce6e9003554aD5"); pub const GET_BEACON_BLOCK_API_PATH: &str = "/eth/v2/beacon/blocks/"; pub const GET_SIDECARS_API_PATH: &str = "/eth/v1/beacon/blob_sidecars/"; pub const EMPTY_QUEUE_HEAD: FixedBytes<32> = FixedBytes::repeat_byte(0); diff --git a/ow_validator_node/src/ddex_sequencer.rs b/ow_validator_node/src/ddex_sequencer.rs index ebbe842..3979f9b 100644 --- a/ow_validator_node/src/ddex_sequencer.rs +++ b/ow_validator_node/src/ddex_sequencer.rs @@ -99,7 +99,6 @@ impl DdexSequencerContext<'_> { &self, config: &Config, ) -> Result> { - println!("Subscribed to queue, waiting for new blobs..."); let ws_url = WsConnect::new(&config.ws_url); let ws_provider = ProviderBuilder::new().on_ws(ws_url).await?; @@ -107,6 +106,7 @@ impl DdexSequencerContext<'_> { .address(constants::DDEX_SEQUENCER_ADDRESS) .event(DdexSequencer::NewBlobSubmitted::SIGNATURE); + println!("Subscribed to queue, waiting for new blobs..."); let subscription = ws_provider.subscribe_logs(&filter).await?; let mut stream = subscription.into_stream();