Skip to content

Commit

Permalink
feat: load wallet config from environment variables (#1178)
Browse files Browse the repository at this point in the history
Signed-off-by: Naian <126972030+nain-F49FF806@users.noreply.github.com>
  • Loading branch information
nain-F49FF806 committed Apr 16, 2024
1 parent e28567d commit ac2d946
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions aries/agents/mediator/src/bin/mediator.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use aries_vcx_wallet::wallet::indy::IndySdkWallet;
use aries_vcx_wallet::wallet::indy::{indy_wallet_config::IndyWalletConfig, IndySdkWallet};
use log::info;
use mediator::aries_agent::AgentBuilder;

Expand All @@ -8,8 +8,18 @@ async fn main() {
setup_logging();
info!("Starting up mediator! ⚙️⚙️");
let endpoint_root = std::env::var("ENDPOINT_ROOT").unwrap_or("127.0.0.1:8005".into());
info!("Mediator endpoint root address {}", endpoint_root);
let mut agent = AgentBuilder::<IndySdkWallet>::new_demo_agent()
info!("Mediator endpoint root address: {}", endpoint_root);
let indy_wallet_config_json = std::env::var("INDY_WALLET_CONFIG").unwrap_or(
"{
\"wallet_name\": \"demo-wallet\",
\"wallet_key\" : \"8dvfYSt5d1taSd6yJdpjq4emkwsPDDLYxkNFysFD2cZY\",
\"wallet_key_derivation\": \"RAW\"
}"
.to_string(),
);
let wallet_config: IndyWalletConfig = serde_json::from_str(&indy_wallet_config_json).unwrap();
info!("Wallet Config: {:?}", wallet_config);
let mut agent = AgentBuilder::<IndySdkWallet>::new_from_wallet_config(wallet_config)
.await
.unwrap();
agent
Expand Down

0 comments on commit ac2d946

Please sign in to comment.