Add --goerli CLI option (#370)

Anton Nashatyrev 6 years ago committed by Chris Mckay
parent d828865f11
commit 0d63533191
  1. 803
      config/src/main/resources/goerli.json
  2. 41
      ethereum/p2p/src/main/java/tech/pegasys/pantheon/ethereum/p2p/config/DiscoveryConfiguration.java
  3. 8
      pantheon/src/main/java/tech/pegasys/pantheon/cli/EthNetworkConfig.java
  4. 25
      pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java
  5. 51
      pantheon/src/test/java/tech/pegasys/pantheon/cli/PantheonCommandTest.java

@ -0,0 +1,803 @@
{
"config":{
"chainId":6284,
"homesteadBlock":0,
"eip150Block":0,
"eip150Hash":"0xfa57319d09fd8a32faaf18d338c8a925a5a7975285bf29ecd024e083cba8abb1",
"eip155Block":0,
"eip158Block":0,
"eip160Block":0,
"byzantiumBlock":0,
"constantinopleBlock":0,
"clique":{
"period":15,
"epoch":30000
}
},
"coinbase":"0x0000000000000000000000000000000000000000",
"difficulty":"0x1",
"extraData":"0x2249276d20646f6e652077616974696e672e2e2e20666f7220626c6f636b2066696e616c69747922202d2049676779270000000001fa1804c408085d9c57eeb167ce953c99b6cb1e20794Fd02933F303FbA550bd1fe2f0649E3576eB0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"gasLimit":"0xa00000",
"mixHash":"0x0000000000000000000000000000000000000000000000000000000000000000",
"nonce":"0x0",
"timestamp":"0x5bdda800",
"alloc":{
"0000000000000000000000000000000000000000":{
"balance":"0x1"
},
"0000000000000000000000000000000000000001":{
"balance":"0x1"
},
"0000000000000000000000000000000000000002":{
"balance":"0x1"
},
"0000000000000000000000000000000000000003":{
"balance":"0x1"
},
"0000000000000000000000000000000000000004":{
"balance":"0x1"
},
"0000000000000000000000000000000000000005":{
"balance":"0x1"
},
"0000000000000000000000000000000000000006":{
"balance":"0x1"
},
"0000000000000000000000000000000000000007":{
"balance":"0x1"
},
"0000000000000000000000000000000000000008":{
"balance":"0x1"
},
"0000000000000000000000000000000000000009":{
"balance":"0x1"
},
"000000000000000000000000000000000000000a":{
"balance":"0x1"
},
"000000000000000000000000000000000000000b":{
"balance":"0x1"
},
"000000000000000000000000000000000000000c":{
"balance":"0x1"
},
"000000000000000000000000000000000000000d":{
"balance":"0x1"
},
"000000000000000000000000000000000000000e":{
"balance":"0x1"
},
"000000000000000000000000000000000000000f":{
"balance":"0x1"
},
"0000000000000000000000000000000000000010":{
"balance":"0x1"
},
"0000000000000000000000000000000000000011":{
"balance":"0x1"
},
"0000000000000000000000000000000000000012":{
"balance":"0x1"
},
"0000000000000000000000000000000000000013":{
"balance":"0x1"
},
"0000000000000000000000000000000000000014":{
"balance":"0x1"
},
"0000000000000000000000000000000000000015":{
"balance":"0x1"
},
"0000000000000000000000000000000000000016":{
"balance":"0x1"
},
"0000000000000000000000000000000000000017":{
"balance":"0x1"
},
"0000000000000000000000000000000000000018":{
"balance":"0x1"
},
"0000000000000000000000000000000000000019":{
"balance":"0x1"
},
"000000000000000000000000000000000000001a":{
"balance":"0x1"
},
"000000000000000000000000000000000000001b":{
"balance":"0x1"
},
"000000000000000000000000000000000000001c":{
"balance":"0x1"
},
"000000000000000000000000000000000000001d":{
"balance":"0x1"
},
"000000000000000000000000000000000000001e":{
"balance":"0x1"
},
"000000000000000000000000000000000000001f":{
"balance":"0x1"
},
"0000000000000000000000000000000000000020":{
"balance":"0x1"
},
"0000000000000000000000000000000000000021":{
"balance":"0x1"
},
"0000000000000000000000000000000000000022":{
"balance":"0x1"
},
"0000000000000000000000000000000000000023":{
"balance":"0x1"
},
"0000000000000000000000000000000000000024":{
"balance":"0x1"
},
"0000000000000000000000000000000000000025":{
"balance":"0x1"
},
"0000000000000000000000000000000000000026":{
"balance":"0x1"
},
"0000000000000000000000000000000000000027":{
"balance":"0x1"
},
"0000000000000000000000000000000000000028":{
"balance":"0x1"
},
"0000000000000000000000000000000000000029":{
"balance":"0x1"
},
"000000000000000000000000000000000000002a":{
"balance":"0x1"
},
"000000000000000000000000000000000000002b":{
"balance":"0x1"
},
"000000000000000000000000000000000000002c":{
"balance":"0x1"
},
"000000000000000000000000000000000000002d":{
"balance":"0x1"
},
"000000000000000000000000000000000000002e":{
"balance":"0x1"
},
"000000000000000000000000000000000000002f":{
"balance":"0x1"
},
"0000000000000000000000000000000000000030":{
"balance":"0x1"
},
"0000000000000000000000000000000000000031":{
"balance":"0x1"
},
"0000000000000000000000000000000000000032":{
"balance":"0x1"
},
"0000000000000000000000000000000000000033":{
"balance":"0x1"
},
"0000000000000000000000000000000000000034":{
"balance":"0x1"
},
"0000000000000000000000000000000000000035":{
"balance":"0x1"
},
"0000000000000000000000000000000000000036":{
"balance":"0x1"
},
"0000000000000000000000000000000000000037":{
"balance":"0x1"
},
"0000000000000000000000000000000000000038":{
"balance":"0x1"
},
"0000000000000000000000000000000000000039":{
"balance":"0x1"
},
"000000000000000000000000000000000000003a":{
"balance":"0x1"
},
"000000000000000000000000000000000000003b":{
"balance":"0x1"
},
"000000000000000000000000000000000000003c":{
"balance":"0x1"
},
"000000000000000000000000000000000000003d":{
"balance":"0x1"
},
"000000000000000000000000000000000000003e":{
"balance":"0x1"
},
"000000000000000000000000000000000000003f":{
"balance":"0x1"
},
"0000000000000000000000000000000000000040":{
"balance":"0x1"
},
"0000000000000000000000000000000000000041":{
"balance":"0x1"
},
"0000000000000000000000000000000000000042":{
"balance":"0x1"
},
"0000000000000000000000000000000000000043":{
"balance":"0x1"
},
"0000000000000000000000000000000000000044":{
"balance":"0x1"
},
"0000000000000000000000000000000000000045":{
"balance":"0x1"
},
"0000000000000000000000000000000000000046":{
"balance":"0x1"
},
"0000000000000000000000000000000000000047":{
"balance":"0x1"
},
"0000000000000000000000000000000000000048":{
"balance":"0x1"
},
"0000000000000000000000000000000000000049":{
"balance":"0x1"
},
"000000000000000000000000000000000000004a":{
"balance":"0x1"
},
"000000000000000000000000000000000000004b":{
"balance":"0x1"
},
"000000000000000000000000000000000000004c":{
"balance":"0x1"
},
"000000000000000000000000000000000000004d":{
"balance":"0x1"
},
"000000000000000000000000000000000000004e":{
"balance":"0x1"
},
"000000000000000000000000000000000000004f":{
"balance":"0x1"
},
"0000000000000000000000000000000000000050":{
"balance":"0x1"
},
"0000000000000000000000000000000000000051":{
"balance":"0x1"
},
"0000000000000000000000000000000000000052":{
"balance":"0x1"
},
"0000000000000000000000000000000000000053":{
"balance":"0x1"
},
"0000000000000000000000000000000000000054":{
"balance":"0x1"
},
"0000000000000000000000000000000000000055":{
"balance":"0x1"
},
"0000000000000000000000000000000000000056":{
"balance":"0x1"
},
"0000000000000000000000000000000000000057":{
"balance":"0x1"
},
"0000000000000000000000000000000000000058":{
"balance":"0x1"
},
"0000000000000000000000000000000000000059":{
"balance":"0x1"
},
"000000000000000000000000000000000000005a":{
"balance":"0x1"
},
"000000000000000000000000000000000000005b":{
"balance":"0x1"
},
"000000000000000000000000000000000000005c":{
"balance":"0x1"
},
"000000000000000000000000000000000000005d":{
"balance":"0x1"
},
"000000000000000000000000000000000000005e":{
"balance":"0x1"
},
"000000000000000000000000000000000000005f":{
"balance":"0x1"
},
"0000000000000000000000000000000000000060":{
"balance":"0x1"
},
"0000000000000000000000000000000000000061":{
"balance":"0x1"
},
"0000000000000000000000000000000000000062":{
"balance":"0x1"
},
"0000000000000000000000000000000000000063":{
"balance":"0x1"
},
"0000000000000000000000000000000000000064":{
"balance":"0x1"
},
"0000000000000000000000000000000000000065":{
"balance":"0x1"
},
"0000000000000000000000000000000000000066":{
"balance":"0x1"
},
"0000000000000000000000000000000000000067":{
"balance":"0x1"
},
"0000000000000000000000000000000000000068":{
"balance":"0x1"
},
"0000000000000000000000000000000000000069":{
"balance":"0x1"
},
"000000000000000000000000000000000000006a":{
"balance":"0x1"
},
"000000000000000000000000000000000000006b":{
"balance":"0x1"
},
"000000000000000000000000000000000000006c":{
"balance":"0x1"
},
"000000000000000000000000000000000000006d":{
"balance":"0x1"
},
"000000000000000000000000000000000000006e":{
"balance":"0x1"
},
"000000000000000000000000000000000000006f":{
"balance":"0x1"
},
"0000000000000000000000000000000000000070":{
"balance":"0x1"
},
"0000000000000000000000000000000000000071":{
"balance":"0x1"
},
"0000000000000000000000000000000000000072":{
"balance":"0x1"
},
"0000000000000000000000000000000000000073":{
"balance":"0x1"
},
"0000000000000000000000000000000000000074":{
"balance":"0x1"
},
"0000000000000000000000000000000000000075":{
"balance":"0x1"
},
"0000000000000000000000000000000000000076":{
"balance":"0x1"
},
"0000000000000000000000000000000000000077":{
"balance":"0x1"
},
"0000000000000000000000000000000000000078":{
"balance":"0x1"
},
"0000000000000000000000000000000000000079":{
"balance":"0x1"
},
"000000000000000000000000000000000000007a":{
"balance":"0x1"
},
"000000000000000000000000000000000000007b":{
"balance":"0x1"
},
"000000000000000000000000000000000000007c":{
"balance":"0x1"
},
"000000000000000000000000000000000000007d":{
"balance":"0x1"
},
"000000000000000000000000000000000000007e":{
"balance":"0x1"
},
"000000000000000000000000000000000000007f":{
"balance":"0x1"
},
"0000000000000000000000000000000000000080":{
"balance":"0x1"
},
"0000000000000000000000000000000000000081":{
"balance":"0x1"
},
"0000000000000000000000000000000000000082":{
"balance":"0x1"
},
"0000000000000000000000000000000000000083":{
"balance":"0x1"
},
"0000000000000000000000000000000000000084":{
"balance":"0x1"
},
"0000000000000000000000000000000000000085":{
"balance":"0x1"
},
"0000000000000000000000000000000000000086":{
"balance":"0x1"
},
"0000000000000000000000000000000000000087":{
"balance":"0x1"
},
"0000000000000000000000000000000000000088":{
"balance":"0x1"
},
"0000000000000000000000000000000000000089":{
"balance":"0x1"
},
"000000000000000000000000000000000000008a":{
"balance":"0x1"
},
"000000000000000000000000000000000000008b":{
"balance":"0x1"
},
"000000000000000000000000000000000000008c":{
"balance":"0x1"
},
"000000000000000000000000000000000000008d":{
"balance":"0x1"
},
"000000000000000000000000000000000000008e":{
"balance":"0x1"
},
"000000000000000000000000000000000000008f":{
"balance":"0x1"
},
"0000000000000000000000000000000000000090":{
"balance":"0x1"
},
"0000000000000000000000000000000000000091":{
"balance":"0x1"
},
"0000000000000000000000000000000000000092":{
"balance":"0x1"
},
"0000000000000000000000000000000000000093":{
"balance":"0x1"
},
"0000000000000000000000000000000000000094":{
"balance":"0x1"
},
"0000000000000000000000000000000000000095":{
"balance":"0x1"
},
"0000000000000000000000000000000000000096":{
"balance":"0x1"
},
"0000000000000000000000000000000000000097":{
"balance":"0x1"
},
"0000000000000000000000000000000000000098":{
"balance":"0x1"
},
"0000000000000000000000000000000000000099":{
"balance":"0x1"
},
"000000000000000000000000000000000000009a":{
"balance":"0x1"
},
"000000000000000000000000000000000000009b":{
"balance":"0x1"
},
"000000000000000000000000000000000000009c":{
"balance":"0x1"
},
"000000000000000000000000000000000000009d":{
"balance":"0x1"
},
"000000000000000000000000000000000000009e":{
"balance":"0x1"
},
"000000000000000000000000000000000000009f":{
"balance":"0x1"
},
"00000000000000000000000000000000000000a0":{
"balance":"0x1"
},
"00000000000000000000000000000000000000a1":{
"balance":"0x1"
},
"00000000000000000000000000000000000000a2":{
"balance":"0x1"
},
"00000000000000000000000000000000000000a3":{
"balance":"0x1"
},
"00000000000000000000000000000000000000a4":{
"balance":"0x1"
},
"00000000000000000000000000000000000000a5":{
"balance":"0x1"
},
"00000000000000000000000000000000000000a6":{
"balance":"0x1"
},
"00000000000000000000000000000000000000a7":{
"balance":"0x1"
},
"00000000000000000000000000000000000000a8":{
"balance":"0x1"
},
"00000000000000000000000000000000000000a9":{
"balance":"0x1"
},
"00000000000000000000000000000000000000aa":{
"balance":"0x1"
},
"00000000000000000000000000000000000000ab":{
"balance":"0x1"
},
"00000000000000000000000000000000000000ac":{
"balance":"0x1"
},
"00000000000000000000000000000000000000ad":{
"balance":"0x1"
},
"00000000000000000000000000000000000000ae":{
"balance":"0x1"
},
"00000000000000000000000000000000000000af":{
"balance":"0x1"
},
"00000000000000000000000000000000000000b0":{
"balance":"0x1"
},
"00000000000000000000000000000000000000b1":{
"balance":"0x1"
},
"00000000000000000000000000000000000000b2":{
"balance":"0x1"
},
"00000000000000000000000000000000000000b3":{
"balance":"0x1"
},
"00000000000000000000000000000000000000b4":{
"balance":"0x1"
},
"00000000000000000000000000000000000000b5":{
"balance":"0x1"
},
"00000000000000000000000000000000000000b6":{
"balance":"0x1"
},
"00000000000000000000000000000000000000b7":{
"balance":"0x1"
},
"00000000000000000000000000000000000000b8":{
"balance":"0x1"
},
"00000000000000000000000000000000000000b9":{
"balance":"0x1"
},
"00000000000000000000000000000000000000ba":{
"balance":"0x1"
},
"00000000000000000000000000000000000000bb":{
"balance":"0x1"
},
"00000000000000000000000000000000000000bc":{
"balance":"0x1"
},
"00000000000000000000000000000000000000bd":{
"balance":"0x1"
},
"00000000000000000000000000000000000000be":{
"balance":"0x1"
},
"00000000000000000000000000000000000000bf":{
"balance":"0x1"
},
"00000000000000000000000000000000000000c0":{
"balance":"0x1"
},
"00000000000000000000000000000000000000c1":{
"balance":"0x1"
},
"00000000000000000000000000000000000000c2":{
"balance":"0x1"
},
"00000000000000000000000000000000000000c3":{
"balance":"0x1"
},
"00000000000000000000000000000000000000c4":{
"balance":"0x1"
},
"00000000000000000000000000000000000000c5":{
"balance":"0x1"
},
"00000000000000000000000000000000000000c6":{
"balance":"0x1"
},
"00000000000000000000000000000000000000c7":{
"balance":"0x1"
},
"00000000000000000000000000000000000000c8":{
"balance":"0x1"
},
"00000000000000000000000000000000000000c9":{
"balance":"0x1"
},
"00000000000000000000000000000000000000ca":{
"balance":"0x1"
},
"00000000000000000000000000000000000000cb":{
"balance":"0x1"
},
"00000000000000000000000000000000000000cc":{
"balance":"0x1"
},
"00000000000000000000000000000000000000cd":{
"balance":"0x1"
},
"00000000000000000000000000000000000000ce":{
"balance":"0x1"
},
"00000000000000000000000000000000000000cf":{
"balance":"0x1"
},
"00000000000000000000000000000000000000d0":{
"balance":"0x1"
},
"00000000000000000000000000000000000000d1":{
"balance":"0x1"
},
"00000000000000000000000000000000000000d2":{
"balance":"0x1"
},
"00000000000000000000000000000000000000d3":{
"balance":"0x1"
},
"00000000000000000000000000000000000000d4":{
"balance":"0x1"
},
"00000000000000000000000000000000000000d5":{
"balance":"0x1"
},
"00000000000000000000000000000000000000d6":{
"balance":"0x1"
},
"00000000000000000000000000000000000000d7":{
"balance":"0x1"
},
"00000000000000000000000000000000000000d8":{
"balance":"0x1"
},
"00000000000000000000000000000000000000d9":{
"balance":"0x1"
},
"00000000000000000000000000000000000000da":{
"balance":"0x1"
},
"00000000000000000000000000000000000000db":{
"balance":"0x1"
},
"00000000000000000000000000000000000000dc":{
"balance":"0x1"
},
"00000000000000000000000000000000000000dd":{
"balance":"0x1"
},
"00000000000000000000000000000000000000de":{
"balance":"0x1"
},
"00000000000000000000000000000000000000df":{
"balance":"0x1"
},
"00000000000000000000000000000000000000e0":{
"balance":"0x1"
},
"00000000000000000000000000000000000000e1":{
"balance":"0x1"
},
"00000000000000000000000000000000000000e2":{
"balance":"0x1"
},
"00000000000000000000000000000000000000e3":{
"balance":"0x1"
},
"00000000000000000000000000000000000000e4":{
"balance":"0x1"
},
"00000000000000000000000000000000000000e5":{
"balance":"0x1"
},
"00000000000000000000000000000000000000e6":{
"balance":"0x1"
},
"00000000000000000000000000000000000000e7":{
"balance":"0x1"
},
"00000000000000000000000000000000000000e8":{
"balance":"0x1"
},
"00000000000000000000000000000000000000e9":{
"balance":"0x1"
},
"00000000000000000000000000000000000000ea":{
"balance":"0x1"
},
"00000000000000000000000000000000000000eb":{
"balance":"0x1"
},
"00000000000000000000000000000000000000ec":{
"balance":"0x1"
},
"00000000000000000000000000000000000000ed":{
"balance":"0x1"
},
"00000000000000000000000000000000000000ee":{
"balance":"0x1"
},
"00000000000000000000000000000000000000ef":{
"balance":"0x1"
},
"00000000000000000000000000000000000000f0":{
"balance":"0x1"
},
"00000000000000000000000000000000000000f1":{
"balance":"0x1"
},
"00000000000000000000000000000000000000f2":{
"balance":"0x1"
},
"00000000000000000000000000000000000000f3":{
"balance":"0x1"
},
"00000000000000000000000000000000000000f4":{
"balance":"0x1"
},
"00000000000000000000000000000000000000f5":{
"balance":"0x1"
},
"00000000000000000000000000000000000000f6":{
"balance":"0x1"
},
"00000000000000000000000000000000000000f7":{
"balance":"0x1"
},
"00000000000000000000000000000000000000f8":{
"balance":"0x1"
},
"00000000000000000000000000000000000000f9":{
"balance":"0x1"
},
"00000000000000000000000000000000000000fa":{
"balance":"0x1"
},
"00000000000000000000000000000000000000fb":{
"balance":"0x1"
},
"00000000000000000000000000000000000000fc":{
"balance":"0x1"
},
"00000000000000000000000000000000000000fd":{
"balance":"0x1"
},
"00000000000000000000000000000000000000fe":{
"balance":"0x1"
},
"00000000000000000000000000000000000000ff":{
"balance":"0x1"
},
"0x009fcc115ad9ef38288a82a014dea30f63a84383":{
"balance":"0x100000000000000000000000000000000000000000000000000"
},
"0x0015c90d0e12186bc51c9d51aff4d3fb6e984291":{
"balance":"0x100000000000000000000000000000000000000000000000000"
}
},
"number":"0x0",
"gasUsed":"0x0",
"parentHash":"0x0000000000000000000000000000000000000000000000000000000000000000"
}

@ -52,6 +52,47 @@ public class DiscoveryConfiguration {
.map(DefaultPeer::fromURI) .map(DefaultPeer::fromURI)
.collect(toList())); .collect(toList()));
public static List<Peer> GOERLI_BOOTSTRAP_NODES =
Collections.unmodifiableList(
Stream.of(
"enode://04fb7acb86f47b64298374b5ccb3c2959f1e5e9362158e50e0793c261518ffe83759d8295ca4a88091d4726d5f85e6276d53ae9ef4f35b8c4c0cc6b99c8c0537@40.70.214.166:40303",
"enode://17de5580bbc1620081a21f82954731c7854305463630a0d677ed991487609829a6bf1ffcb8fb8ef269eff4829690625db176b498c629b9b13cb39b73b6e7b08b@213.186.16.82:1345",
"enode://22da3ef3707626a92a32b0527d0846f88228daa0536c62d83c9ac7e96660bc8e4ac70a9aa8f8cedf71b580cd41449ad46c6e5a06ecf138b142f38a9d1b2b856a@85.7.110.224:30303",
"enode://3897b1a5786948f643d9755df92dc56d0b2284f36730dc198ef371aebf191b24b5cbe8162c2032b09b2f14ba73460bfc3f7d4ef1e26bcc59297d4f235dc5cdc5@54.88.169.219:30303",
"enode://3d197d65ed92af6d0adf280ce486714fb641ef9f9f38f0bdd5ddd552666fc1132f033eb249a87f7f30086902c131f30f054f872ae80ac83eea6bd3760a7bbce2@40.70.214.166:30405",
"enode://3d8d6698d2d4d730d896c7c1e3602ff845343f71bacbf8cb614b0e94fcb3b10e1a49ac2a5063c76617182a1c5928a4a63d4be897e54ae1cb858a1b94d0d275b8@188.166.20.30:30303",
"enode://46add44b9f13965f7b9875ac6b85f016f341012d84f975377573800a863526f4da19ae2c620ec73d11591fa9510e992ecc03ad0751f53cc02f7c7ed6d55c7291@94.237.54.114:30313",
"enode://5065d5221b507764771a8b74abc69df0351217eae09b96ec0df4275576a8b2bbba9986ce3037e6fb3c933b5b301364e18030c1ada8cec4ae00f1fa4dfff32eb8@13.113.211.0:30303",
"enode://573b6607cd59f241e30e4c4943fd50e99e2b6f42f9bd5ca111659d309c06741247f4f1e93843ad3e8c8c18b6e2d94c161b7ef67479b3938780a97134b618b5ce@52.56.136.200:30303",
"enode://57f58f16fccdd9fb6f587565ac09af4b3b4b33d0fbd14252cc61d29a65b0d83c08419e67ac5292b9342090053526b847f2487278e609f4b4cd1dbf0f48105b2b@213.186.16.82:30303",
"enode://5d9b1cba03738dfd23e12e4efb99b72623474fece2cc582c95e3ba7d481d519dea0029901f1f844116bab806044e8552f0431b21cf8d96010fc351b483330faa@13.78.10.94:30405",
"enode://7232e76a13a1abdfd75138f6499c310593d3376eef990de3c86593c85be0c09010f69276bd0f33eb4f9fef7316b9af6fa3fe332878642a813f86f8fdf03a0989@23.233.68.118:30303",
"enode://7592caf086d4d443905508492f40145bb1a0883ef7cbb9906b613eba6b501806e4ba0545a8e576236408e5b050e752e80a58445fb0ff2699b5ba4e334f481e40@13.78.10.94:30303",
"enode://76850e0836d0074e060118bf57a627bfd8af3b59871fd16cb4d0ca826eda7a60b0e773f359335e5e3c6cea8a72b1efbf9a298a61b88d0c94ab1a6ea34f1d6c40@13.78.10.94:40303",
"enode://85e577ec505b70e45ee6556809864c5211a5f10a46149d4caf1c6952fcbbd7f950c9510351f50f14374cd110fdb314f5cf9dcda92b25b82c4f2a1d008f15cf06@80.187.104.237:30303",
"enode://87a7adc692793eb41918b74b7ba4aa9ec1b45a24917fd6e66118ffc9ffcac9d2672941fc10fd5a2d44e76d02628e273f861bf480311e31babd1ee211f5838e40@168.61.153.244:30405",
"enode://9b1274fc252261bd9d8687bdc37cc3768551b93c9f3a3b3df2f4c7bbe6d797fb8c2ea6fb398114b2c6c6889a8257c244dfc57c1bb7b578c15cc5cc81fc0b3f79@168.61.153.244:30303",
"enode://9bc25c32aaed85926a663563c8aa1c9abef6fb18e9282b7ae00584c9ed9ef8e353f18459b591c59b08f5f1ce692cf27cfdc5a0ff85312656aa65552e789f2315@40.74.91.252:40303",
"enode://9ddf3e1ade168b2eea2d917dc32faffc727d53f488c78b293a523fda880bcca0b072506cf1ee6e743618d43f52e192fadc5ef5b43203a7f8e27b93a299248e3e@40.74.91.252:30405",
"enode://9e1b905a47caa6f4379c550a91b19df94c633689ee0d5bd4b317b998b052f270b715379fe5d4340fcca19116465443a79adb90883ccfffaf150432b505ccf3fd@159.203.190.82:30312",
"enode://a899e1b4551eb4d6e906a1313b8ba52e89eeb13412f1da058fd5a0cf261c235cb42fa38cc6c21b0fd5f5bcc5c5daa06945ea0410071cf34468a2f428454682ed@40.70.214.166:30303",
"enode://ac1977d8753fc12dd801e87139c0fd56fed3bac136c8a9cafe4f82e147612f3232266e7f4c74d869722fd26ecefff42496ea7b2225d624d432c123f5f4ed44b8@80.187.104.212:30303",
"enode://b0e75e7306435b7986567dafc8d9ca804b09a6f4b68fa1a6a2a5cb9979845b1dfd210c877dadfda0cebaf4ceb111114392df4bd50e223e71de3e807055707f19@86.103.218.43:30308",
"enode://b1668e8808fe1cd0c518a3ea8090f5412f62dc0cee64dbdec21dc3894aa32838b399e411481f070994e09ce8fddaaaa433bc2f4ad277aa5973080832546df631@123.113.131.26:30300",
"enode://b16d3bf8d6fe582e4a30698e536247ed9218c0706b890d7120c771fe510e77a79907ec2db2d5a1a393cdcd972eacefc07bebaeb99de5f7b169cb6b90951d1799@213.32.72.208:30303",
"enode://bc5235d7f37062b9c51108b0178df95b5e1ae9d1e79b950f5e7445ad6d101175d3a72b5e1ea89e459e2a430cc1d997833b8f9fa4637901b77821d96d47d19dcc@46.101.231.8:30303",
"enode://cbe600c451966737d858d8d561a913bb47770d4e24c50968c0d24b833613afc61daf88a0e1dabde5de01fa9a06469c6daa2bbf0e53dd6485f5b67eb4d3d65ab8@68.183.116.121:30303",
"enode://d21512d5900be2f67092526411d6d2b45ec50d5b6af33ccf1c519f45aea53662ac33fe36e6f5966d740e6f4f1f5df51462ff496ff8192ef52b9fac0f7bd49de9@213.186.16.82:30303",
"enode://d686ec8bf4bf0b205e8888e207352e6585232395e998cc1910b33be479c8405352ae1fc56aea79b2482b1b2d89412dc81091aa67ce775e335cd0f7d9dbfdfba3@84.196.20.71:30303",
"enode://d6acd86efcbb12d18b4287b8695ebc4730e67b1096de826df4bc05392004d66f977cff2844a7ead0a12cad961aa8277b1e032ee2c92ca40b4a2d76dd409da4ac@159.89.119.66:30303",
"enode://de2b54a19c9d77f94626043e0fea0c0878d5aa8eb1b58afb5bb1ca4fdd91d68e4a13a108a8f1a30009b258eb7f7b35efa71dcbdfda01a9aa0de06bf3898580f9@147.75.62.159:40404",
"enode://ea26ccaf0867771ba1fec32b3589c0169910cb4917017dba940efbef1d2515ce864f93a9abc846696ebad40c81de7c74d7b2b46794a71de8f95a0d019f494ff3@168.61.153.255:40303",
"enode://ed70646a024612fa0db4fdb276a3add7ea322b13bec80dd1566186cc86cf9b853e1553eb0f49d3c4b9b37dc936f80e9ee0a2432b7b53f0b0d792fc2cdfb62861@88.19.163.180:30303",
"enode://efaf6dad7a0773d911a6fcc44939faaba5d4802a7de8514bfacf9cc1ec9c292c82c1741eb4f14010895a273e7c94703cfc10c06068f6daa6ad25d4b0c0ca8e33@40.74.91.252:30303",
"enode://fede36ae9fb2347204b80e6e81cbe226eb6c6f2052e5fea8e4a224dcd69f3af062ca281064b9001d497f63d85447fef4c48018319654b04f9cd9ce619baedc23@86.103.218.43:30308")
.map(DefaultPeer::fromURI)
.collect(toList()));
private boolean active = true; private boolean active = true;
private String bindHost = "0.0.0.0"; private String bindHost = "0.0.0.0";
private int bindPort = 30303; private int bindPort = 30303;

