Skip to content

Commit

Permalink
Update GeoLite database (paritytech#583)
Browse files Browse the repository at this point in the history
* Update GeoLite database

* fmt and fix test

---------

Co-authored-by: Milos Kriz <[email protected]>
Co-authored-by: Milos Kriz <[email protected]>
  • Loading branch information
3 people authored Apr 12, 2024
1 parent f132b8e commit 7bf2925
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Binary file modified backend/telemetry_core/src/GeoLite2-City.mmdb
Binary file not shown.
14 changes: 8 additions & 6 deletions backend/telemetry_core/src/find_location.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,15 @@ struct Locator {
}

impl Locator {
/// GeoLite database release data: 2023-10-13
///
/// GeoLite database release data: 2024-03-29
/// Database and Contents Copyright (c) 2024 MaxMind, Inc.
/// To download the latest version visit: https://dev.maxmind.com/geoip/geolite2-free-geolocation-data.
///
/// This database incorporates GeoNames [https://www.geonames.org] geographical data, which is made available
/// under the Creative Commons Attribution 4.0 License.
/// To view a copy of this license,visit https://creativecommons.org/licenses/by/4.0/.
/// Use of this MaxMind product is governed by MaxMind's GeoLite2 End User License Agreement,
/// which can be viewed at https://www.maxmind.com/en/geolite2/eula.
/// This database incorporates GeoNames [https://www.geonames.org] geographical data,
/// which is made available under the Creative Commons Attribution 4.0 License.
/// To view a copy of this license, visit https://creativecommons.org/licenses/by/4.0/.
const CITY_DATA: &'static [u8] = include_bytes!("GeoLite2-City.mmdb");

pub fn new(cache: FxHashMap<IpAddr, Arc<NodeLocation>>) -> Self {
Expand Down Expand Up @@ -144,6 +146,6 @@ mod tests {
fn locate_random_ip() {
let ip = "12.5.56.25".parse().unwrap();
let node_location = Locator::new(Default::default()).locate(ip).unwrap();
assert_eq!(&*node_location.city, "Riverside");
assert_eq!(&*node_location.city, "Gardena");
}
}

0 comments on commit 7bf2925

Please sign in to comment.