artifacts: Update GeoLite database (#551)

* Update GeoLite city database

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* core: Update DB download link and add copyright link

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

* core/tests: Adjust location for random IP address

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
Alexandru Vasile
2023-10-17 17:41:44 +03:00
committed by GitHub
parent d84947f148
commit 35b583d5f0
2 changed files with 8 additions and 2 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 MiB

After

Width:  |  Height:  |  Size: 68 MiB

+8 -2
View File
@@ -81,7 +81,13 @@ struct Locator {
}
impl Locator {
/// Taken from here: https://github.com/P3TERX/GeoLite.mmdb/releases/tag/2022.06.07
/// GeoLite database release data: 2023-10-13
///
/// 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/.
const CITY_DATA: &'static [u8] = include_bytes!("GeoLite2-City.mmdb");
pub fn new(cache: FxHashMap<IpAddr, Arc<NodeLocation>>) -> Self {
@@ -138,6 +144,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, "El Paso");
assert_eq!(&*node_location.city, "Riverside");
}
}