Skip to content

Commit 10aa9ad

Browse files
committed
small env fix
1 parent 52581a8 commit 10aa9ad

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## DRIA (required) ##
22
# Secret key of your compute node, 32 byte in hexadecimal.
3-
# e.g.: DKN_WALLET_SECRET_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
3+
# e.g.: DKN_WALLET_SECRET_KEY=0xabc...123
44
DKN_WALLET_SECRET_KEY=
55
# model1,model2,model3,... (comma separated, case-insensitive)
66
# example: gemini-2.0-flash,gpt-4o-mini

compute/src/config.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ impl DriaComputeNodeConfig {
9494
let network_type = env::var("DKN_NETWORK")
9595
.map(|s| DriaNetwork::from(s.as_str()))
9696
.unwrap_or_default();
97+
if network_type == DriaNetwork::Testnet {
98+
log::warn!("Using testnet!");
99+
}
97100

98101
// parse batch size
99102
let batch_size = env::var("DKN_BATCH_SIZE")
@@ -106,9 +109,12 @@ impl DriaComputeNodeConfig {
106109
.expect("could not parse version");
107110

108111
// parse initial rpc address, if any
109-
let initial_rpc_addr = env::var("DKN_INITIAL_RPC_ADDR").ok().map(|addr| {
110-
Multiaddr::from_str(&addr).expect("could not parse the given initial RPC address.")
111-
});
112+
let initial_rpc_addr = env::var("DKN_INITIAL_RPC_ADDR")
113+
.ok()
114+
.and_then(|addr| if addr.is_empty() { None } else { Some(addr) })
115+
.map(|addr| {
116+
Multiaddr::from_str(&addr).expect("could not parse the given initial RPC address.")
117+
});
112118

113119
Self {
114120
secret_key,

0 commit comments

Comments
 (0)