Skip to content

Commit 20128c9

Browse files
monyarmMartinNikov
authored andcommitted
feat(aztec): Add Aztec sequencer service module
1 parent 5867ba1 commit 20128c9

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed

modules/aztec/default.nix

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{ withSystem, ... }:
2+
{
3+
flake.modules.nixos.aztec-sequencer =
4+
{
5+
pkgs,
6+
config,
7+
lib,
8+
...
9+
}:
10+
let
11+
cfg = config.services.aztec-sequencer;
12+
package = withSystem pkgs.stdenv.hostPlatform.system ({ config, ... }: config.packages.aztec);
13+
in
14+
{
15+
options.services.aztec-sequencer = with lib; {
16+
enable = mkEnableOption (lib.mdDoc "Aztec Sequencer");
17+
ethereumHosts = mkOption {
18+
type = types.str;
19+
description = "Ethereum hosts for the sequencer";
20+
};
21+
l1ConsensusHostUrls = mkOption {
22+
type = types.str;
23+
description = "L1 consensus host URLs for the sequencer";
24+
};
25+
coinbase = mkOption {
26+
type = types.str;
27+
description = "Coinbase for the sequencer";
28+
};
29+
p2pIp = mkOption {
30+
type = types.str;
31+
description = "P2P IP for the computer running the node (you can get this by running, curl api.ipify.org, on your node)";
32+
};
33+
p2pPort = mkOption {
34+
type = types.port;
35+
default = 40400;
36+
description = "The port for the P2P service.";
37+
};
38+
};
39+
config = lib.mkIf cfg.enable {
40+
mcl.secrets.services.aztec.secrets.validatorPrivateKey = { };
41+
42+
systemd.services.aztec-sequencer = {
43+
description = "Aztec Sequencer";
44+
wantedBy = [ "multi-user.target" ];
45+
serviceConfig = {
46+
ExecStart = ''
47+
${lib.getExe package} --node --archiver --sequencer \
48+
--network alpha-testnet \
49+
--l1-rpc-urls ${lib.concatStringsSep "," cfg.ethereumHosts} \
50+
--l1-consensus-host-urls ${lib.concatStringsSep "," cfg.l1ConsensusHostUrls} \
51+
--sequencer.validatorPrivateKey ${config.age.secrets."aztec/validatorPrivateKey"} \
52+
--sequencer.coinbase ${cfg.coinbase} \
53+
--p2p.p2pIp ${cfg.p2pIp} \
54+
--p2p.p2pPort ${cfg.p2pPort}
55+
'';
56+
};
57+
};
58+
59+
};
60+
};
61+
}

modules/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
imports = [
33
./lido
44
./pyroscope
5+
./aztec
56
./folder-size-metrics
67
./shard-split
78
./random-alerts

0 commit comments

Comments
 (0)