diff --git a/.gitignore b/.gitignore index 9e717b212..d4387d0ec 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ target *.pyc result .direnv +.vscode/ +openapitools.json diff --git a/src/electrum/discovery/default_servers.rs b/src/electrum/discovery/default_servers.rs index 95754ecef..f54da3ab3 100644 --- a/src/electrum/discovery/default_servers.rs +++ b/src/electrum/discovery/default_servers.rs @@ -1,447 +1,279 @@ use crate::chain::Network; use crate::electrum::discovery::{DiscoveryManager, Service}; +macro_rules! add_servers { + ($discovery:expr, $servers:expr) => { + for (address, services) in $servers.iter() { + $discovery + .add_default_server(address.clone().into(), services.clone()) + .ok(); + } + }; +} + pub fn add_default_servers(discovery: &DiscoveryManager, network: Network) { match network { #[cfg(not(feature = "liquid"))] Network::Bitcoin => { - discovery - .add_default_server( - "3smoooajg7qqac2y.onion".into(), + let servers = vec![ + ( + "3smoooajg7qqac2y.onion", vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "81-7-10-251.blue.kundencontroller.de".into(), + ), + ( + "81-7-10-251.blue.kundencontroller.de", vec![Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "E-X.not.fyi".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "VPS.hsmiths.com".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "b.ooze.cc".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "bauerjda5hnedjam.onion".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "bauerjhejlv6di7s.onion".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "bitcoin.corgi.party".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "bitcoin3nqy3db7c.onion".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "bitcoins.sk".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "btc.cihar.com".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "btc.xskyx.net".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "currentlane.lovebitco.in".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "daedalus.bauerj.eu".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "electrum.jochen-hoenicke.de".into(), + ), + ( + "E-X.not.fyi", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ( + "VPS.hsmiths.com", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ("b.ooze.cc", vec![Service::Tcp(50001), Service::Ssl(50002)]), + ( + "bauerjda5hnedjam.onion", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ( + "bauerjhejlv6di7s.onion", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ( + "bitcoin.corgi.party", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ( + "bitcoin3nqy3db7c.onion", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ( + "bitcoins.sk", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ( + "btc.cihar.com", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ( + "btc.xskyx.net", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ( + "currentlane.lovebitco.in", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ( + "daedalus.bauerj.eu", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ( + "electrum.jochen-hoenicke.de", vec![Service::Tcp(50003), Service::Ssl(50005)], - ) - .ok(); - discovery - .add_default_server( - "dragon085.startdedicated.de".into(), - vec![Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "e-1.claudioboxx.com".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "e.keff.org".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "electrum-server.ninja".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "electrum-unlimited.criptolayer.net".into(), - vec![Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "electrum.eff.ro".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "electrum.festivaldelhumor.org".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "electrum.hsmiths.com".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "electrum.leblancnet.us".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server("electrum.mindspot.org".into(), vec![Service::Ssl(50002)]) - .ok(); - discovery - .add_default_server( - "electrum.qtornado.com".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server("electrum.taborsky.cz".into(), vec![Service::Ssl(50002)]) - .ok(); - discovery - .add_default_server( - "electrum.villocq.com".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "electrum2.eff.ro".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "electrum2.villocq.com".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "electrumx.bot.nu".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "electrumx.ddns.net".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server("electrumx.ftp.sh".into(), vec![Service::Ssl(50002)]) - .ok(); - discovery - .add_default_server( - "electrumx.ml".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "electrumx.soon.it".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server("electrumxhqdsmlu.onion".into(), vec![Service::Tcp(50001)]) - .ok(); - discovery - .add_default_server( - "elx01.knas.systems".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "enode.duckdns.org".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "fedaykin.goip.de".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "fn.48.org".into(), - vec![Service::Tcp(50003), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "helicarrier.bauerj.eu".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "hsmiths4fyqlw5xw.onion".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "hsmiths5mjk6uijs.onion".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "icarus.tetradrachm.net".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "electrum.emzy.de".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "ndnd.selfhost.eu".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server("ndndword5lpb7eex.onion".into(), vec![Service::Tcp(50001)]) - .ok(); - discovery - .add_default_server( - "orannis.com".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "ozahtqwp25chjdjd.onion".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "qtornadoklbgdyww.onion".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server("rbx.curalle.ovh".into(), vec![Service::Ssl(50002)]) - .ok(); - discovery - .add_default_server("s7clinmo4cazmhul.onion".into(), vec![Service::Tcp(50001)]) - .ok(); - discovery - .add_default_server( - "tardis.bauerj.eu".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server("technetium.network".into(), vec![Service::Ssl(50002)]) - .ok(); - discovery - .add_default_server( - "tomscryptos.com".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "ulrichard.ch".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "vmd27610.contaboserver.net".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "vmd30612.contaboserver.net".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "wsw6tua3xl24gsmi264zaep6seppjyrkyucpsmuxnjzyt3f3j6swshad.onion".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "xray587.startdedicated.de".into(), + ), + ("dragon085.startdedicated.de", vec![Service::Ssl(50002)]), + ( + "e-1.claudioboxx.com", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ("e.keff.org", vec![Service::Tcp(50001), Service::Ssl(50002)]), + ( + "electrum-server.ninja", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ( + "electrum-unlimited.criptolayer.net", vec![Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "yuio.top".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "bitcoin.dragon.zone".into(), + ), + ( + "electrum.eff.ro", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ( + "electrum.festivaldelhumor.org", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ( + "electrum.hsmiths.com", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ( + "electrum.leblancnet.us", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ("electrum.mindspot.org", vec![Service::Ssl(50002)]), + ( + "electrum.qtornado.com", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ("electrum.taborsky.cz", vec![Service::Ssl(50002)]), + ( + "electrum.villocq.com", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ( + "electrum2.eff.ro", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ( + "electrum2.villocq.com", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ( + "electrumx.bot.nu", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ( + "electrumx.ddns.net", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ("electrumx.ftp.sh", vec![Service::Ssl(50002)]), + ( + "electrumx.ml", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ( + "electrumx.soon.it", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ("electrumxhqdsmlu.onion", vec![Service::Tcp(50001)]), + ( + "elx01.knas.systems", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ( + "enode.duckdns.org", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ( + "fedaykin.goip.de", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ("fn.48.org", vec![Service::Tcp(50003), Service::Ssl(50002)]), + ( + "helicarrier.bauerj.eu", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ( + "hsmiths4fyqlw5xw.onion", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ( + "hsmiths5mjk6uijs.onion", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ( + "icarus.tetradrachm.net", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ( + "electrum.emzy.de", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ( + "ndnd.selfhost.eu", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ("ndndword5lpb7eex.onion", vec![Service::Tcp(50001)]), + ( + "orannis.com", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ( + "ozahtqwp25chjdjd.onion", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ( + "qtornadoklbgdyww.onion", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ("rbx.curalle.ovh", vec![Service::Ssl(50002)]), + ("s7clinmo4cazmhul.onion", vec![Service::Tcp(50001)]), + ( + "tardis.bauerj.eu", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ("technetium.network", vec![Service::Ssl(50002)]), + ( + "tomscryptos.com", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ( + "ulrichard.ch", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ( + "vmd27610.contaboserver.net", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ( + "vmd30612.contaboserver.net", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ( + "wsw6tua3xl24gsmi264zaep6seppjyrkyucpsmuxnjzyt3f3j6swshad.onion", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ("xray587.startdedicated.de", vec![Service::Ssl(50002)]), + ("yuio.top", vec![Service::Tcp(50001), Service::Ssl(50002)]), + ( + "bitcoin.dragon.zone", vec![Service::Tcp(50003), Service::Ssl(50004)], - ) - .ok(); - discovery - .add_default_server( - "ecdsa.net".into(), - vec![Service::Tcp(50001), Service::Ssl(110)], - ) - .ok(); - discovery - .add_default_server("btc.usebsv.com".into(), vec![Service::Ssl(50006)]) - .ok(); - discovery - .add_default_server( - "e2.keff.org".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server("electrum.hodlister.co".into(), vec![Service::Ssl(50002)]) - .ok(); - discovery - .add_default_server("electrum3.hodlister.co".into(), vec![Service::Ssl(50002)]) - .ok(); - discovery - .add_default_server("electrum5.hodlister.co".into(), vec![Service::Ssl(50002)]) - .ok(); - discovery - .add_default_server( - "electrumx.electricnewyear.net".into(), - vec![Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "fortress.qtornado.com".into(), + ), + ("ecdsa.net", vec![Service::Tcp(50001), Service::Ssl(110)]), + ("btc.usebsv.com", vec![Service::Ssl(50006)]), + ( + "e2.keff.org", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ("electrum.hodlister.co", vec![Service::Ssl(50002)]), + ("electrum3.hodlister.co", vec![Service::Ssl(50002)]), + ("electrum5.hodlister.co", vec![Service::Ssl(50002)]), + ("electrumx.electricnewyear.net", vec![Service::Ssl(50002)]), + ( + "fortress.qtornado.com", vec![Service::Tcp(50001), Service::Ssl(443)], - ) - .ok(); - discovery - .add_default_server( - "green-gold.westeurope.cloudapp.azure.com".into(), + ), + ( + "green-gold.westeurope.cloudapp.azure.com", vec![Service::Tcp(56001), Service::Ssl(56002)], - ) - .ok(); - discovery - .add_default_server( - "electrumx.erbium.eu".into(), + ), + ( + "electrumx.erbium.eu", vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); + ), + ]; + add_servers!(discovery, servers); } #[cfg(not(feature = "liquid"))] Network::Testnet => { - discovery - .add_default_server( - "hsmithsxurybd7uh.onion".into(), + let servers = vec![ + ( + "hsmithsxurybd7uh.onion", vec![Service::Tcp(53011), Service::Ssl(53012)], - ) - .ok(); - discovery - .add_default_server( - "testnet.hsmiths.com".into(), + ), + ( + "testnet.hsmiths.com", vec![Service::Tcp(53011), Service::Ssl(53012)], - ) - .ok(); - discovery - .add_default_server( - "testnet.qtornado.com".into(), + ), + ( + "testnet.qtornado.com", vec![Service::Tcp(51001), Service::Ssl(51002)], - ) - .ok(); - discovery - .add_default_server( - "testnet1.bauerj.eu".into(), - vec![Service::Tcp(50001), Service::Ssl(50002)], - ) - .ok(); - discovery - .add_default_server( - "tn.not.fyi".into(), - vec![Service::Tcp(55001), Service::Ssl(55002)], - ) - .ok(); - discovery - .add_default_server( - "bitcoin.cluelessperson.com".into(), + ), + ( + "testnet1.bauerj.eu", + vec![Service::Tcp(50001), Service::Ssl(50002)], + ), + ("tn.not.fyi", vec![Service::Tcp(55001), Service::Ssl(55002)]), + ( + "bitcoin.cluelessperson.com", vec![Service::Tcp(51001), Service::Ssl(51002)], - ) - .ok(); + ), + ]; + add_servers!(discovery, servers); } - _ => (), } }