{"id":22608992,"url":"https://github.com/bitfinexcom/bfx-util-net-js","last_synced_at":"2025-09-01T01:18:17.932Z","repository":{"id":46199663,"uuid":"108276826","full_name":"bitfinexcom/bfx-util-net-js","owner":"bitfinexcom","description":null,"archived":false,"fork":false,"pushed_at":"2025-07-30T13:26:05.000Z","size":417,"stargazers_count":5,"open_issues_count":5,"forks_count":12,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-07-30T16:02:22.323Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bitfinexcom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-25T13:49:50.000Z","updated_at":"2025-07-30T13:24:33.000Z","dependencies_parsed_at":"2024-05-01T11:30:44.032Z","dependency_job_id":"8fabef6a-00b1-45dd-8df3-8e51d8f3a432","html_url":"https://github.com/bitfinexcom/bfx-util-net-js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bitfinexcom/bfx-util-net-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Fbfx-util-net-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Fbfx-util-net-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Fbfx-util-net-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Fbfx-util-net-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitfinexcom","download_url":"https://codeload.github.com/bitfinexcom/bfx-util-net-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitfinexcom%2Fbfx-util-net-js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273061121,"owners_count":25038598,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-31T02:00:09.071Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-08T15:10:30.677Z","updated_at":"2025-09-01T01:18:17.911Z","avatar_url":"https://github.com/bitfinexcom.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/bitfinexcom/bfx-util-net-js.svg?branch=master)](https://travis-ci.org/bitfinexcom/bfx-util-net-js)\n\n# bfx-util-net\n\n## Setup\n\nThe project inherits code from a base repository.\n\nThe base / root project is: https://github.com/bitfinexcom/bfx-util-js\n\n## Setup\n\n### Set upstream\n\n```\ngit remote add upstream https://github.com/bitfinexcom/bfx-util-js\n```\n\nChanges should go through the base project and merged from upstream, if applicable.\n\n### Configuration\n\n```\nbash setup-config.sh\n```\n\n### Grapes\n\nRun two Grapes:\n\n```\ngrape --dp 20001 --aph 30001 --bn '127.0.0.1:20002'\ngrape --dp 20002 --aph 40001 --bn '127.0.0.1:20001'\n```\n\n### Update Geo/ASN data\n\nFirst, export your license key, for staging/prod we have a comercial\nlicense.  For dev, you can get a free key key optained through \nhttps://dev.maxmind.com/geoip/geolite2-free-geolocation-data?lang=en \n\nexport MAXMIND_LICENSE='your secret license'\n\n```\nnpm run update-geo-data\nnpm run update-asn-data\n```\n\n### Periodic Updates for Geo/ASN data\n\nUpdate geo-data at midnight every three days with cron.\nUpdate geo-data at 23:00 every three days with cron.\n\n\nLet's assume the path to the deployed service is `/opt/var/bfx-util-net`.\n\n```\n0 0 */3 * * cd /opt/var/bfx-util-net \u0026\u0026 /usr/bin/npm run update-geo-data\n0 23 */3 * * cd /opt/var/bfx-util-net \u0026\u0026 /usr/bin/npm run update-asn-data\n```\n\nThe IP databases are watching the database files for changes and will load\nthe updated data into the RAM as soon as the data changes.\n\n### Boot worker\n\n```\nnode worker.js --env=development --wtype=wrk-util-net-api --apiPort 8721\n```\n\n### SSL / ACL\n\nTo turn on ACL and SSL set up, copy `sec-test` to `sec`:\n\n```\ncp -R sec-test sec\n```\n\nSet access rules in [sec/acl.json](https://github.com/bitfinexcom/bfx-util-net-js/blob/8d07c144f3a4135db0d4c7bc51297ffc06e358f9/sec-test/acl.json)\n\nAccess is logged to [sec/acl.log](https://github.com/bitfinexcom/bfx-util-net-js/blob/8d07c144f3a4135db0d4c7bc51297ffc06e358f9/sec-test/acl.log).\n\nTo use SSL in `example.js`, uncomment everything related to SSL: https://github.com/bitfinexcom/bfx-util-net-js/blob/8d07c144f3a4135db0d4c7bc51297ffc06e358f9/example.js#L16.L24\n\n## Grenache API\n\n### action: 'getIpInfo'\n\n  - `args`: \u0026lt;Array\u0026gt;\n    - `0`: \u0026lt;String\u0026gt; IP to lookup\n\n**Response:**\n\n  - \u0026lt;Array\u0026gt;\n    - 0 \u0026lt;String\u0026gt; Ip that was looked up\n    - 1 \u0026lt;Object\u0026gt; Result: geo, dns\n\n**Example Response:**\n\n```js\n[\n  \"8.8.8.8\",\n  {\n    \"geo\": {\n      \"range\": [\n        134744064,\n        134744319\n      ],\n      \"country\": \"US\",\n      \"region\": \"CA\",\n      \"city\": \"Mountain View\",\n      \"ll\": [\n        37.386,\n        -122.0838\n      ],\n      \"metro\": 807,\n      \"zip\": 94035\n    },\n    \"dns\": [\n      \"google-public-dns-a.google.com\"\n    ],\n    \"asn\": {\n      \"autonomous_system_number\": 15169,\n      \"autonomous_system_organization\": \"Google Inc.\"\n    }\n  }\n]\n```\n\n### action: 'getIpAsn'\n\n  - `args`: \u0026lt;Array\u0026gt;\n    - `0`: \u0026lt;String\u0026gt; IP to lookup\n\n**Response:**\n\n  - \u0026lt;Array\u0026gt;\n    - 0 \u0026lt;String\u0026gt; Ip that was looked up\n    - 1 \u0026lt;Object\u0026gt; ASN information\n\n **Example Response:**\n\n```js\n[ '8.8.8.8',\n  { autonomous_system_number: 15169,\n    autonomous_system_organization: 'Google Inc.' } ]\n```\n\n### action: 'getReverseDns'\n\n\n  - `args`: \u0026lt;Array\u0026gt;\n    - `0`: \u0026lt;String\u0026gt; IP to lookup\n\n**Response:**\n\n  - \u0026lt;Array\u0026gt;\n    - 0 \u0026lt;String\u0026gt; Ip that was looked up\n    - 1 \u0026lt;Array\u0026gt; hostnames\n\n**Example Response:**\n\n```js\n[ '8.8.8.8', [ 'google-public-dns-a.google.com' ] ]\n```\n\n### action: 'getIpGeo'\n\n  - `args`: \u0026lt;Array\u0026gt;\n    - `0`: \u0026lt;String\u0026gt; IP to lookup\n\n**Response:**\n\n  - \u0026lt;Array\u0026gt;\n    - 0 \u0026lt;String\u0026gt; Ip that was looked up\n    - 1 \u0026lt;Object\u0026gt; Result: range, country, region, city, ll, metro, zip\n\n**Example Response:**\n\n```js\n[ '53.1.34.21',\n  { range: [ 889192448, 897238054 ],\n    country: 'DE',\n    region: '',\n    city: '',\n    ll: [ 51.2993, 9.491 ],\n    metro: 0,\n    zip: 0 } ]\n```\n\n### action: 'getIpGeoBatch'\n\n  - `args`: \u0026lt;Array\u0026gt;\n    - `0`: \u0026lt;Array\u0026gt; IPs to lookup\n\n**Response:**\n\n  - \u0026lt;Array\u0026gt;\n    - 0 \u0026lt;String\u0026gt; Ip that was looked up\n    - 1 \u0026lt;Array\u0026gt; Result array\n\n**Example Response:**\n\n```js\n[ '53.1.34.21',\n  { range: [ 889192448, 897238054 ],\n    country: 'DE',\n    region: '',\n    city: '',\n    ll: [ 51.2993, 9.491 ],\n    metro: 0,\n    zip: 0 } ]\n```\n\n#### Example\n\n```\n  const query = {\n    action: 'geoIp',\n    'args': [ '53.1.34.21' ]\n  }\n\n  peer.request('rest:net:util', query, { timeout: 10000 }, (err, data) =\u003e {\n    if (err) {\n      console.error(err)\n      process.exit(1)\n    }\n\n    console.log(data)\n  })\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitfinexcom%2Fbfx-util-net-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitfinexcom%2Fbfx-util-net-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitfinexcom%2Fbfx-util-net-js/lists"}