Skip to content

Commit 1da78de

Browse files
authored
feat: updated dataset (GeoLite2-City-CSV_20250218) (#116)
1 parent e1a7da2 commit 1da78de

23 files changed

Lines changed: 812 additions & 482 deletions

.github/workflows/main.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

package-lock.json

Lines changed: 799 additions & 448 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,23 @@
3232
"generate": "node bin/generate.js"
3333
},
3434
"devDependencies": {
35-
"@ipld/car": "^5.3.3",
35+
"@ipld/car": "^5.4.0",
3636
"@ipld/dag-cbor": "^9.2.2",
37-
"aegir": "^45.0.8",
37+
"aegir": "^45.0.9",
3838
"bluebird": "^3.7.2",
3939
"chai": "^4.3.6",
4040
"chai-as-promised": "^7.1.1",
4141
"cross-fetch": "^3.1.5",
42-
"csv-parse": "^5.3.0",
43-
"esmock": "^2.6.0",
42+
"csv-parse": "^5.6.0",
43+
"esmock": "^2.7.0",
4444
"gauge": "^4.0.4",
45-
"ip": "^2.0.0",
45+
"ip": "^2.0.1",
4646
"it-concat": "^2.0.0",
4747
"kubo-rpc-client": "^3.0.1",
4848
"lodash-es": "^4.17.21",
49-
"multiformats": "^13.3.1",
49+
"multiformats": "^13.3.2",
5050
"multihashes": "^4.0.3",
51-
"p-memoize": "^7.1.0",
51+
"p-memoize": "^7.1.1",
5252
"pre-commit": "^1.2.2",
5353
"uint8arrays": "^3.1.0"
5454
},

src/generate/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { EventEmitter } from 'events'
2-
import { cpus } from 'os'
32
import * as dagCbor from '@ipld/dag-cbor'
43
import { default as Promise } from 'bluebird'
54
import ip from 'ip'
@@ -18,7 +17,7 @@ const CHILDREN = 32
1817
// DATA_HASH
1918
// |- locationsCsv
2019
// |- blocksCsv
21-
const DATA_HASH = 'bafybeifv6fqeyyvratbzewxpasvfxdsnqz5wjv6e6cp36pr5tkccmtljcm' // GeoLite2-City-CSV_20231117
20+
const DATA_HASH = 'bafybeiggln2inqvokpp7rcjpqaou7v73rknemitrv6bp3q67vimthtsopu' // GeoLite2-City-CSV_20250218
2221
const locationsCsv = 'GeoLite2-City-Locations-en.csv'
2322
const blocksCsv = 'GeoLite2-City-Blocks-IPv4.csv'
2423

@@ -164,9 +163,11 @@ async function toNode (things, car) {
164163
return putBlock(createNode(things), min, car)
165164
}
166165

166+
const cpuCores = navigator.hardwareConcurrency || 1
167+
167168
// divide
168169
return Promise.map(chunk(things, CHILDREN), (res) => toNode(res, car), {
169-
concurrency: cpus().length * 2
170+
concurrency: cpuCores * 2
170171
})
171172
.then((res) => toNode(res, car))
172173
}

src/lookup.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import { default as memoize } from 'p-memoize'
66
import { MAX_LOOKUP_RETRIES } from './constants.js'
77
import { formatData } from './format.js'
88

9-
export const GEOIP_ROOT = CID.parse('bafyreif3tfdpr5n4jdrbielmcapwvbpcthepfkwq2vwonmlhirbjmotedi') // b-tree version of GeoLite2-City-CSV_20231117
9+
export const GEOIP_ROOT = CID.parse('bafyreibm6gpmdrbbf27x4b473fenradnlc3zcussd3vfjy4nv7ta3uuyge') // b-tree version of GeoLite2-City-CSV_20250218
1010

11-
const defaultGateway = ['https://ipfs.io', 'https://dweb.link']
11+
const defaultGateway = ['https://trustless-gateway.link', 'https://ipfs.io', 'https://dweb.link']
1212

1313
/**
1414
* @param {object|string} ipfs
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)