at 23.05-pre 904 B view raw
1import ./make-test-python.nix ({ pkgs, ... }: { 2 name = "geth"; 3 meta = with pkgs.lib; { 4 maintainers = with maintainers; [bachp ]; 5 }; 6 7 nodes.machine = { ... }: { 8 services.geth."mainnet" = { 9 enable = true; 10 http = { 11 enable = true; 12 }; 13 }; 14 services.geth."testnet" = { 15 enable = true; 16 port = 30304; 17 network = "goerli"; 18 http = { 19 enable = true; 20 port = 18545; 21 }; 22 }; 23 }; 24 25 testScript = '' 26 start_all() 27 28 machine.wait_for_unit("geth-mainnet.service") 29 machine.wait_for_unit("geth-testnet.service") 30 machine.wait_for_open_port(8545) 31 machine.wait_for_open_port(18545) 32 33 machine.succeed( 34 'geth attach --exec eth.blockNumber http://localhost:8545 | grep \'^0$\' ' 35 ) 36 37 machine.succeed( 38 'geth attach --exec "eth.chainId()" http://localhost:18545 | grep \'"0x5"\' ' 39 ) 40 ''; 41})