Skip to content

Commit 7ccb988

Browse files
committed
chore: add CHAIN_NAME to inventory
1 parent 25122fb commit 7ccb988

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name = "init4-bin-base"
44
description = "Internal utilities for binaries produced by the init4 team"
55
keywords = ["init4", "bin", "base"]
66

7-
version = "0.12.2"
7+
version = "0.12.3"
88
edition = "2021"
99
rust-version = "1.81"
1010
authors = ["init4", "James Prestwich", "evalir"]

src/utils/calc.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -267,20 +267,25 @@ impl FromEnv for SlotCalculator {
267267

268268
fn inventory() -> Vec<&'static EnvItemInfo> {
269269
vec![
270+
&EnvItemInfo {
271+
var: "CHAIN_NAME",
272+
description: "The name of the chain. If set, the other environment variables are ignored.",
273+
optional: true,
274+
},
270275
&EnvItemInfo {
271276
var: "START_TIMESTAMP",
272-
description: "The start timestamp of the chain in seconds",
273-
optional: false,
277+
description: "The start timestamp of the chain in seconds. Required if CHAIN_NAME is not set.",
278+
optional: true,
274279
},
275280
&EnvItemInfo {
276281
var: "SLOT_OFFSET",
277-
description: "The number of the slot containing the start timestamp",
278-
optional: false,
282+
description: "The number of the slot containing the start timestamp. Required if CHAIN_NAME is not set.",
283+
optional: true,
279284
},
280285
&EnvItemInfo {
281286
var: "SLOT_DURATION",
282-
description: "The slot duration of the chain in seconds",
283-
optional: false,
287+
description: "The slot duration of the chain in seconds. Required if CHAIN_NAME is not set.",
288+
optional: true,
284289
},
285290
]
286291
}

0 commit comments

Comments
 (0)