1{ pkgs, ... }:
2{
3 name = "geth";
4 meta = with pkgs.lib; {
5 maintainers = with maintainers; [ bachp ];
6 };
7
8 nodes.machine =
9 { ... }:
10 {
11 services.geth."mainnet" = {
12 enable = true;
13 http = {
14 enable = true;
15 };
16 };
17
18 services.geth."holesky" = {
19 enable = true;
20 port = 30304;
21 network = "holesky";
22 http = {
23 enable = true;
24 port = 18545;
25 };
26 authrpc = {
27 enable = true;
28 port = 18551;
29 };
30 };
31
32 services.geth."sepolia" = {
33 enable = true;
34 port = 30305;
35 network = "sepolia";
36 http = {
37 enable = true;
38 port = 28545;
39 };
40 authrpc = {
41 enable = true;
42 port = 28551;
43 };
44 };
45 };
46
47 testScript = ''
48 start_all()
49
50 machine.wait_for_unit("geth-mainnet.service")
51 machine.wait_for_unit("geth-holesky.service")
52 machine.wait_for_unit("geth-sepolia.service")
53 machine.wait_for_open_port(8545)
54 machine.wait_for_open_port(18545)
55 machine.wait_for_open_port(28545)
56
57 machine.succeed(
58 'geth attach --exec "eth.blockNumber" http://localhost:8545 | grep \'^0$\' '
59 )
60
61 machine.succeed(
62 'geth attach --exec "eth.blockNumber" http://localhost:18545 | grep \'^0$\' '
63 )
64
65 machine.succeed(
66 'geth attach --exec "eth.blockNumber" http://localhost:28545 | grep \'^0$\' '
67 )
68 '';
69}