From 78b05fc106cd96a8779b059080c195363801db1c Mon Sep 17 00:00:00 2001 From: GregTheDev Date: Tue, 17 Jun 2025 13:30:20 -0500 Subject: [PATCH 1/3] feat: add da url logging --- bin/pcl/build.rs | 7 +++++++ bin/pcl/src/main.rs | 3 +++ crates/core/src/assertion_da.rs | 13 ++++++++++++- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/bin/pcl/build.rs b/bin/pcl/build.rs index b215b7b..dc2555a 100644 --- a/bin/pcl/build.rs +++ b/bin/pcl/build.rs @@ -9,6 +9,13 @@ use vergen_gix::{ }; pub fn main() -> Result<()> { + // Capture DA URL from environment or use default + let da_url = std::env::var("PCL_DA_URL") + .unwrap_or_else(|_| "https://demo-21-assertion-da.phylax.systems".to_string()); + + // Set the DA URL as a build-time environment variable + println!("cargo:rustc-env=PCL_BUILD_DA_URL={}", da_url); + Emitter::default() .add_instructions(&BuildBuilder::all_build()?)? .add_instructions(&CargoBuilder::all_cargo()?)? diff --git a/bin/pcl/src/main.rs b/bin/pcl/src/main.rs index 6f73e8a..5a3b0f0 100644 --- a/bin/pcl/src/main.rs +++ b/bin/pcl/src/main.rs @@ -26,6 +26,8 @@ const VERSION_MESSAGE: &str = concat!( env!("VERGEN_GIT_SHA"), "\nBuild Timestamp: ", env!("VERGEN_BUILD_TIMESTAMP"), + "\nDefault DA URL: ", + pcl_core::default_da_url!(), ); #[derive(Parser)] @@ -55,6 +57,7 @@ enum Commands { Config(ConfigArgs), #[command(name = "build")] Build(BuildArgs), + } #[tokio::main] diff --git a/crates/core/src/assertion_da.rs b/crates/core/src/assertion_da.rs index 8545d3a..594a634 100644 --- a/crates/core/src/assertion_da.rs +++ b/crates/core/src/assertion_da.rs @@ -37,6 +37,16 @@ use crate::{ error::DaSubmitError, }; +/// Macro that defines the default DA URL - can be used in concat! macros +#[macro_export] +macro_rules! default_da_url { + () => { + "https://demo-21-assertion-da.phylax.systems" + }; +} + +pub const DEFAULT_DA_URL: &str = default_da_url!(); + /// Command-line arguments for storing assertions in the Data Availability layer. /// /// This struct handles the configuration needed to submit assertions to the DA layer, @@ -53,7 +63,7 @@ pub struct DaStoreArgs { short = 'u', env = "PCL_DA_URL", value_hint = ValueHint::Url, - default_value = "https://demo-21-assertion-da.phylax.systems" + default_value = DEFAULT_DA_URL )] pub url: String, @@ -125,6 +135,7 @@ impl DaStoreArgs { println!("\n\n{}", "Assertion Information".bold().green()); println!("{}", "===================".green()); println!("{assertion}"); + println!("\nSubmitted to assertion DA: {}", self.url); println!("\n{}", "Next Steps:".bold()); println!("Submit this assertion to a project with:"); From bff23a0e61a20a63a10a1eb8ed367817c32a6d6f Mon Sep 17 00:00:00 2001 From: GregTheDev Date: Tue, 17 Jun 2025 13:32:43 -0500 Subject: [PATCH 2/3] chore: fmt --- bin/pcl/build.rs | 4 ++-- bin/pcl/src/main.rs | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/bin/pcl/build.rs b/bin/pcl/build.rs index dc2555a..c2b6899 100644 --- a/bin/pcl/build.rs +++ b/bin/pcl/build.rs @@ -12,10 +12,10 @@ pub fn main() -> Result<()> { // Capture DA URL from environment or use default let da_url = std::env::var("PCL_DA_URL") .unwrap_or_else(|_| "https://demo-21-assertion-da.phylax.systems".to_string()); - + // Set the DA URL as a build-time environment variable println!("cargo:rustc-env=PCL_BUILD_DA_URL={}", da_url); - + Emitter::default() .add_instructions(&BuildBuilder::all_build()?)? .add_instructions(&CargoBuilder::all_cargo()?)? diff --git a/bin/pcl/src/main.rs b/bin/pcl/src/main.rs index 5a3b0f0..ae738cd 100644 --- a/bin/pcl/src/main.rs +++ b/bin/pcl/src/main.rs @@ -57,7 +57,6 @@ enum Commands { Config(ConfigArgs), #[command(name = "build")] Build(BuildArgs), - } #[tokio::main] From 178f212284f51b8ef864b9549d42647df2120bc3 Mon Sep 17 00:00:00 2001 From: GregTheDev Date: Tue, 17 Jun 2025 15:51:34 -0500 Subject: [PATCH 3/3] chore: removed unused env --- bin/pcl/build.rs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/bin/pcl/build.rs b/bin/pcl/build.rs index c2b6899..b215b7b 100644 --- a/bin/pcl/build.rs +++ b/bin/pcl/build.rs @@ -9,13 +9,6 @@ use vergen_gix::{ }; pub fn main() -> Result<()> { - // Capture DA URL from environment or use default - let da_url = std::env::var("PCL_DA_URL") - .unwrap_or_else(|_| "https://demo-21-assertion-da.phylax.systems".to_string()); - - // Set the DA URL as a build-time environment variable - println!("cargo:rustc-env=PCL_BUILD_DA_URL={}", da_url); - Emitter::default() .add_instructions(&BuildBuilder::all_build()?)? .add_instructions(&CargoBuilder::all_cargo()?)?