python.pkgs.pyqt5: 5.14.2 -> 5.15.0
[NixPkgs.git] / nixos / tests / quorum.nix
blob846d2a93018896d8bf50b56184bee8b352a29a2f
1 import ./make-test-python.nix ({ pkgs, ... }: {
2   name = "quorum";
3   meta = with pkgs.stdenv.lib.maintainers; {
4     maintainers = [ mmahut ];
5   };
7   nodes = {
8     machine = { ... }: {
9       services.quorum = {
10         enable = true;
11         permissioned = false;
12         staticNodes = [ "enode://dd333ec28f0a8910c92eb4d336461eea1c20803eed9cf2c056557f986e720f8e693605bba2f4e8f289b1162e5ac7c80c914c7178130711e393ca76abc1d92f57@0.0.0.0:30303?discport=0" ];
13         genesis = {
14           alloc = {
15             "189d23d201b03ae1cf9113672df29a5d672aefa3" = {
16               balance = "0x446c3b15f9926687d2c40534fdb564000000000000";
17             };
18             "44b07d2c28b8ed8f02b45bd84ac7d9051b3349e6" = {
19               balance = "0x446c3b15f9926687d2c40534fdb564000000000000";
20             };
21             "4c1ccd426833b9782729a212c857f2f03b7b4c0d" = {
22               balance = "0x446c3b15f9926687d2c40534fdb564000000000000";
23             };
24             "7ae555d0f6faad7930434abdaac2274fd86ab516" = {
25               balance = "0x446c3b15f9926687d2c40534fdb564000000000000";
26             };
27             c1056df7c02b6f1a353052eaf0533cc7cb743b52 = {
28               balance = "0x446c3b15f9926687d2c40534fdb564000000000000";
29             };
30           };
31           coinbase = "0x0000000000000000000000000000000000000000";
32           config = {
33             byzantiumBlock = 1;
34             chainId = 10;
35             eip150Block = 1;
36             eip150Hash =
37               "0x0000000000000000000000000000000000000000000000000000000000000000";
38             eip155Block = 1;
39             eip158Block = 1;
40             isQuorum = true;
41             istanbul = {
42               epoch = 30000;
43               policy = 0;
44             };
45           };
46         difficulty = "0x1";
47         extraData =
48           "0x0000000000000000000000000000000000000000000000000000000000000000f8aff869944c1ccd426833b9782729a212c857f2f03b7b4c0d94189d23d201b03ae1cf9113672df29a5d672aefa39444b07d2c28b8ed8f02b45bd84ac7d9051b3349e694c1056df7c02b6f1a353052eaf0533cc7cb743b52947ae555d0f6faad7930434abdaac2274fd86ab516b8410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0";
49         gasLimit = "0xe0000000";
50         gasUsed = "0x0";
51         mixHash =
52           "0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365";
53         nonce = "0x0";
54         number = "0x0";
55         parentHash =
56           "0x0000000000000000000000000000000000000000000000000000000000000000";
57         timestamp = "0x5cffc201";
58                   };
59      };
60     };
61   };
63   testScript = ''
64     start_all()
65     machine.wait_until_succeeds("mkdir -p /var/lib/quorum/keystore")
66     machine.wait_until_succeeds(
67         'echo \{\\"address\\":\\"9377bc3936de934c497e22917b81aa8774ac3bb0\\",\\"crypto\\":\{\\"cipher\\":\\"aes-128-ctr\\",\\"ciphertext\\":\\"ad8341d8ef225650403fd366c955f41095e438dd966a3c84b3d406818c1e366c\\",\\"cipherparams\\":\{\\"iv\\":\\"2a09f7a72fd6dff7c43150ff437e6ac2\\"\},\\"kdf\\":\\"scrypt\\",\\"kdfparams\\":\{\\"dklen\\":32,\\"n\\":262144,\\"p\\":1,\\"r\\":8,\\"salt\\":\\"d1a153845bb80cd6274c87c5bac8ac09fdfac5ff131a6f41b5ed319667f12027\\"\},\\"mac\\":\\"a9621ad88fa1d042acca6fc2fcd711f7e05bfbadea3f30f379235570c8e270d3\\"\},\\"id\\":\\"89e847a3-1527-42f6-a321-77de0a14ce02\\",\\"version\\":3\}\\" > /var/lib/quorum/keystore/UTC--2020-03-23T11-08-34.144812212Z--9377bc3936de934c497e22917b81aa8774ac3bb0'
68     )
69     machine.wait_until_succeeds(
70         "echo fe2725c4e8f7617764b845e8d939a65c664e7956eb47ed7d934573f16488efc1 > /var/lib/quorum/nodekey"
71     )
72     machine.wait_until_succeeds("systemctl restart quorum")
73     machine.wait_for_unit("quorum.service")
74     machine.sleep(15)
75     machine.wait_until_succeeds(
76         'geth attach /var/lib/quorum/geth.ipc --exec "eth.accounts" | grep 0x9377bc3936de934c497e22917b81aa8774ac3bb0'
77     )
78   '';