From 47d73c02ddf68eb45c40a85320ec52c7ab62b8bf Mon Sep 17 00:00:00 2001 From: Shane Bammel Date: Wed, 8 Mar 2023 16:20:05 -0600 Subject: [PATCH] Add bootnodes and dns config for testnet-v3 --- cmd/utils/flags.go | 2 +- params/bootnodes.go | 27 +++++++++++++++++++++------ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index b965e678d..775face97 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -1890,7 +1890,7 @@ func SetDNSDiscoveryDefaults(cfg *ethconfig.Config, genesis common.Hash) { return // already set through flags/config } protocol := "all" - if url := params.KnownDNSNetwork(genesis, protocol); url != "" { + if url := params.KnownDNSNetwork(genesis, cfg.NetworkId, protocol); url != "" { cfg.EthDiscoveryURLs = []string{url} cfg.SnapDiscoveryURLs = cfg.EthDiscoveryURLs } diff --git a/params/bootnodes.go b/params/bootnodes.go index ad86d8078..aac48f1a2 100644 --- a/params/bootnodes.go +++ b/params/bootnodes.go @@ -42,7 +42,11 @@ var PulseChainBootnodes []string // TODO // PulseChainTestnetBootnodes are the enode URLs of the P2P bootstrap nodes running on // the main PulseChain network. -var PulseChainTestnetBootnodes []string // TODO +var PulseChainTestnetBootnodes = []string{ + "enode://5942169e5173992b2bab93e36bb2773e82b0fe91f2e70239a48232e85da6023673e2fab608f5b7fad4b8dcd2a29c4f2a6f800522aa00262a1b371fb80c7ec620@3.236.202.85:30303", // bootnode-aws-us-east-1-001 + "enode://fa1420f97362e6c3e86dfcd38c3877748860b51c021de2662e46daf007d6de22c7668a838c9bf3468496fd10c2374544d16911dd2e2554aef7981e2858349952@44.202.85.131:30303", // bootnode-aws-us-east-1-002 + "enode://eee9a1665c202b7fec55be2a5c1106b283f5694a426d727215d3cb0287074d3c72bc7943282b2492b0d39246daad28032d09a2adbeddd43a3e7d4da0e40fd840@174.129.96.223:30303", // bootnode-aws-us-east-1-003 +} // SepoliaBootnodes are the enode URLs of the P2P bootstrap nodes running on the // Sepolia test network. @@ -95,16 +99,27 @@ var V5Bootnodes = []string{ "enr:-LK4QKWrXTpV9T78hNG6s8AM6IO4XH9kFT91uZtFg1GcsJ6dKovDOr1jtAAFPnS2lvNltkOGA9k29BUN7lFh_sjuc9QBh2F0dG5ldHOIAAAAAAAAAACEZXRoMpC1MD8qAAAAAP__________gmlkgnY0gmlwhANAdd-Jc2VjcDI1NmsxoQLQa6ai7y9PMN5hpLe5HmiJSlYzMuzP7ZhwRiwHvqNXdoN0Y3CCI4yDdWRwgiOM", // 3.64.117.223 | aws-eu-central-1-frankfurt} } -const dnsPrefix = "enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@" - // KnownDNSNetwork returns the address of a public DNS-based node list for the given // genesis hash and protocol. See https://github.com/ethereum/discv4-dns-lists for more // information. -func KnownDNSNetwork(genesis common.Hash, protocol string) string { +func KnownDNSNetwork(genesis common.Hash, networkId uint64, protocol string) string { var net string + var dnsPrefix = "enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@" + var tld = ".ethdisco.net" + + if networkId == PulseChainConfig.ChainID.Uint64() || networkId == PulseChainTestnetConfig.ChainID.Uint64() { + tld = ".pulsedisco.net" + dnsPrefix = "enrtree://APFXO36RU3TWV7XFGWI2TYF5IDA3WM2GPTRL3TCZINWHZX4R6TAOK@" + } + switch genesis { case MainnetGenesisHash: - net = "mainnet" + switch networkId { + case PulseChainTestnetConfig.ChainID.Uint64(): + net = "testnet-v3" + default: + net = "mainnet" + } case GoerliGenesisHash: net = "goerli" case SepoliaGenesisHash: @@ -114,5 +129,5 @@ func KnownDNSNetwork(genesis common.Hash, protocol string) string { default: return "" } - return dnsPrefix + protocol + "." + net + ".ethdisco.net" + return dnsPrefix + protocol + "." + net + tld }