Add bootnodes and dns config for testnet-v3

This commit is contained in:
Shane Bammel 2023-03-08 16:20:05 -06:00
parent 28d94dda61
commit 47d73c02dd
2 changed files with 22 additions and 7 deletions

View File

@ -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
}

View File

@ -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
}