Skip to content

Commit

Permalink
add URL for scheme selection
Browse files Browse the repository at this point in the history
  • Loading branch information
hmzakhalid committed Nov 29, 2024
1 parent 9f6d7c1 commit 46a4912
Show file tree
Hide file tree
Showing 6 changed files with 303 additions and 60 deletions.
257 changes: 250 additions & 7 deletions packages/ciphernode/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/ciphernode/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ sha2 = "0.10.8"
tokio = { version = "1.38", features = ["full"] }
tracing = "0.1.37"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
url = "2.5.4"
libp2p = { version = "0.54.1", features = [
"async-std",
"identify",
Expand Down
7 changes: 4 additions & 3 deletions packages/ciphernode/enclave_node/src/aggregator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ pub async fn setup_aggregator(
.iter()
.filter(|chain| chain.enabled.unwrap_or(true))
{
let rpc_url = RPC::from_url(&chain.rpc_url).unwrap();
let rpc_url = RPC::from_url(&chain.rpc_url).map_err(|e| {
anyhow::anyhow!("Failed to parse RPC URL for chain {}: {}", chain.name, e)
})?;
let read_provider = create_readonly_provider(&rpc_url.as_ws_url()).await?;
let write_provider =
create_provider_with_signer(&rpc_url.as_http_url(), &signer).await?;
let write_provider = create_provider_with_signer(&rpc_url.as_http_url(), &signer).await?;

EnclaveSol::attach(
&bus,
Expand Down
5 changes: 3 additions & 2 deletions packages/ciphernode/enclave_node/src/ciphernode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ pub async fn setup_ciphernode(
.iter()
.filter(|chain| chain.enabled.unwrap_or(true))
{
let rpc_url = RPC::from_url(&chain.rpc_url).unwrap();

let rpc_url = RPC::from_url(&chain.rpc_url).map_err(|e| {
anyhow::anyhow!("Failed to parse RPC URL for chain {}: {}", chain.name, e)
})?;
let read_provider = create_readonly_provider(&rpc_url.as_ws_url()).await?;
EnclaveSolReader::attach(
&bus,
Expand Down
1 change: 1 addition & 0 deletions packages/ciphernode/evm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ cipher = { path = "../cipher" }
tokio = { workspace = true }
tracing = { workspace = true }
serde = { workspace = true }
url = { workspace = true }
zeroize = { workspace = true }

[dev-dependencies]
Expand Down
Loading

0 comments on commit 46a4912

Please sign in to comment.