Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(network): update seednodes for netid 8762 #2024

Merged
merged 8 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mm2src/coins/lp_price.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::collections::HashMap;
use std::str::Utf8Error;

const PRICE_ENDPOINTS: [&str; 2] = [
"https://prices.komodo.earth/api/v2/tickers",
"https://prices.komodian.info/api/v2/tickers",
"https://prices.cipig.net:1717/api/v2/tickers",
];

Expand Down
2 changes: 1 addition & 1 deletion mm2src/coins/nft/nft_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use mm2_number::BigDecimal;
use std::num::NonZeroUsize;
use std::str::FromStr;

const MORALIS_API_ENDPOINT_TEST: &str = "https://moralis-proxy.komodo.earth/api/v2";
const MORALIS_API_ENDPOINT_TEST: &str = "https://moralis-proxy.komodian.info/api/v2";
const TEST_WALLET_ADDR_EVM: &str = "0x394d86994f954ed931b86791b62fe64f4c5dac37";
const BLOCKLIST_API_ENDPOINT: &str = "https://nft.antispam.dragonhound.info";
const TOKEN_ADD: &str = "0xfd913a305d70a60aac4faac70c739563738e1f81";
Expand Down
2 changes: 1 addition & 1 deletion mm2src/mm2_libp2p/src/atomicdex_behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ fn start_gossipsub(
if !network_info.in_memory() {
// Please note WASM nodes don't support `PeersExchange` currently,
// so `get_all_network_seednodes` returns an empty list.
for (peer_id, addr) in get_all_network_seednodes(netid) {
for (peer_id, addr, _domain) in get_all_network_seednodes(netid) {
let multiaddr = addr.try_to_multiaddr(network_info)?;
peers_exchange.add_peer_addresses_to_known_peers(&peer_id, iter::once(multiaddr).collect());
gossipsub.add_explicit_relay(peer_id);
Expand Down
88 changes: 27 additions & 61 deletions mm2src/mm2_libp2p/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,81 +4,47 @@ use libp2p::PeerId;
pub const NETID_8762: u16 = 8762;

#[cfg_attr(target_arch = "wasm32", allow(dead_code))]
const ALL_NETID_8762_SEEDNODES: &[(&str, &str)] = &[
(
"12D3KooWHKkHiNhZtKceQehHhPqwU5W1jXpoVBgS1qst899GjvTm",
"168.119.236.251",
),
(
"12D3KooWAToxtunEBWCoAHjefSv74Nsmxranw8juy3eKEdrQyGRF",
"168.119.236.240",
),
(
"12D3KooWSmEi8ypaVzFA1AGde2RjxNW5Pvxw3qa2fVe48PjNs63R",
"168.119.236.239",
),
(
"12D3KooWJWBnkVsVNjiqUEPjLyHpiSmQVAJ5t6qt1Txv5ctJi9Xd",
"135.181.34.220",
),
(
"12D3KooWEsuiKcQaBaKEzuMtT6uFjs89P1E8MK3wGRZbeuCbCw6P",
"168.119.236.241",
),
(
"12D3KooWHBeCnJdzNk51G4mLnao9cDsjuqiMTEo5wMFXrd25bd1F",
"168.119.236.243",
),
(
"12D3KooWKxavLCJVrQ5Gk1kd9m6cohctGQBmiKPS9XQFoXEoyGmS",
"168.119.236.249",
),
(
"12D3KooW9soGyPfX6kcyh3uVXNHq1y2dPmQNt2veKgdLXkBiCVKq",
"168.119.236.246",
),
(
"12D3KooWL6yrrNACb7t7RPyTEPxKmq8jtrcbkcNd6H5G2hK7bXaL",
"168.119.236.233",
),
(
"12D3KooWMrjLmrv8hNgAoVf1RfumfjyPStzd4nv5XL47zN4ZKisb",
"168.119.237.8",
),
(
"12D3KooWPR2RoPi19vQtLugjCdvVmCcGLP2iXAzbDfP3tp81ZL4d",
"168.119.237.13",
),
(
"12D3KooWJDoV9vJdy6PnzwVETZ3fWGMhV41VhSbocR1h2geFqq9Y",
"65.108.90.210",
),
(
"12D3KooWEaZpH61H4yuQkaNG5AsyGdpBhKRppaLdAY52a774ab5u",
"46.4.78.11",
),
(
"12D3KooWAd5gPXwX7eDvKWwkr2FZGfoJceKDCA53SHmTFFVkrN7Q",
"46.4.87.18",
),
const ALL_NETID_8762_SEEDNODES: &[(&str, &str, &str)] = &[
("12D3KooWHKkHiNhZtKceQehHhPqwU5W1jXpoVBgS1qst899GjvTm", "168.119.236.251", "viserion.dragon-seed.com"),
("12D3KooWAToxtunEBWCoAHjefSv74Nsmxranw8juy3eKEdrQyGRF", "168.119.236.240", "rhaegal.dragon-seed.com"),
("12D3KooWSmEi8ypaVzFA1AGde2RjxNW5Pvxw3qa2fVe48PjNs63R", "168.119.236.239", "drogon.dragon-seed.com"),
("12D3KooWMrjLmrv8hNgAoVf1RfumfjyPStzd4nv5XL47zN4ZKisb", "168.119.237.8", "falkor.dragon-seed.com"),
("12D3KooWEWzbYcosK2JK9XpFXzumfgsWJW1F7BZS15yLTrhfjX2Z", "65.21.51.47", "smaug.dragon-seed.com"),
("12D3KooWJWBnkVsVNjiqUEPjLyHpiSmQVAJ5t6qt1Txv5ctJi9Xd", "135.181.34.220", "balerion.dragon-seed.com"),
("12D3KooWPR2RoPi19vQtLugjCdvVmCcGLP2iXAzbDfP3tp81ZL4d", "168.119.237.13", "kalessin.dragon-seed.com"),
("12D3KooWJDoV9vJdy6PnzwVETZ3fWGMhV41VhSbocR1h2geFqq9Y", "65.108.90.210", "icefyre.dragon-seed.com"),
("12D3KooWEaZpH61H4yuQkaNG5AsyGdpBhKRppaLdAY52a774ab5u", "46.4.78.11", "fr1.cipig.net")
];

// TODO: Uncomment these once re-enabled on the main network.
// Operated by Dragonhound, still on NetID 7777. Domains will update after netid migration.
// ("12D3KooWEsuiKcQaBaKEzuMtT6uFjs89P1E8MK3wGRZbeuCbCw6P", "168.119.236.241", "seed1.komodo.earth"), // tintaglia.dragon-seed.com
// ("12D3KooWHBeCnJdzNk51G4mLnao9cDsjuqiMTEo5wMFXrd25bd1F", "168.119.236.243", "seed2.komodo.earth"), // mercor.dragon-seed.com
// ("12D3KooWKxavLCJVrQ5Gk1kd9m6cohctGQBmiKPS9XQFoXEoyGmS", "168.119.236.249", "seed3.komodo.earth"), // karrigvestrit.dragon-seed.com
// ("12D3KooWGrUpCAbkxhPRioNs64sbUmPmpEcou6hYfrqQvxfWDEuf", "135.181.35.77", "seed4.komodo.earth"), // sintara.dragon-seed.com
// ("12D3KooWKu8pMTgteWacwFjN7zRWWHb3bctyTvHU3xx5x4x6qDYY", "65.21.56.210", "seed6.komodo.earth"), // heeby.dragon-seed.com
// ("12D3KooW9soGyPfX6kcyh3uVXNHq1y2dPmQNt2veKgdLXkBiCVKq", "168.119.236.246", "seed7.komodo.earth"), // kalo.dragon-seed.com
// ("12D3KooWL6yrrNACb7t7RPyTEPxKmq8jtrcbkcNd6H5G2hK7bXaL", "168.119.236.233", "seed8.komodo.earth"), // relpda.dragon-seed.com
// Operated by Cipi, still on NetID 7777
// ("12D3KooWAd5gPXwX7eDvKWwkr2FZGfoJceKDCA53SHmTFFVkrN7Q", "46.4.87.18", "fr2.cipig.net"),

#[cfg(target_arch = "wasm32")]
pub fn get_all_network_seednodes(_netid: u16) -> Vec<(PeerId, RelayAddress)> { Vec::new() }
pub fn get_all_network_seednodes(_netid: u16) -> Vec<(PeerId, RelayAddress, String)> { Vec::new() }

#[cfg(not(target_arch = "wasm32"))]
pub fn get_all_network_seednodes(netid: u16) -> Vec<(PeerId, RelayAddress)> {
pub fn get_all_network_seednodes(netid: u16) -> Vec<(PeerId, RelayAddress, String)> {
use std::str::FromStr;

if netid != NETID_8762 {
return Vec::new();
}
ALL_NETID_8762_SEEDNODES
.iter()
.map(|(peer_id, ipv4)| {
.map(|(peer_id, ipv4, domain)| {
let peer_id = PeerId::from_str(peer_id).expect("valid peer id");
let address = RelayAddress::IPv4(ipv4.to_string());
(peer_id, address)
let domain = domain.to_string();
(peer_id, address, domain)
})
.collect()
}
8 changes: 4 additions & 4 deletions mm2src/mm2_libp2p/src/peers_exchange.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,18 +395,18 @@ mod tests {
assert!(!behaviour.validate_get_known_peers_response(&response));

let address: Multiaddr =
"/ip4/168.119.236.241/tcp/3000/p2p/12D3KooWEsuiKcQaBaKEzuMtT6uFjs89P1E8MK3wGRZbeuCbCw6P"
"/ip4/168.119.236.251/tcp/3000/p2p/12D3KooWHKkHiNhZtKceQehHhPqwU5W1jXpoVBgS1qst899GjvTm"
.parse()
.unwrap();
let response = HashMap::from_iter(vec![(PeerIdSerde(PeerId::random()), HashSet::from_iter(vec![address]))]);
assert!(behaviour.validate_get_known_peers_response(&response));

let address1: Multiaddr =
"/ip4/168.119.236.241/tcp/3000/p2p/12D3KooWEsuiKcQaBaKEzuMtT6uFjs89P1E8MK3wGRZbeuCbCw6P"
"/ip4/168.119.236.251/tcp/3000/p2p/12D3KooWHKkHiNhZtKceQehHhPqwU5W1jXpoVBgS1qst899GjvTm"
.parse()
.unwrap();

let address2: Multiaddr = "/ip4/168.119.236.241/tcp/3000".parse().unwrap();
let address2: Multiaddr = "/ip4/168.119.236.251/tcp/3000".parse().unwrap();
let response = HashMap::from_iter(vec![(
PeerIdSerde(PeerId::random()),
HashSet::from_iter(vec![address1, address2]),
Expand All @@ -423,7 +423,7 @@ mod tests {
let result = behaviour.get_random_known_peers(1);
assert!(result.is_empty());

let address: Multiaddr = "/ip4/168.119.236.241/tcp/3000".parse().unwrap();
let address: Multiaddr = "/ip4/168.119.236.251/tcp/3000".parse().unwrap();
behaviour.request_response.add_address(&peer_id, address.clone());

let result = behaviour.get_random_known_peers(1);
Expand Down
13 changes: 9 additions & 4 deletions mm2src/mm2_main/src/lp_native_dex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,15 @@ cfg_wasm32! {
pub mod init_metamask;
}

const DEFAULT_NETID_SEEDNODES: [&str; 3] = [
"streamseed1.komodo.earth",
"streamseed2.komodo.earth",
"streamseed3.komodo.earth",
const DEFAULT_NETID_SEEDNODES: [&str; 8] = [
"viserion.dragon-seed.com", // 168.119.236.251
"rhaegal.dragon-seed.com", // 168.119.236.240
"drogon.dragon-seed.com", // 168.119.236.239
"falkor.dragon-seed.com", // 168.119.237.8
"smaug.dragon-seed.com", // 65.21.51.47
"balerion.dragon-seed.com", // 135.181.34.220
"kalessin.dragon-seed.com", // 168.119.237.13
"icefyre.dragon-seed.com" // 65.108.90.210
];

pub type P2PResult<T> = Result<T, MmError<P2PInitError>>;
Expand Down
2 changes: 1 addition & 1 deletion mm2src/mm2_main/src/lp_ordermatch/simple_market_maker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use std::collections::{HashMap, HashSet};
use uuid::Uuid;

// !< constants
pub const KMD_PRICE_ENDPOINT: &str = "https://prices.komodo.earth/api/v2/tickers";
pub const KMD_PRICE_ENDPOINT: &str = "https://prices.komodian.info/api/v2/tickers";
pub const BOT_DEFAULT_REFRESH_RATE: f64 = 30.0;
pub const PRECISION_FOR_NOTIFICATION: u64 = 8;
const LATEST_SWAPS_LIMIT: usize = 1000;
Expand Down
2 changes: 1 addition & 1 deletion mm2src/mm2_p2p/src/behaviours/atomicdex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ fn start_gossipsub(
if !network_info.in_memory() {
// Please note WASM nodes don't support `PeersExchange` currently,
// so `get_all_network_seednodes` returns an empty list.
for (peer_id, addr) in get_all_network_seednodes(netid) {
for (peer_id, addr, _domain) in get_all_network_seednodes(netid) {
let multiaddr = addr.try_to_multiaddr(network_info)?;
peers_exchange.add_peer_addresses_to_known_peers(&peer_id, iter::once(multiaddr).collect());
if peer_id != local_peer_id {
Expand Down
8 changes: 4 additions & 4 deletions mm2src/mm2_p2p/src/behaviours/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,18 +420,18 @@ mod tests {
assert!(!behaviour.validate_get_known_peers_response(&response));

let address: Multiaddr =
"/ip4/168.119.236.241/tcp/3000/p2p/12D3KooWEsuiKcQaBaKEzuMtT6uFjs89P1E8MK3wGRZbeuCbCw6P"
"/ip4/168.119.236.251/tcp/3000/p2p/12D3KooWHKkHiNhZtKceQehHhPqwU5W1jXpoVBgS1qst899GjvTm"
.parse()
.unwrap();
let response = HashMap::from_iter(vec![(PeerIdSerde(PeerId::random()), HashSet::from_iter(vec![address]))]);
assert!(behaviour.validate_get_known_peers_response(&response));

let address1: Multiaddr =
"/ip4/168.119.236.241/tcp/3000/p2p/12D3KooWEsuiKcQaBaKEzuMtT6uFjs89P1E8MK3wGRZbeuCbCw6P"
"/ip4/168.119.236.251/tcp/3000/p2p/12D3KooWHKkHiNhZtKceQehHhPqwU5W1jXpoVBgS1qst899GjvTm"
.parse()
.unwrap();

let address2: Multiaddr = "/ip4/168.119.236.241/tcp/3000".parse().unwrap();
let address2: Multiaddr = "/ip4/168.119.236.251/tcp/3000".parse().unwrap();
let response = HashMap::from_iter(vec![(
PeerIdSerde(PeerId::random()),
HashSet::from_iter(vec![address1, address2]),
Expand All @@ -448,7 +448,7 @@ mod tests {
let result = behaviour.get_random_known_peers(1);
assert!(result.is_empty());

let address: Multiaddr = "/ip4/168.119.236.241/tcp/3000".parse().unwrap();
let address: Multiaddr = "/ip4/168.119.236.251/tcp/3000".parse().unwrap();
behaviour.request_response.add_address(&peer_id, address.clone());

let result = behaviour.get_random_known_peers(1);
Expand Down
71 changes: 27 additions & 44 deletions mm2src/mm2_p2p/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,64 +4,47 @@ use libp2p::PeerId;
pub const DEFAULT_NETID: u16 = 8762;

#[cfg_attr(target_arch = "wasm32", allow(dead_code))]
const ALL_DEFAULT_NETID_SEEDNODES: &[(&str, &str)] = &[
(
"12D3KooWHKkHiNhZtKceQehHhPqwU5W1jXpoVBgS1qst899GjvTm",
"168.119.236.251",
),
(
"12D3KooWAToxtunEBWCoAHjefSv74Nsmxranw8juy3eKEdrQyGRF",
"168.119.236.240",
),
(
"12D3KooWSmEi8ypaVzFA1AGde2RjxNW5Pvxw3qa2fVe48PjNs63R",
"168.119.236.239",
),
("12D3KooWJWBnkVsVNjiqUEPjLyHpiSmQVAJ5t6qt1Txv5ctJi9Xd", "135.181.34.220"),
(
"12D3KooWEsuiKcQaBaKEzuMtT6uFjs89P1E8MK3wGRZbeuCbCw6P",
"168.119.236.241",
),
(
"12D3KooWHBeCnJdzNk51G4mLnao9cDsjuqiMTEo5wMFXrd25bd1F",
"168.119.236.243",
),
// TODO: Uncomment this once re-enabled on the main network.
// (
// "12D3KooWKxavLCJVrQ5Gk1kd9m6cohctGQBmiKPS9XQFoXEoyGmS",
// "168.119.236.249",
// ),
(
"12D3KooW9soGyPfX6kcyh3uVXNHq1y2dPmQNt2veKgdLXkBiCVKq",
"168.119.236.246",
),
(
"12D3KooWL6yrrNACb7t7RPyTEPxKmq8jtrcbkcNd6H5G2hK7bXaL",
"168.119.236.233",
),
("12D3KooWMrjLmrv8hNgAoVf1RfumfjyPStzd4nv5XL47zN4ZKisb", "168.119.237.8"),
("12D3KooWPR2RoPi19vQtLugjCdvVmCcGLP2iXAzbDfP3tp81ZL4d", "168.119.237.13"),
("12D3KooWJDoV9vJdy6PnzwVETZ3fWGMhV41VhSbocR1h2geFqq9Y", "65.108.90.210"),
("12D3KooWEaZpH61H4yuQkaNG5AsyGdpBhKRppaLdAY52a774ab5u", "46.4.78.11"),
("12D3KooWAd5gPXwX7eDvKWwkr2FZGfoJceKDCA53SHmTFFVkrN7Q", "46.4.87.18"),
const ALL_DEFAULT_NETID_SEEDNODES: &[(&str, &str, &str)] = &[
("12D3KooWHKkHiNhZtKceQehHhPqwU5W1jXpoVBgS1qst899GjvTm", "168.119.236.251", "viserion.dragon-seed.com"),
("12D3KooWAToxtunEBWCoAHjefSv74Nsmxranw8juy3eKEdrQyGRF", "168.119.236.240", "rhaegal.dragon-seed.com"),
("12D3KooWSmEi8ypaVzFA1AGde2RjxNW5Pvxw3qa2fVe48PjNs63R", "168.119.236.239", "drogon.dragon-seed.com"),
("12D3KooWMrjLmrv8hNgAoVf1RfumfjyPStzd4nv5XL47zN4ZKisb", "168.119.237.8", "falkor.dragon-seed.com"),
("12D3KooWEWzbYcosK2JK9XpFXzumfgsWJW1F7BZS15yLTrhfjX2Z", "65.21.51.47", "smaug.dragon-seed.com"),
("12D3KooWJWBnkVsVNjiqUEPjLyHpiSmQVAJ5t6qt1Txv5ctJi9Xd", "135.181.34.220", "balerion.dragon-seed.com"),
("12D3KooWPR2RoPi19vQtLugjCdvVmCcGLP2iXAzbDfP3tp81ZL4d", "168.119.237.13", "kalessin.dragon-seed.com"),
("12D3KooWJDoV9vJdy6PnzwVETZ3fWGMhV41VhSbocR1h2geFqq9Y", "65.108.90.210", "icefyre.dragon-seed.com"),
("12D3KooWEaZpH61H4yuQkaNG5AsyGdpBhKRppaLdAY52a774ab5u", "46.4.78.11", "fr1.cipig.net")
];

// TODO: Uncomment these once re-enabled on the main network.
// Operated by Dragonhound, still on NetID 7777. Domains will update after netid migration.
// ("12D3KooWEsuiKcQaBaKEzuMtT6uFjs89P1E8MK3wGRZbeuCbCw6P", "168.119.236.241", "seed1.komodo.earth"), // tintaglia.dragon-seed.com
// ("12D3KooWHBeCnJdzNk51G4mLnao9cDsjuqiMTEo5wMFXrd25bd1F", "168.119.236.243", "seed2.komodo.earth"), // mercor.dragon-seed.com
// ("12D3KooWKxavLCJVrQ5Gk1kd9m6cohctGQBmiKPS9XQFoXEoyGmS", "168.119.236.249", "seed3.komodo.earth"), // karrigvestrit.dragon-seed.com
// ("12D3KooWGrUpCAbkxhPRioNs64sbUmPmpEcou6hYfrqQvxfWDEuf", "135.181.35.77", "seed4.komodo.earth"), // sintara.dragon-seed.com
// ("12D3KooWKu8pMTgteWacwFjN7zRWWHb3bctyTvHU3xx5x4x6qDYY", "65.21.56.210", "seed6.komodo.earth"), // heeby.dragon-seed.com
// ("12D3KooW9soGyPfX6kcyh3uVXNHq1y2dPmQNt2veKgdLXkBiCVKq", "168.119.236.246", "seed7.komodo.earth"), // kalo.dragon-seed.com
// ("12D3KooWL6yrrNACb7t7RPyTEPxKmq8jtrcbkcNd6H5G2hK7bXaL", "168.119.236.233", "seed8.komodo.earth"), // relpda.dragon-seed.com
// Operated by Cipi, still on NetID 7777
// ("12D3KooWAd5gPXwX7eDvKWwkr2FZGfoJceKDCA53SHmTFFVkrN7Q", "46.4.87.18", "fr2.cipig.net"),

#[cfg(target_arch = "wasm32")]
pub fn get_all_network_seednodes(_netid: u16) -> Vec<(PeerId, RelayAddress)> { Vec::new() }
pub fn get_all_network_seednodes(_netid: u16) -> Vec<(PeerId, RelayAddress, String)> { Vec::new() }

#[cfg(not(target_arch = "wasm32"))]
pub fn get_all_network_seednodes(netid: u16) -> Vec<(PeerId, RelayAddress)> {
pub fn get_all_network_seednodes(netid: u16) -> Vec<(PeerId, RelayAddress, String)> {
use std::str::FromStr;

if netid != DEFAULT_NETID {
return Vec::new();
}
ALL_DEFAULT_NETID_SEEDNODES
.iter()
.map(|(peer_id, ipv4)| {
.map(|(peer_id, ipv4, domain)| {
let peer_id = PeerId::from_str(peer_id).expect("valid peer id");
let address = RelayAddress::IPv4(ipv4.to_string());
(peer_id, address)
let domain = domain.to_string();
(peer_id, address, domain)
})
.collect()
}
Loading