Skip to content

Commit 8c3a22b

Browse files
MartinNikovPetarKirov
authored andcommitted
config(modules/nimbus-eth2): Add gnosis and chiado as network options
1 parent f69777d commit 8c3a22b

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

modules/nimbus-eth2/args.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
lib:
22
with lib; {
33
network = mkOption {
4-
type = types.nullOr (types.enum ["goerli" "prater" "ropsten" "sepolia" "holesky"]);
4+
type = types.nullOr (types.enum ["goerli" "prater" "ropsten" "sepolia" "holesky" "gnosis" "chiado"]);
55
default = null;
66
description = mdDoc "The network to connect to. Mainnet (null) is the default ethereum network.";
77
};

modules/nimbus-eth2/default.nix

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,16 @@ in {
163163
${trustedNodeUrl} \
164164
${backfilling}'';
165165

166+
binaryName =
167+
if cfg.args.network == "gnosis" || cfg.args.network == "chiado"
168+
then "${cfg.package}/bin/nimbus_beacon_node_gnosis"
169+
else "${cfg.package}/bin/nimbus_beacon_node";
170+
166171
# When running trustedNodeSync after passing once, it gives an error
167172
# and doesn't continue to execute execStart. The problem occurs when
168173
# the service is restarted and execStartPre runs again. So we check
169174
# for the existence of a file in the folder, and that way we know if
170175
# Nimbus is running for the first time or not.
171-
172176
trustedNodeSync =
173177
if cfg.args.trusted-node-url != null
174178
then let
@@ -181,7 +185,7 @@ in {
181185
else
182186
echo "starting trustedNodeSync";
183187
set -x
184-
${cfg.package}/bin/nimbus_beacon_node trustedNodeSync "$@"
188+
${binaryName} trustedNodeSync "$@"
185189
fi
186190
'';
187191
in "${script} ${dataDirPath} ${dataDir} ${nodeSyncArgs}"
@@ -199,7 +203,7 @@ in {
199203
User = serviceName;
200204
StateDirectory = serviceName;
201205
ExecStartPre = trustedNodeSync;
202-
ExecStart = ''${cfg.package}/bin/nimbus_beacon_node ${beaconNodeArgs}'';
206+
ExecStart = ''${binaryName} ${beaconNodeArgs}'';
203207
MemoryDenyWriteExecute = "false"; # causes a library loading error
204208
}
205209
(mkIf (cfg.args.jwt-secret != null) {

0 commit comments

Comments
 (0)