-
Notifications
You must be signed in to change notification settings - Fork 21
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
feat: updated dataset (2020-10-13) #80
Conversation
This updates the IPv4 City geoip dataset to the latest version provided on https://dev.maxmind.com/geoip/geoip2/geolite2/ The b-tree format and lookup logic remain unchanged, however the code responsible for building the b-tree had to be changed to work with the new CSV format of the source dataset. Closes #68 Closes #63 BREAKING CHANGE: `area_code` and `metro_code` are no longer provided due to upstream changes License: MIT Signed-off-by: Marcin Rataj <lidel@lidel.org>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for following up on this!
// |- locationsCsv | ||
// |- blocksCsv | ||
const DATA_HASH = 'bafybeid3munsqqt36qhoumn3kvgwmft6dsswzgl3wiohsanlyqemczcsvi' // GeoLite2-City-CSV_20201013 | ||
const locationsCsv = 'GeoLite2-City-Locations-en.csv' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ Are we going to use other languages in the near future? I see that we have available de, en, es, fr, ja, pt-BR, ru and zh-CN
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is certainly a possibility now, but not in the scope of this PR.
Created #81 to track that.
geonameData.push( | ||
String(row.postal_code), | ||
Number(row.latitude), | ||
Number(row.longitude) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝Last two could end up as NaN
s if inputs aren't valid numbers. If that is not valid output it would be worth to uphold invariant here.
Co-authored-by: Irakli Gozalishvili <contact@gozala.io> License: MIT Signed-off-by: Marcin Rataj <lidel@lidel.org>
f628658
to
a1eba19
Compare
Details: ipfs-shipyard/ipfs-geoip#80 License: MIT Signed-off-by: Marcin Rataj <lidel@lidel.org>
Closes #1249 See ipfs-shipyard/ipfs-geoip#80 for details
This PR updates the IPv4 City geoip dataset to the latest free version provided on https://dev.maxmind.com/geoip/geoip2/geolite2/ (
GeoLite2-City-CSV_20201013
)Closes #68
Closes #63
Changes
npm run generate
to be compatible with new input format without changing output format too mucharea_code
andmetro_code
are no longer provided due to upstream changesGeoLite2-City-CSV_20201013
datasetbut I've kept our overrides just to protect against future regressions.
Not in this PR
ipfs.object
API instead ofipfs.dag
anddag-cbor
Test/Preview: ipfs-geoip on WebUI's Peers screen
I've run this PR against ipfs-webui and Peers screen looks good.
My node is located in Poland. I no longer see "USA" nodes with 30ms ping – faster-than-light networking is no more ;)
With this updated dataset, we now see much better distribution across all continents: