From 3f5de58ff347b5f19205b835e154b73dd67a8750 Mon Sep 17 00:00:00 2001 From: PhilippLgh Date: Thu, 16 Apr 2020 17:14:42 +0200 Subject: [PATCH 01/11] fix: mainnet bootnodes --- packages/common/src/chains/mainnet.json | 68 +++++++++++++++++-------- 1 file changed, 48 insertions(+), 20 deletions(-) diff --git a/packages/common/src/chains/mainnet.json b/packages/common/src/chains/mainnet.json index 2a60a7d567..06c36db2a8 100644 --- a/packages/common/src/chains/mainnet.json +++ b/packages/common/src/chains/mainnet.json @@ -77,32 +77,60 @@ ], "bootstrapNodes": [ { - "ip": "13.93.211.84", - "port": 30303, - "id": "3f1d12044546b76342d59d4a05532c14b85aa669704bfe1f864fe079415aa2c02d743e03218e57a33fb94523adb54032871a6c51b2cc5514cb7c7e35b3ed0a99", - "location": "US-WEST", - "comment": "Go Bootnode" + "ip": "18.138.108.67", + "port": "30303", + "id": "d860a01f9722d78051619d1e2351aba3f43f943f6f00718d1b9baa4101932a1f5011f16bb2b1bb35db20d6fe28fa0bf09636d26a87d31de9ec6203eeedb1f666", + "location": "ap-southeast-1-001", + "comment": "bootnode-aws-ap-southeast-1-001" }, { - "ip": "191.235.84.50", - "port": 30303, - "id": "78de8a0916848093c73790ead81d1928bec737d565119932b98c6b100d944b7a95e94f847f689fc723399d2e31129d182f7ef3863f2b4c820abbf3ab2722344d", - "location": "BR", - "comment": "Go Bootnode" + "ip": "3.209.45.79", + "port": "30303", + "id": "22a8232c3abc76a16ae9d6c3b164f98775fe226f0917b0ca871128a74a8e9630b458460865bab457221f1d448dd9791d24c4e5d88786180ac185df813a68d4de", + "location": "us-east-1-001", + "comment": "bootnode-aws-us-east-1-001" }, { - "ip": "13.75.154.138", - "port": 30303, - "id": "158f8aab45f6d19c6cbf4a089c2670541a8da11978a2f90dbf6a502a4a3bab80d288afdbeb7ec0ef6d92de563767f3b1ea9e8e334ca711e9f8e2df5a0385e8e6", - "location": "AU", - "comment": "Go Bootnode" + "ip": "34.255.23.113", + "port": "30303", + "id": "ca6de62fce278f96aea6ec5a2daadb877e51651247cb96ee310a318def462913b653963c155a0ef6c7d50048bba6e6cea881130857413d9f50a621546b590758", + "location": "eu-west-1-001", + "comment": "bootnode-aws-eu-west-1-001" }, { - "ip": "52.74.57.123", - "port": 30303, - "id": "1118980bf48b0a3640bdba04e0fe78b1add18e1cd99bf22d53daac1fd9972ad650df52176e7c7d89d1114cfef2bc23a2959aa54998a46afcf7d91809f0855082", - "location": "SG", - "comment": "Go Bootnode" + "ip": "35.158.244.151", + "port": "30303", + "id": "279944d8dcd428dffaa7436f25ca0ca43ae19e7bcf94a8fb7d1641651f92d121e972ac2e8f381414b80cc8e5555811c2ec6e1a99bb009b3f53c4c69923e11bd8", + "location": "eu-central-1-001", + "comment": "bootnode-aws-eu-central-1-001" + }, + { + "ip": "52.187.207.27", + "port": "30303", + "id": "8499da03c47d637b20eee24eec3c356c9a2e6148d6fe25ca195c7949ab8ec2c03e3556126b0d7ed644675e78c4318b08691b7b57de10e5f0d40d05b09238fa0a", + "location": "australiaeast-001", + "comment": "bootnode-azure-australiaeast-001" + }, + { + "ip": "191.234.162.198", + "port": "30303", + "id": "103858bdb88756c71f15e9b5e09b56dc1be52f0a5021d46301dbbfb7e130029cc9d0d6f73f693bc29b665770fff7da4d34f3c6379fe12721b5d7a0bcb5ca1fc1", + "location": "brazilsouth-001", + "comment": "bootnode-azure-brazilsouth-001" + }, + { + "ip": "52.231.165.108", + "port": "30303", + "id": "715171f50508aba88aecd1250af392a45a330af91d7b90701c436b618c86aaa1589c9184561907bebbb56439b8f8787bc01f49a7c77276c58c1b09822d75e8e8", + "location": "koreasouth-001", + "comment": "bootnode-azure-koreasouth-001" + }, + { + "ip": "104.42.217.25", + "port": "30303", + "id": "5d6d7cd20d6da4bb83a1d28cadb5d409b64edf314c0335df658c1a54e32c7c4a7ab7823d57c39b6a757556e68ff1df17c748b698544a55cb488b52479a92b60f", + "location": "westus-001", + "comment": "bootnode-azure-westus-001" } ] } From 83e1f9688c91421158d4558b01f7e16ca02e9baf Mon Sep 17 00:00:00 2001 From: PhilippLgh Date: Thu, 16 Apr 2020 17:52:44 +0200 Subject: [PATCH 02/11] fix: generalize failing test --- packages/common/tests/chains.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/common/tests/chains.ts b/packages/common/tests/chains.ts index 27a311ec9f..3cf861a547 100644 --- a/packages/common/tests/chains.ts +++ b/packages/common/tests/chains.ts @@ -59,8 +59,7 @@ tape('[Common]: Initialization / Chain params', function(t: tape.Test) { const hash = '0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3' st.equal(c.genesis().hash, hash, 'should return correct genesis hash') st.equal(c.hardforks()[3]['block'], 2463000, 'should return correct hardfork data') - st.equal(c.bootstrapNodes()[0].port, 30303, 'should return a bootstrap node array') - + st.true('port' in c.bootstrapNodes()[0], 'should return a bootstrap node array') st.end() }) From cef1f0d5ad4bc25b0c70b39474fc5ec49d96d73d Mon Sep 17 00:00:00 2001 From: PhilippLgh Date: Thu, 16 Apr 2020 17:57:17 +0200 Subject: [PATCH 03/11] fix: re-introduce typecheck in tests and fix json --- packages/common/src/chains/mainnet.json | 18 +++++++++--------- packages/common/tests/chains.ts | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/common/src/chains/mainnet.json b/packages/common/src/chains/mainnet.json index 06c36db2a8..b6cc03a034 100644 --- a/packages/common/src/chains/mainnet.json +++ b/packages/common/src/chains/mainnet.json @@ -78,59 +78,59 @@ "bootstrapNodes": [ { "ip": "18.138.108.67", - "port": "30303", + "port": 30303, "id": "d860a01f9722d78051619d1e2351aba3f43f943f6f00718d1b9baa4101932a1f5011f16bb2b1bb35db20d6fe28fa0bf09636d26a87d31de9ec6203eeedb1f666", "location": "ap-southeast-1-001", "comment": "bootnode-aws-ap-southeast-1-001" }, { "ip": "3.209.45.79", - "port": "30303", + "port": 30303, "id": "22a8232c3abc76a16ae9d6c3b164f98775fe226f0917b0ca871128a74a8e9630b458460865bab457221f1d448dd9791d24c4e5d88786180ac185df813a68d4de", "location": "us-east-1-001", "comment": "bootnode-aws-us-east-1-001" }, { "ip": "34.255.23.113", - "port": "30303", + "port": 30303, "id": "ca6de62fce278f96aea6ec5a2daadb877e51651247cb96ee310a318def462913b653963c155a0ef6c7d50048bba6e6cea881130857413d9f50a621546b590758", "location": "eu-west-1-001", "comment": "bootnode-aws-eu-west-1-001" }, { "ip": "35.158.244.151", - "port": "30303", + "port": 30303, "id": "279944d8dcd428dffaa7436f25ca0ca43ae19e7bcf94a8fb7d1641651f92d121e972ac2e8f381414b80cc8e5555811c2ec6e1a99bb009b3f53c4c69923e11bd8", "location": "eu-central-1-001", "comment": "bootnode-aws-eu-central-1-001" }, { "ip": "52.187.207.27", - "port": "30303", + "port": 30303, "id": "8499da03c47d637b20eee24eec3c356c9a2e6148d6fe25ca195c7949ab8ec2c03e3556126b0d7ed644675e78c4318b08691b7b57de10e5f0d40d05b09238fa0a", "location": "australiaeast-001", "comment": "bootnode-azure-australiaeast-001" }, { "ip": "191.234.162.198", - "port": "30303", + "port": 30303, "id": "103858bdb88756c71f15e9b5e09b56dc1be52f0a5021d46301dbbfb7e130029cc9d0d6f73f693bc29b665770fff7da4d34f3c6379fe12721b5d7a0bcb5ca1fc1", "location": "brazilsouth-001", "comment": "bootnode-azure-brazilsouth-001" }, { "ip": "52.231.165.108", - "port": "30303", + "port": 30303, "id": "715171f50508aba88aecd1250af392a45a330af91d7b90701c436b618c86aaa1589c9184561907bebbb56439b8f8787bc01f49a7c77276c58c1b09822d75e8e8", "location": "koreasouth-001", "comment": "bootnode-azure-koreasouth-001" }, { "ip": "104.42.217.25", - "port": "30303", + "port": 30303, "id": "5d6d7cd20d6da4bb83a1d28cadb5d409b64edf314c0335df658c1a54e32c7c4a7ab7823d57c39b6a757556e68ff1df17c748b698544a55cb488b52479a92b60f", "location": "westus-001", "comment": "bootnode-azure-westus-001" } ] -} +} \ No newline at end of file diff --git a/packages/common/tests/chains.ts b/packages/common/tests/chains.ts index 3cf861a547..e5e8f95434 100644 --- a/packages/common/tests/chains.ts +++ b/packages/common/tests/chains.ts @@ -59,7 +59,7 @@ tape('[Common]: Initialization / Chain params', function(t: tape.Test) { const hash = '0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3' st.equal(c.genesis().hash, hash, 'should return correct genesis hash') st.equal(c.hardforks()[3]['block'], 2463000, 'should return correct hardfork data') - st.true('port' in c.bootstrapNodes()[0], 'should return a bootstrap node array') + st.true(typeof c.bootstrapNodes()[0] === 'number', 'should return a bootstrap node array') st.end() }) From 77e99d96de7f34bbc27d039ca873e8ec468f1283 Mon Sep 17 00:00:00 2001 From: PhilippLgh Date: Thu, 16 Apr 2020 17:58:49 +0200 Subject: [PATCH 04/11] fix: linter error --- packages/common/src/chains/mainnet.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/common/src/chains/mainnet.json b/packages/common/src/chains/mainnet.json index b6cc03a034..10a88d4104 100644 --- a/packages/common/src/chains/mainnet.json +++ b/packages/common/src/chains/mainnet.json @@ -133,4 +133,4 @@ "comment": "bootnode-azure-westus-001" } ] -} \ No newline at end of file +} From a61b040619f145aa58ebda8e1541c2d5fe22453d Mon Sep 17 00:00:00 2001 From: PhilippLgh Date: Thu, 16 Apr 2020 18:06:04 +0200 Subject: [PATCH 05/11] fix: test --- packages/common/tests/chains.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/common/tests/chains.ts b/packages/common/tests/chains.ts index e5e8f95434..f8814383bd 100644 --- a/packages/common/tests/chains.ts +++ b/packages/common/tests/chains.ts @@ -59,7 +59,7 @@ tape('[Common]: Initialization / Chain params', function(t: tape.Test) { const hash = '0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3' st.equal(c.genesis().hash, hash, 'should return correct genesis hash') st.equal(c.hardforks()[3]['block'], 2463000, 'should return correct hardfork data') - st.true(typeof c.bootstrapNodes()[0] === 'number', 'should return a bootstrap node array') + st.equal(typeof c.bootstrapNodes()[0].port, 'number', 'should return a bootstrap node array') st.end() }) From c429370f3d746ae8ee23a4dc7085bbb52ea24b29 Mon Sep 17 00:00:00 2001 From: PhilippLgh Date: Thu, 16 Apr 2020 18:27:11 +0200 Subject: [PATCH 06/11] fix: update goerli, rinkeby, ropsten --- packages/common/src/chains/goerli.json | 37 ++++++------------------- packages/common/src/chains/rinkeby.json | 11 ++++++-- packages/common/src/chains/ropsten.json | 24 ++++++---------- 3 files changed, 25 insertions(+), 47 deletions(-) diff --git a/packages/common/src/chains/goerli.json b/packages/common/src/chains/goerli.json index 121d135e93..948a7af19b 100644 --- a/packages/common/src/chains/goerli.json +++ b/packages/common/src/chains/goerli.json @@ -71,39 +71,18 @@ ], "bootstrapNodes": [ { - "ip": "51.141.78.53", - "port": 30303, - "id": "011f758e6552d105183b1761c5e2dea0111bc20fd5f6422bc7f91e0fabbec9a6595caf6239b37feb773dddd3f87240d99d859431891e4a642cf2a0a9e6cbb98a", - "location": "", - "comment": "Source: https://github.com/goerli/testnet/blob/master/bootnodes.txt" - }, - { - "ip": "13.93.54.137", - "port": 30303, - "id": "176b9417f511d05b6b2cf3e34b756cf0a7096b3094572a8f6ef4cdcb9d1f9d00683bf0f83347eebdf3b81c3521c2332086d9592802230bf528eaf606a1d9677b", - "location": "", - "comment": "Source: https://github.com/goerli/testnet/blob/master/bootnodes.txt" - }, - { - "ip": "94.237.54.114", - "port": 30313, - "id": "46add44b9f13965f7b9875ac6b85f016f341012d84f975377573800a863526f4da19ae2c620ec73d11591fa9510e992ecc03ad0751f53cc02f7c7ed6d55c7291", - "location": "", - "comment": "Source: https://github.com/goerli/testnet/blob/master/bootnodes.txt" - }, - { - "ip": "52.64.155.147", + "ip": "213.186.16.82", "port": 30303, - "id": "c1f8b7c2ac4453271fa07d8e9ecf9a2e8285aa0bd0c07df0131f47153306b0736fd3db8924e7a9bf0bed6b1d8d4f87362a71b033dc7c64547728d953e43e59b2", - "location": "", - "comment": "Source: https://github.com/goerli/testnet/blob/master/bootnodes.txt" + "id": "f4a9c6ee28586009fb5a96c8af13a58ed6d8315a9eee4772212c1d4d9cebe5a8b8a78ea4434f318726317d04a3f531a1ef0420cf9752605a562cfe858c46e263", + "location": "Upstream bootnode", + "comment": "Upstream bootnode" }, { - "ip": "213.186.16.82", + "ip": "3.11.147.67", "port": 30303, - "id": "f4a9c6ee28586009fb5a96c8af13a58ed6d8315a9eee4772212c1d4d9cebe5a8b8a78ea4434f318726317d04a3f531a1ef0420cf9752605a562cfe858c46e263", - "location": "", - "comment": "Source: https://github.com/goerli/testnet/blob/master/bootnodes.txt" + "id": "a61215641fb8714a373c80edbfa0ea8878243193f57c96eeb44d0bc019ef295abd4e044fd619bfc4c59731a73fb79afe84e9ab6da0c743ceb479cbb6d263fa91", + "location": "Ethereum Foundation bootnode", + "comment": "Ethereum Foundation bootnode" } ] } diff --git a/packages/common/src/chains/rinkeby.json b/packages/common/src/chains/rinkeby.json index 8461e5911a..8ba981ad2e 100644 --- a/packages/common/src/chains/rinkeby.json +++ b/packages/common/src/chains/rinkeby.json @@ -75,14 +75,21 @@ "port": 30303, "id": "a24ac7c5484ef4ed0c5eb2d36620ba4e4aa13b8c84684e1b4aab0cebea2ae45cb4d375b77eab56516d34bfbd3c1a833fc51296ff084b770b94fb9028c4d25ccf", "location": "IE", - "comment": "" + "comment": "IE" }, { "ip": "52.3.158.184", "port": 30303, "id": "343149e4feefa15d882d9fe4ac7d88f885bd05ebb735e547f12e12080a9fa07c8014ca6fd7f373123488102fe5e34111f8509cf0b7de3f5b44339c9f25e87cb8", - "location": "", + "location": "INFURA", "comment": "INFURA" + }, + { + "ip": "159.89.28.211", + "port": 30303, + "id": "b6b28890b006743680c52e64e0d16db57f28124885595fa03a562be1d2bf0f3a1da297d56b13da25fb992888fd556d4c1a27b1f39d531bde7de1921c90061cc6", + "location": "AKASHA", + "comment": "AKASHA" } ] } diff --git a/packages/common/src/chains/ropsten.json b/packages/common/src/chains/ropsten.json index 6a2ab169ba..6110a540f2 100644 --- a/packages/common/src/chains/ropsten.json +++ b/packages/common/src/chains/ropsten.json @@ -78,38 +78,30 @@ "bootstrapNodes": [ { "ip": "52.176.7.10", - "port": "30303", + "port": 30303, "id": "30b7ab30a01c124a6cceca36863ece12c4f5fa68e3ba9b0b51407ccc002eeed3b3102d20a88f1c1d3c3154e2449317b8ef95090e77b312d5cc39354f86d5d606", - "network": "Ropsten", - "chainId": 3, - "location": "US", + "location": "US-Azure geth", "comment": "US-Azure geth" }, { "ip": "52.176.100.77", - "port": "30303", + "port": 30303, "id": "865a63255b3bb68023b6bffd5095118fcc13e79dcf014fe4e47e065c350c7cc72af2e53eff895f11ba1bbb6a2b33271c1116ee870f266618eadfc2e78aa7349c", - "network": "Ropsten", - "chainId": 3, - "location": "US", + "location": "US-Azure parity", "comment": "US-Azure parity" }, { "ip": "52.232.243.152", - "port": "30303", + "port": 30303, "id": "6332792c4a00e3e4ee0926ed89e0d27ef985424d97b6a45bf0f23e51f0dcb5e66b875777506458aea7af6f9e4ffb69f43f3778ee73c81ed9d34c51c4b16b0b0f", - "network": "Ropsten", - "chainId": 3, - "location": "US", + "location": "Parity", "comment": "Parity" }, { "ip": "192.81.208.223", - "port": "30303", + "port": 30303, "id": "94c15d1b9e2fe7ce56e458b9a3b672ef11894ddedd0c6f247e0f1d3487f52b66208fb4aeb8179fce6e3a749ea93ed147c37976d67af557508d199d9594c35f09", - "network": "Ropsten", - "chainId": 3, - "location": "US", + "location": "@gpip", "comment": "@gpip" } ] From 814c2668caff3b563a6a07dc14fdd062f4cd4cde Mon Sep 17 00:00:00 2001 From: PhilippLgh Date: Thu, 16 Apr 2020 18:27:33 +0200 Subject: [PATCH 07/11] chore: add update script --- packages/common/scripts/update-bootnodes.js | 96 +++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 packages/common/scripts/update-bootnodes.js diff --git a/packages/common/scripts/update-bootnodes.js b/packages/common/scripts/update-bootnodes.js new file mode 100644 index 0000000000..fce6929813 --- /dev/null +++ b/packages/common/scripts/update-bootnodes.js @@ -0,0 +1,96 @@ +const fs = require('fs') + +// https://github.com/ethereum/go-ethereum/blob/master/params/bootnodes.go +const bootnodes = { + // MainnetBootnodes are the enode URLs of the P2P bootstrap nodes running on + // the main Ethereum network. + MainnetBootnodes: { + 'bootnode-aws-ap-southeast-1-001': "enode://d860a01f9722d78051619d1e2351aba3f43f943f6f00718d1b9baa4101932a1f5011f16bb2b1bb35db20d6fe28fa0bf09636d26a87d31de9ec6203eeedb1f666@18.138.108.67:30303", + 'bootnode-aws-us-east-1-001': "enode://22a8232c3abc76a16ae9d6c3b164f98775fe226f0917b0ca871128a74a8e9630b458460865bab457221f1d448dd9791d24c4e5d88786180ac185df813a68d4de@3.209.45.79:30303", + 'bootnode-aws-eu-west-1-001': "enode://ca6de62fce278f96aea6ec5a2daadb877e51651247cb96ee310a318def462913b653963c155a0ef6c7d50048bba6e6cea881130857413d9f50a621546b590758@34.255.23.113:30303", + 'bootnode-aws-eu-central-1-001': "enode://279944d8dcd428dffaa7436f25ca0ca43ae19e7bcf94a8fb7d1641651f92d121e972ac2e8f381414b80cc8e5555811c2ec6e1a99bb009b3f53c4c69923e11bd8@35.158.244.151:30303", + 'bootnode-azure-australiaeast-001': "enode://8499da03c47d637b20eee24eec3c356c9a2e6148d6fe25ca195c7949ab8ec2c03e3556126b0d7ed644675e78c4318b08691b7b57de10e5f0d40d05b09238fa0a@52.187.207.27:30303", + 'bootnode-azure-brazilsouth-001': "enode://103858bdb88756c71f15e9b5e09b56dc1be52f0a5021d46301dbbfb7e130029cc9d0d6f73f693bc29b665770fff7da4d34f3c6379fe12721b5d7a0bcb5ca1fc1@191.234.162.198:30303", + 'bootnode-azure-koreasouth-001': "enode://715171f50508aba88aecd1250af392a45a330af91d7b90701c436b618c86aaa1589c9184561907bebbb56439b8f8787bc01f49a7c77276c58c1b09822d75e8e8@52.231.165.108:30303", + 'bootnode-azure-westus-001': "enode://5d6d7cd20d6da4bb83a1d28cadb5d409b64edf314c0335df658c1a54e32c7c4a7ab7823d57c39b6a757556e68ff1df17c748b698544a55cb488b52479a92b60f@104.42.217.25:30303", + } + // RopstenBootnodes are the enode URLs of the P2P bootstrap nodes running on the + // Ropsten test network. + , RopstenBootnodes: { + 'US-Azure geth': "enode://30b7ab30a01c124a6cceca36863ece12c4f5fa68e3ba9b0b51407ccc002eeed3b3102d20a88f1c1d3c3154e2449317b8ef95090e77b312d5cc39354f86d5d606@52.176.7.10:30303", // + 'US-Azure parity': "enode://865a63255b3bb68023b6bffd5095118fcc13e79dcf014fe4e47e065c350c7cc72af2e53eff895f11ba1bbb6a2b33271c1116ee870f266618eadfc2e78aa7349c@52.176.100.77:30303", // + 'Parity': "enode://6332792c4a00e3e4ee0926ed89e0d27ef985424d97b6a45bf0f23e51f0dcb5e66b875777506458aea7af6f9e4ffb69f43f3778ee73c81ed9d34c51c4b16b0b0f@52.232.243.152:30303", // + '@gpip': "enode://94c15d1b9e2fe7ce56e458b9a3b672ef11894ddedd0c6f247e0f1d3487f52b66208fb4aeb8179fce6e3a749ea93ed147c37976d67af557508d199d9594c35f09@192.81.208.223:30303", // + } + + // RinkebyBootnodes are the enode URLs of the P2P bootstrap nodes running on the + // Rinkeby test network. + , RinkebyBootnodes: { + 'IE': "enode://a24ac7c5484ef4ed0c5eb2d36620ba4e4aa13b8c84684e1b4aab0cebea2ae45cb4d375b77eab56516d34bfbd3c1a833fc51296ff084b770b94fb9028c4d25ccf@52.169.42.101:30303", // + 'INFURA': "enode://343149e4feefa15d882d9fe4ac7d88f885bd05ebb735e547f12e12080a9fa07c8014ca6fd7f373123488102fe5e34111f8509cf0b7de3f5b44339c9f25e87cb8@52.3.158.184:30303", // + 'AKASHA': "enode://b6b28890b006743680c52e64e0d16db57f28124885595fa03a562be1d2bf0f3a1da297d56b13da25fb992888fd556d4c1a27b1f39d531bde7de1921c90061cc6@159.89.28.211:30303", // + } + + // GoerliBootnodes are the enode URLs of the P2P bootstrap nodes running on the + // Görli test network. + , GoerliBootnodes: { + // Upstream bootnodes + 'Upstream bootnode': "enode://011f758e6552d105183b1761c5e2dea0111bc20fd5f6422bc7f91e0fabbec9a6595caf6239b37feb773dddd3f87240d99d859431891e4a642cf2a0a9e6cbb98a@51.141.78.53:30303", + 'Upstream bootnode': "enode://176b9417f511d05b6b2cf3e34b756cf0a7096b3094572a8f6ef4cdcb9d1f9d00683bf0f83347eebdf3b81c3521c2332086d9592802230bf528eaf606a1d9677b@13.93.54.137:30303", + 'Upstream bootnode': "enode://46add44b9f13965f7b9875ac6b85f016f341012d84f975377573800a863526f4da19ae2c620ec73d11591fa9510e992ecc03ad0751f53cc02f7c7ed6d55c7291@94.237.54.114:30313", + 'Upstream bootnode': "enode://c1f8b7c2ac4453271fa07d8e9ecf9a2e8285aa0bd0c07df0131f47153306b0736fd3db8924e7a9bf0bed6b1d8d4f87362a71b033dc7c64547728d953e43e59b2@52.64.155.147:30303", + 'Upstream bootnode': "enode://f4a9c6ee28586009fb5a96c8af13a58ed6d8315a9eee4772212c1d4d9cebe5a8b8a78ea4434f318726317d04a3f531a1ef0420cf9752605a562cfe858c46e263@213.186.16.82:30303", + + // Ethereum Foundation bootnode + 'Ethereum Foundation bootnode': "enode://a61215641fb8714a373c80edbfa0ea8878243193f57c96eeb44d0bc019ef295abd4e044fd619bfc4c59731a73fb79afe84e9ab6da0c743ceb479cbb6d263fa91@3.11.147.67:30303", + } +} + + +/* +parse string and generate: +{ + "ip": "52.74.57.123", + "port": 30303, + "id": "1118980bf48b0a3640bdba04e0fe78b1add18e1cd99bf22d53daac1fd9972ad650df52176e7c7d89d1114cfef2bc23a2959aa54998a46afcf7d91809f0855082", + "location": "SG", + "comment": "Go Bootnode" +} +*/ +const generateJson = (bootnodes) => { + const nodes = [] + for (const b in bootnodes) { + let enode = bootnodes[b] + enode = enode.replace('enode://', '') + const [id, rest] = enode.split('@') + const [ip, port] = rest.split(':') + const node = { + ip, + port: parseInt(port), + id, + location: b.replace('bootnode-aws-', '').replace('bootnode-azure-', ''), + comment: b + } + console.log('node', node) + nodes.push(node) + } + return nodes +} + +const nameToJsonFile = { + MainnetBootnodes: 'mainnet', + RopstenBootnodes: 'ropsten', + RinkebyBootnodes: 'rinkeby', + GoerliBootnodes: 'goerli', +} + +for (let configName in bootnodes) { + console.log('process ', configName) + const fileName = nameToJsonFile[configName] + const filePath = `./src/chains/${fileName}.json` + const _newConfig = JSON.parse(fs.readFileSync(filePath)) + _newConfig.bootstrapNodes = generateJson(bootnodes[configName]) + fs.writeFileSync(filePath, `${JSON.stringify(_newConfig, null, 2)}\n`) +} + + From 88cc234140e7f174b2bd242f0a32a25ddc807ad4 Mon Sep 17 00:00:00 2001 From: PhilippLgh Date: Thu, 16 Apr 2020 18:42:19 +0200 Subject: [PATCH 08/11] fix: update script --- packages/common/scripts/update-bootnodes.js | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/packages/common/scripts/update-bootnodes.js b/packages/common/scripts/update-bootnodes.js index fce6929813..6f49156c0d 100644 --- a/packages/common/scripts/update-bootnodes.js +++ b/packages/common/scripts/update-bootnodes.js @@ -35,15 +35,23 @@ const bootnodes = { // Görli test network. , GoerliBootnodes: { // Upstream bootnodes - 'Upstream bootnode': "enode://011f758e6552d105183b1761c5e2dea0111bc20fd5f6422bc7f91e0fabbec9a6595caf6239b37feb773dddd3f87240d99d859431891e4a642cf2a0a9e6cbb98a@51.141.78.53:30303", - 'Upstream bootnode': "enode://176b9417f511d05b6b2cf3e34b756cf0a7096b3094572a8f6ef4cdcb9d1f9d00683bf0f83347eebdf3b81c3521c2332086d9592802230bf528eaf606a1d9677b@13.93.54.137:30303", - 'Upstream bootnode': "enode://46add44b9f13965f7b9875ac6b85f016f341012d84f975377573800a863526f4da19ae2c620ec73d11591fa9510e992ecc03ad0751f53cc02f7c7ed6d55c7291@94.237.54.114:30313", - 'Upstream bootnode': "enode://c1f8b7c2ac4453271fa07d8e9ecf9a2e8285aa0bd0c07df0131f47153306b0736fd3db8924e7a9bf0bed6b1d8d4f87362a71b033dc7c64547728d953e43e59b2@52.64.155.147:30303", - 'Upstream bootnode': "enode://f4a9c6ee28586009fb5a96c8af13a58ed6d8315a9eee4772212c1d4d9cebe5a8b8a78ea4434f318726317d04a3f531a1ef0420cf9752605a562cfe858c46e263@213.186.16.82:30303", + 'Upstream bootnode 1': "enode://011f758e6552d105183b1761c5e2dea0111bc20fd5f6422bc7f91e0fabbec9a6595caf6239b37feb773dddd3f87240d99d859431891e4a642cf2a0a9e6cbb98a@51.141.78.53:30303", + 'Upstream bootnode 2': "enode://176b9417f511d05b6b2cf3e34b756cf0a7096b3094572a8f6ef4cdcb9d1f9d00683bf0f83347eebdf3b81c3521c2332086d9592802230bf528eaf606a1d9677b@13.93.54.137:30303", + 'Upstream bootnode 3': "enode://46add44b9f13965f7b9875ac6b85f016f341012d84f975377573800a863526f4da19ae2c620ec73d11591fa9510e992ecc03ad0751f53cc02f7c7ed6d55c7291@94.237.54.114:30313", + 'Upstream bootnode 4': "enode://c1f8b7c2ac4453271fa07d8e9ecf9a2e8285aa0bd0c07df0131f47153306b0736fd3db8924e7a9bf0bed6b1d8d4f87362a71b033dc7c64547728d953e43e59b2@52.64.155.147:30303", + 'Upstream bootnode 5': "enode://f4a9c6ee28586009fb5a96c8af13a58ed6d8315a9eee4772212c1d4d9cebe5a8b8a78ea4434f318726317d04a3f531a1ef0420cf9752605a562cfe858c46e263@213.186.16.82:30303", // Ethereum Foundation bootnode 'Ethereum Foundation bootnode': "enode://a61215641fb8714a373c80edbfa0ea8878243193f57c96eeb44d0bc019ef295abd4e044fd619bfc4c59731a73fb79afe84e9ab6da0c743ceb479cbb6d263fa91@3.11.147.67:30303", } + + // https://github.com/openethereum/openethereum/blob/1840102edd672a7c79a40a34d4e4c7684e670de7/ethcore/res/ethereum/kovan.json#L6784 + ,KovanBootnodes: { + '1': "enode://16898006ba2cd4fa8bf9a3dfe32684c178fa861df144bfc21fe800dc4838a03e342056951fa9fd533dcb0be1219e306106442ff2cf1f7e9f8faa5f2fc1a3aa45@116.203.116.241:30303", + '2': "enode://2909846f78c37510cc0e306f185323b83bb2209e5ff4fdd279d93c60e3f365e3c6e62ad1d2133ff11f9fd6d23ad9c3dad73bb974d53a22f7d1ac5b7dea79d0b0@3.217.96.11:30303", + '3': "enode://740e1c8ea64e71762c71a463a04e2046070a0c9394fcab5891d41301dc473c0cff00ebab5a9bc87fbcb610ab98ac18225ff897bc8b7b38def5975d5ceb0a7d7c@108.61.170.124:30303", + '4': "enode://2909846f78c37510cc0e306f185323b83bb2209e5ff4fdd279d93c60e3f365e3c6e62ad1d2133ff11f9fd6d23ad9c3dad73bb974d53a22f7d1ac5b7dea79d0b0@157.230.31.163:30303" + } } @@ -68,7 +76,7 @@ const generateJson = (bootnodes) => { ip, port: parseInt(port), id, - location: b.replace('bootnode-aws-', '').replace('bootnode-azure-', ''), + location: (b.includes('-aws-') || b.includes('-azure-')) ? b.replace('bootnode-aws-', '').replace('bootnode-azure-', '') : '', comment: b } console.log('node', node) @@ -82,6 +90,7 @@ const nameToJsonFile = { RopstenBootnodes: 'ropsten', RinkebyBootnodes: 'rinkeby', GoerliBootnodes: 'goerli', + KovanBootnodes: 'kovan', } for (let configName in bootnodes) { From 1e8a8ee16007ba5b86d0ae5ef5311252049488a7 Mon Sep 17 00:00:00 2001 From: PhilippLgh Date: Thu, 16 Apr 2020 18:42:45 +0200 Subject: [PATCH 09/11] fix: update nodes --- packages/common/src/chains/goerli.json | 34 ++++++++++++++++++++++--- packages/common/src/chains/kovan.json | 31 +++++++++------------- packages/common/src/chains/rinkeby.json | 6 ++--- packages/common/src/chains/ropsten.json | 8 +++--- 4 files changed, 50 insertions(+), 29 deletions(-) diff --git a/packages/common/src/chains/goerli.json b/packages/common/src/chains/goerli.json index 948a7af19b..cd194e43b7 100644 --- a/packages/common/src/chains/goerli.json +++ b/packages/common/src/chains/goerli.json @@ -70,18 +70,46 @@ } ], "bootstrapNodes": [ + { + "ip": "51.141.78.53", + "port": 30303, + "id": "011f758e6552d105183b1761c5e2dea0111bc20fd5f6422bc7f91e0fabbec9a6595caf6239b37feb773dddd3f87240d99d859431891e4a642cf2a0a9e6cbb98a", + "location": "", + "comment": "Upstream bootnode 1" + }, + { + "ip": "13.93.54.137", + "port": 30303, + "id": "176b9417f511d05b6b2cf3e34b756cf0a7096b3094572a8f6ef4cdcb9d1f9d00683bf0f83347eebdf3b81c3521c2332086d9592802230bf528eaf606a1d9677b", + "location": "", + "comment": "Upstream bootnode 2" + }, + { + "ip": "94.237.54.114", + "port": 30313, + "id": "46add44b9f13965f7b9875ac6b85f016f341012d84f975377573800a863526f4da19ae2c620ec73d11591fa9510e992ecc03ad0751f53cc02f7c7ed6d55c7291", + "location": "", + "comment": "Upstream bootnode 3" + }, + { + "ip": "52.64.155.147", + "port": 30303, + "id": "c1f8b7c2ac4453271fa07d8e9ecf9a2e8285aa0bd0c07df0131f47153306b0736fd3db8924e7a9bf0bed6b1d8d4f87362a71b033dc7c64547728d953e43e59b2", + "location": "", + "comment": "Upstream bootnode 4" + }, { "ip": "213.186.16.82", "port": 30303, "id": "f4a9c6ee28586009fb5a96c8af13a58ed6d8315a9eee4772212c1d4d9cebe5a8b8a78ea4434f318726317d04a3f531a1ef0420cf9752605a562cfe858c46e263", - "location": "Upstream bootnode", - "comment": "Upstream bootnode" + "location": "", + "comment": "Upstream bootnode 5" }, { "ip": "3.11.147.67", "port": 30303, "id": "a61215641fb8714a373c80edbfa0ea8878243193f57c96eeb44d0bc019ef295abd4e044fd619bfc4c59731a73fb79afe84e9ab6da0c743ceb479cbb6d263fa91", - "location": "Ethereum Foundation bootnode", + "location": "", "comment": "Ethereum Foundation bootnode" } ] diff --git a/packages/common/src/chains/kovan.json b/packages/common/src/chains/kovan.json index abaea03bc0..953ed37196 100644 --- a/packages/common/src/chains/kovan.json +++ b/packages/common/src/chains/kovan.json @@ -71,39 +71,32 @@ ], "bootstrapNodes": [ { - "ip": "40.71.221.215", + "ip": "116.203.116.241", "port": 30303, - "id": "56abaf065581a5985b8c5f4f88bd202526482761ba10be9bfdcd14846dd01f652ec33fde0f8c0fd1db19b59a4c04465681fcef50e11380ca88d25996191c52de", + "id": "16898006ba2cd4fa8bf9a3dfe32684c178fa861df144bfc21fe800dc4838a03e342056951fa9fd533dcb0be1219e306106442ff2cf1f7e9f8faa5f2fc1a3aa45", "location": "", - "comment": "Parity Bootnode" + "comment": "1" }, { - "ip": "52.166.117.77", + "ip": "3.217.96.11", "port": 30303, - "id": "d07827483dc47b368eaf88454fb04b41b7452cf454e194e2bd4c14f98a3278fed5d819dbecd0d010407fc7688d941ee1e58d4f9c6354d3da3be92f55c17d7ce3", + "id": "2909846f78c37510cc0e306f185323b83bb2209e5ff4fdd279d93c60e3f365e3c6e62ad1d2133ff11f9fd6d23ad9c3dad73bb974d53a22f7d1ac5b7dea79d0b0", "location": "", - "comment": "Parity Bootnode" + "comment": "2" }, { - "ip": "52.165.239.18", + "ip": "108.61.170.124", "port": 30303, - "id": "8fa162563a8e5a05eef3e1cd5abc5828c71344f7277bb788a395cce4a0e30baf2b34b92fe0b2dbbba2313ee40236bae2aab3c9811941b9f5a7e8e90aaa27ecba", + "id": "740e1c8ea64e71762c71a463a04e2046070a0c9394fcab5891d41301dc473c0cff00ebab5a9bc87fbcb610ab98ac18225ff897bc8b7b38def5975d5ceb0a7d7c", "location": "", - "comment": "Parity Bootnode" + "comment": "3" }, { - "ip": "52.243.47.56", + "ip": "157.230.31.163", "port": 30303, - "id": "7e2e7f00784f516939f94e22bdc6cf96153603ca2b5df1c7cc0f90a38e7a2f218ffb1c05b156835e8b49086d11fdd1b3e2965be16baa55204167aa9bf536a4d9", + "id": "2909846f78c37510cc0e306f185323b83bb2209e5ff4fdd279d93c60e3f365e3c6e62ad1d2133ff11f9fd6d23ad9c3dad73bb974d53a22f7d1ac5b7dea79d0b0", "location": "", - "comment": "Parity Bootnode" - }, - { - "ip": "40.68.248.100", - "port": 30303, - "id": "0518a3d35d4a7b3e8c433e7ffd2355d84a1304ceb5ef349787b556197f0c87fad09daed760635b97d52179d645d3e6d16a37d2cc0a9945c2ddf585684beb39ac", - "location": "", - "comment": "Parity Bootnode" + "comment": "4" } ] } diff --git a/packages/common/src/chains/rinkeby.json b/packages/common/src/chains/rinkeby.json index 8ba981ad2e..5b357ddc9f 100644 --- a/packages/common/src/chains/rinkeby.json +++ b/packages/common/src/chains/rinkeby.json @@ -74,21 +74,21 @@ "ip": "52.169.42.101", "port": 30303, "id": "a24ac7c5484ef4ed0c5eb2d36620ba4e4aa13b8c84684e1b4aab0cebea2ae45cb4d375b77eab56516d34bfbd3c1a833fc51296ff084b770b94fb9028c4d25ccf", - "location": "IE", + "location": "", "comment": "IE" }, { "ip": "52.3.158.184", "port": 30303, "id": "343149e4feefa15d882d9fe4ac7d88f885bd05ebb735e547f12e12080a9fa07c8014ca6fd7f373123488102fe5e34111f8509cf0b7de3f5b44339c9f25e87cb8", - "location": "INFURA", + "location": "", "comment": "INFURA" }, { "ip": "159.89.28.211", "port": 30303, "id": "b6b28890b006743680c52e64e0d16db57f28124885595fa03a562be1d2bf0f3a1da297d56b13da25fb992888fd556d4c1a27b1f39d531bde7de1921c90061cc6", - "location": "AKASHA", + "location": "", "comment": "AKASHA" } ] diff --git a/packages/common/src/chains/ropsten.json b/packages/common/src/chains/ropsten.json index 6110a540f2..e82becf92d 100644 --- a/packages/common/src/chains/ropsten.json +++ b/packages/common/src/chains/ropsten.json @@ -80,28 +80,28 @@ "ip": "52.176.7.10", "port": 30303, "id": "30b7ab30a01c124a6cceca36863ece12c4f5fa68e3ba9b0b51407ccc002eeed3b3102d20a88f1c1d3c3154e2449317b8ef95090e77b312d5cc39354f86d5d606", - "location": "US-Azure geth", + "location": "", "comment": "US-Azure geth" }, { "ip": "52.176.100.77", "port": 30303, "id": "865a63255b3bb68023b6bffd5095118fcc13e79dcf014fe4e47e065c350c7cc72af2e53eff895f11ba1bbb6a2b33271c1116ee870f266618eadfc2e78aa7349c", - "location": "US-Azure parity", + "location": "", "comment": "US-Azure parity" }, { "ip": "52.232.243.152", "port": 30303, "id": "6332792c4a00e3e4ee0926ed89e0d27ef985424d97b6a45bf0f23e51f0dcb5e66b875777506458aea7af6f9e4ffb69f43f3778ee73c81ed9d34c51c4b16b0b0f", - "location": "Parity", + "location": "", "comment": "Parity" }, { "ip": "192.81.208.223", "port": 30303, "id": "94c15d1b9e2fe7ce56e458b9a3b672ef11894ddedd0c6f247e0f1d3487f52b66208fb4aeb8179fce6e3a749ea93ed147c37976d67af557508d199d9594c35f09", - "location": "@gpip", + "location": "", "comment": "@gpip" } ] From 0849d48738c7b509ec1904c5f7a7de3bd2836d15 Mon Sep 17 00:00:00 2001 From: PhilippLgh Date: Thu, 16 Apr 2020 18:55:51 +0200 Subject: [PATCH 10/11] chore: fix link --- packages/common/scripts/update-bootnodes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/common/scripts/update-bootnodes.js b/packages/common/scripts/update-bootnodes.js index 6f49156c0d..d6786ca86c 100644 --- a/packages/common/scripts/update-bootnodes.js +++ b/packages/common/scripts/update-bootnodes.js @@ -45,7 +45,7 @@ const bootnodes = { 'Ethereum Foundation bootnode': "enode://a61215641fb8714a373c80edbfa0ea8878243193f57c96eeb44d0bc019ef295abd4e044fd619bfc4c59731a73fb79afe84e9ab6da0c743ceb479cbb6d263fa91@3.11.147.67:30303", } - // https://github.com/openethereum/openethereum/blob/1840102edd672a7c79a40a34d4e4c7684e670de7/ethcore/res/ethereum/kovan.json#L6784 + // https://github.com/openethereum/openethereum/blob/master/ethcore/res/ethereum/kovan.json#L6783 ,KovanBootnodes: { '1': "enode://16898006ba2cd4fa8bf9a3dfe32684c178fa861df144bfc21fe800dc4838a03e342056951fa9fd533dcb0be1219e306106442ff2cf1f7e9f8faa5f2fc1a3aa45@116.203.116.241:30303", '2': "enode://2909846f78c37510cc0e306f185323b83bb2209e5ff4fdd279d93c60e3f365e3c6e62ad1d2133ff11f9fd6d23ad9c3dad73bb974d53a22f7d1ac5b7dea79d0b0@3.217.96.11:30303", From 8a038464769798d6bb2cbeb84edbea94653e0757 Mon Sep 17 00:00:00 2001 From: PhilippLgh Date: Fri, 17 Apr 2020 15:30:42 +0200 Subject: [PATCH 11/11] chore: add test for bootnode structure --- packages/common/tests/chains.ts | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/packages/common/tests/chains.ts b/packages/common/tests/chains.ts index f8814383bd..f8d7957b63 100644 --- a/packages/common/tests/chains.ts +++ b/packages/common/tests/chains.ts @@ -59,7 +59,29 @@ tape('[Common]: Initialization / Chain params', function(t: tape.Test) { const hash = '0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3' st.equal(c.genesis().hash, hash, 'should return correct genesis hash') st.equal(c.hardforks()[3]['block'], 2463000, 'should return correct hardfork data') - st.equal(typeof c.bootstrapNodes()[0].port, 'number', 'should return a bootstrap node array') + st.equal(typeof c.bootstrapNodes()[0].port, 'number', 'should return a port as number') + st.end() + }) + + t.test('Should provide the bootnode information in a uniform way', function(st: tape.Test) { + const configs = ['mainnet', 'ropsten', 'rinkeby', 'goerli'] + for (const network of configs) { + const c = new Common(network) + const bootnode = c.bootstrapNodes()[0] + st.equal(typeof bootnode.ip, 'string', 'returns the ip as string') + st.equal(typeof bootnode.port, 'number', 'returns the port as number') + st.equal(typeof bootnode.id, 'string', 'returns the id as string') + st.equal( + typeof bootnode.location, + 'string', + 'returns the location as string (empty string if unavailable)', + ) + st.equal( + typeof bootnode.comment, + 'string', + 'returns a comment as string (empty string if unavailable)', + ) + } st.end() })