Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Authentication Options for RPC Providers #191

Merged
merged 8 commits into from
Nov 30, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add URL for scheme selection
  • Loading branch information
hmzakhalid committed Nov 29, 2024
commit 46a491231799a9cb59555ec718320c9558f2dc8f
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
Loading