@ -13,6 +13,7 @@
package tech.pegasys.pantheon.cli; package tech.pegasys.pantheon.cli;
import static java.nio.charset.StandardCharsets.UTF_8; import static java.nio.charset.StandardCharsets.UTF_8;
import static tech.pegasys.pantheon.ethereum.p2p.config.DiscoveryConfiguration.GOERLI_BOOTSTRAP_NODES;
import static tech.pegasys.pantheon.ethereum.p2p.config.DiscoveryConfiguration.MAINNET_BOOTSTRAP_NODES; import static tech.pegasys.pantheon.ethereum.p2p.config.DiscoveryConfiguration.MAINNET_BOOTSTRAP_NODES;
import static tech.pegasys.pantheon.ethereum.p2p.config.DiscoveryConfiguration.RINKEBY_BOOTSTRAP_NODES; import static tech.pegasys.pantheon.ethereum.p2p.config.DiscoveryConfiguration.RINKEBY_BOOTSTRAP_NODES;
import static tech.pegasys.pantheon.ethereum.p2p.config.DiscoveryConfiguration.ROPSTEN_BOOTSTRAP_NODES; import static tech.pegasys.pantheon.ethereum.p2p.config.DiscoveryConfiguration.ROPSTEN_BOOTSTRAP_NODES;
@ -30,9 +31,11 @@ public class EthNetworkConfig {
private static final int MAINNET_NETWORK_ID = 1; private static final int MAINNET_NETWORK_ID = 1;
private static final int RINKEBY_NETWORK_ID = 4; private static final int RINKEBY_NETWORK_ID = 4;
private static final int ROPSTEN_NETWORK_ID = 3; private static final int ROPSTEN_NETWORK_ID = 3;
private static final int GOERLI_NETWORK_ID = 6284;
private static final String MAINNET_GENESIS = "mainnet.json"; private static final String MAINNET_GENESIS = "mainnet.json";
private static final String RINKEBY_GENESIS = "rinkeby.json"; private static final String RINKEBY_GENESIS = "rinkeby.json";
private static final String ROPSTEN_GENESIS = "ropsten.json"; private static final String ROPSTEN_GENESIS = "ropsten.json";
private static final String GOERLI_GENESIS = "goerli.json";
private final String genesisConfig; private final String genesisConfig;
private final int networkId; private final int networkId;
private final Collection<?> bootNodes; private final Collection<?> bootNodes;
@ -104,6 +107,11 @@ public class EthNetworkConfig {
jsonConfig(ROPSTEN_GENESIS), ROPSTEN_NETWORK_ID, ROPSTEN_BOOTSTRAP_NODES); jsonConfig(ROPSTEN_GENESIS), ROPSTEN_NETWORK_ID, ROPSTEN_BOOTSTRAP_NODES);
} }
public static EthNetworkConfig goerli() {
return new EthNetworkConfig(
jsonConfig(GOERLI_GENESIS), GOERLI_NETWORK_ID, GOERLI_BOOTSTRAP_NODES);
}
private static String jsonConfig(final String resourceName) { private static String jsonConfig(final String resourceName) {
try { try {
URI uri = Resources.getResource(resourceName).toURI(); URI uri = Resources.getResource(resourceName).toURI();

@ -46,6 +46,7 @@ import java.io.IOException;
import java.net.InetAddress; import java.net.InetAddress;
import java.nio.file.Path; import java.nio.file.Path;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
@ -227,6 +228,12 @@ public class PantheonCommand implements DefaultCommandValues, Runnable {
) )
private final Boolean ropsten = false; private final Boolean ropsten = false;
@Option(
names = {"--goerli"},
description = "Use the Goerli test network (default: ${DEFAULT-VALUE})"
)
private final Boolean goerli = false;
@Option( @Option(
names = {"--p2p-listen"}, names = {"--p2p-listen"},
paramLabel = MANDATORY_HOST_AND_PORT_FORMAT_HELP, paramLabel = MANDATORY_HOST_AND_PORT_FORMAT_HELP,
@ -417,15 +424,15 @@ public class PantheonCommand implements DefaultCommandValues, Runnable {
//noinspection ConstantConditions //noinspection ConstantConditions
if (isMiningEnabled && coinbase == null) { if (isMiningEnabled && coinbase == null) {
System.out.println( throw new ParameterException(
new CommandLine(this),
"Unable to mine without a valid coinbase. Either disable mining (remove --miner-enabled)" "Unable to mine without a valid coinbase. Either disable mining (remove --miner-enabled)"
+ "or specify the beneficiary of mining (via --miner-coinbase <Address>)"); + "or specify the beneficiary of mining (via --miner-coinbase <Address>)");
return;
} }
if (ropsten && rinkeby) { if (trueCount(ropsten, rinkeby, goerli) > 1) {
System.out.println( throw new ParameterException(
"Unable to connect to multiple networks simultaneously. Remove one of --ropsten or --rinkeby"); new CommandLine(this),
return; "Unable to connect to multiple networks simultaneously. Specify one of --ropsten, --rinkeby or --goerli");
} }
final EthNetworkConfig ethNetworkConfig = ethNetworkConfig(); final EthNetworkConfig ethNetworkConfig = ethNetworkConfig();
synchronize( synchronize(
@ -439,6 +446,10 @@ public class PantheonCommand implements DefaultCommandValues, Runnable {
permissioningConfiguration()); permissioningConfiguration());
} }
private static int trueCount(final Boolean... b) {
return (int) Arrays.stream(b).filter(bool -> bool).count();
}
PantheonController<?> buildController() { PantheonController<?> buildController() {
try { try {
return controllerBuilder return controllerBuilder
@ -570,6 +581,8 @@ public class PantheonCommand implements DefaultCommandValues, Runnable {
predefinedNetworkConfig = EthNetworkConfig.rinkeby(); predefinedNetworkConfig = EthNetworkConfig.rinkeby();
} else if (ropsten) { } else if (ropsten) {
predefinedNetworkConfig = EthNetworkConfig.ropsten(); predefinedNetworkConfig = EthNetworkConfig.ropsten();
} else if (goerli) {
predefinedNetworkConfig = EthNetworkConfig.goerli();
} else { } else {
predefinedNetworkConfig = EthNetworkConfig.mainnet(); predefinedNetworkConfig = EthNetworkConfig.mainnet();
} }

@ -838,12 +838,61 @@ public class PantheonCommandTest extends CommandTestAbstract {
assertThat(networkArg.getValue()).isEqualTo(EthNetworkConfig.rinkeby()); assertThat(networkArg.getValue()).isEqualTo(EthNetworkConfig.rinkeby());
} }
@Test
public void ropstenValuesAreUsed() throws Exception {
parseCommand("--ropsten");
final ArgumentCaptor<EthNetworkConfig> networkArg =
ArgumentCaptor.forClass(EthNetworkConfig.class);
verify(mockControllerBuilder).ethNetworkConfig(networkArg.capture());
verify(mockControllerBuilder).build();
assertThat(commandOutput.toString()).isEmpty();
assertThat(commandErrorOutput.toString()).isEmpty();
assertThat(networkArg.getValue()).isEqualTo(EthNetworkConfig.ropsten());
}
@Test
public void goerliValuesAreUsed() throws Exception {
parseCommand("--goerli");
final ArgumentCaptor<EthNetworkConfig> networkArg =
ArgumentCaptor.forClass(EthNetworkConfig.class);
verify(mockControllerBuilder).ethNetworkConfig(networkArg.capture());
verify(mockControllerBuilder).build();
assertThat(commandOutput.toString()).isEmpty();
assertThat(commandErrorOutput.toString()).isEmpty();
assertThat(networkArg.getValue()).isEqualTo(EthNetworkConfig.goerli());
}
@Test
public void noSeveralNetworkOptions() throws Exception {
parseCommand("--goerli", "--rinkeby");
verifyZeroInteractions(mockRunnerBuilder);
assertThat(commandOutput.toString()).isEmpty();
assertThat(commandErrorOutput.toString()).contains("Unable to connect to multiple networks");
}
@Test @Test
public void rinkebyValuesCanBeOverridden() throws Exception { public void rinkebyValuesCanBeOverridden() throws Exception {
networkValuesCanBeOverridden("rinkeby");
}
@Test
public void goerliValuesCanBeOverridden() throws Exception {
networkValuesCanBeOverridden("goerli");
}
private void networkValuesCanBeOverridden(final String network) throws Exception {
final String[] nodes = {"enode://001@123:4567", "enode://002@123:4567", "enode://003@123:4567"}; final String[] nodes = {"enode://001@123:4567", "enode://002@123:4567", "enode://003@123:4567"};
final Path genesisFile = createFakeGenesisFile(); final Path genesisFile = createFakeGenesisFile();
parseCommand( parseCommand(
"--rinkeby", "--" + network,
"--network-id", "--network-id",
"1", "1",
"--bootnodes", "--bootnodes",

Loading…
Cancel
Save