Skip to content

Commit 3eb38b8

Browse files
committed
fix: cleanup
1 parent 2d635c8 commit 3eb38b8

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

.env.example

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Example configuration for Sepolia + Celestia Mocha.
22
TENDERMINT_RPC_URL=https://rpc.celestia-mocha.com/
33

4-
# Key for relaying to the contract.
4+
# Optional: Key for relaying to the contract.
55
PRIVATE_KEY=
66

77
# Optional: Set if you're using a custom RPC URL.
@@ -14,4 +14,9 @@ LOOP_INTERVAL_MINS=
1414
# Optional: Set if you're using the KMS relayer.
1515
SECURE_RELAYER_API_KEY=
1616
SECURE_RELAYER_ENDPOINT=
17-
USE_KMS_RELAYER=
17+
USE_KMS_RELAYER=
18+
19+
# Optional: JSON encoded string of the `chains.json` file.
20+
CHAINS=
21+
# Optional: Path to the `chains.json` file.
22+
CHAINS_PATH=

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,6 @@ pgo-data.profdata
2121
filtered_transactions/**.csv
2222
filtered_transactions
2323

24-
chains.json
24+
chains.json
25+
chains*.json
26+
!chains.example.json

script/bin/operator.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,10 @@ impl ChainConfig {
295295

296296
let path = env::var("CHAINS_PATH").unwrap_or(DEFAULT_PATH.to_string());
297297

298-
Self::from_file(&path).or_else(|_| Self::from_env())
298+
Self::from_file(&path).or_else(|_| {
299+
tracing::info!("No chains file found, trying env.");
300+
Self::from_env()
301+
})
299302
}
300303

301304
/// Tries to read from the `CHAINS` environment variable.
@@ -308,8 +311,7 @@ impl ChainConfig {
308311
fn from_file(path: &str) -> Result<Vec<Self>> {
309312
tracing::debug!("Reading chains from file: {}", path);
310313

311-
let file = std::fs::read_to_string(path)
312-
.inspect_err(|e| println!("Error reading file: {:?}", e))?;
314+
let file = std::fs::read_to_string(path)?;
313315

314316
Ok(serde_json::from_str(&file)?)
315317
}

0 commit comments

Comments
 (0)