mirror of
https://github.com/ditatompel/insights.git
synced 2025-01-08 03:12:06 +07:00
Compare commits
4 commits
a587555750
...
4250faf532
Author | SHA1 | Date | |
---|---|---|---|
4250faf532 | |||
7ab8c6df11 | |||
013aa7db35 | |||
e8d434ab85 |
2 changed files with 64 additions and 57 deletions
2
.github/workflows/deploy-to-vps.yaml
vendored
2
.github/workflows/deploy-to-vps.yaml
vendored
|
@ -26,7 +26,7 @@ jobs:
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: "19"
|
node-version: "20"
|
||||||
|
|
||||||
- name: Cache dependencies
|
- name: Cache dependencies
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
|
|
|
@ -35,6 +35,21 @@ Since the Monero remote nodes that I monitor are increasing and my page that dis
|
||||||
|
|
||||||
## Updates
|
## Updates
|
||||||
|
|
||||||
|
### Update 2024-01-31 (Breaking Changes)
|
||||||
|
|
||||||
|
- API endpoint moved from `https://www.ditatompel.com/api/monero/remote-node` to `https://api.ditatompel.com/monero/remote-node`.
|
||||||
|
- `x-ditatompel-rate-limit-*` headers removed, no rate limit for now.
|
||||||
|
- Indication "unchecked node statuses" in `data[].last_check_statuses[]` changed from `null` to `2`.
|
||||||
|
- Added into `json` field:
|
||||||
|
- `data[].ip`, `data[].date_entered`, `data[].latitude`, and `data[].longitude`
|
||||||
|
- Removed from `json` field:
|
||||||
|
- `success`
|
||||||
|
- `data[].postal`
|
||||||
|
|
||||||
|
Diff: [013aa7d](https://github.com/ditatompel/insights/commit/013aa7db35edd28e72907d5786fcf8877a5a3e70#diff-a8f1b286fbca7e5d241e20d067c8b17a67b86cc142d10dc7cc23cbc9fcc0e332L139-L167).
|
||||||
|
|
||||||
|
Because I [refactoring my backend]({{< ref "/blog/rewriting-ditatompel-site-to-svelte-tailwind-and-go/index.md" >}}), there will most likely be another breaking changes in the near future.
|
||||||
|
|
||||||
### Update 2023-05-24
|
### Update 2023-05-24
|
||||||
- I've add `cors` and `last_check_statuses` to nodes data record.
|
- I've add `cors` and `last_check_statuses` to nodes data record.
|
||||||
|
|
||||||
|
@ -47,7 +62,7 @@ Since the Monero remote nodes that I monitor are increasing and my page that dis
|
||||||
## Endpoint and Query Parameters
|
## Endpoint and Query Parameters
|
||||||
| Method | Endpoint |
|
| Method | Endpoint |
|
||||||
| ------ | ------------------------------------------------- |
|
| ------ | ------------------------------------------------- |
|
||||||
| GET | https://www.ditatompel.com/api/monero/remote-node |
|
| GET | `https://api.ditatompel.com/monero/remote-node` |
|
||||||
|
|
||||||
The response will display all the Monero remote node sorted from the highest percentage of uptime.
|
The response will display all the Monero remote node sorted from the highest percentage of uptime.
|
||||||
|
|
||||||
|
@ -72,98 +87,90 @@ Optional query string parameters:
|
||||||
|
|
||||||
For example, if you want to **list CORS enabled Monero nodes using https from United States sorted from recently checked node**:
|
For example, if you want to **list CORS enabled Monero nodes using https from United States sorted from recently checked node**:
|
||||||
```shell
|
```shell
|
||||||
curl -sL 'https://www.ditatompel.com/api/monero/remote-node?cors=true&protocol=https&country=us&orderby=lastcheck-desc' | jq
|
curl -sL 'https://api.ditatompel.com/monero/remote-node?cors=true&protocol=https&country=us&orderby=lastcheck-desc' | jq
|
||||||
```
|
```
|
||||||
|
|
||||||
## Response Header
|
## Response Header
|
||||||
The response header includes the **HTTP status code** and the `content-type`. Clients that receive a HTTP status code other than `200` and `content-type` other than `application/json` must back-off.
|
The response header includes the **HTTP status code** and the `content-type`. Clients that receive a HTTP status code other than `200` and `content-type` other than `application/json` must back-off.
|
||||||
|
|
||||||
In addition, I added custom headers `x-ditatompel-rate-limit-*` to limit users from making excessive queries to the server.
|
|
||||||
|
|
||||||
- `x-ditatompel-rate-limit-limit`: Your IP address initial quota for given period.
|
|
||||||
- `x-ditatompel-rate-limit-remaining`: Approximate number of requests left to use.
|
|
||||||
- `x-ditatompel-rate-limit-reset`: Approximate number of seconds to end of period.
|
|
||||||
|
|
||||||
The ratelimits period is currently set to 1 hour and initial quota is 3600 requests. It means 1 request every second per IP (you won't get different result if you perform same API calls in short period of time anyway).
|
|
||||||
|
|
||||||
## Response Body
|
## Response Body
|
||||||
The response body includes the information of the query result, query status, and error messages, if available, and metadata for debugging purpose. In the example below, the response body of:
|
The response body includes the information of the query result, query status, and response message. In the example below, the response body of:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
curl -sL 'https://www.ditatompel.com/api/monero/remote-node?protocol=https&country=id' | jq
|
curl -sL 'https://api.ditatompel.com/monero/remote-node?country=de' | jq
|
||||||
```
|
```
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"success": 1,
|
|
||||||
"status": "ok",
|
"status": "ok",
|
||||||
"message": "Query success",
|
"message": "Query Ok",
|
||||||
"data": [
|
"data": [
|
||||||
{
|
{
|
||||||
"hostname": "xmrnode1.ditatompel.com",
|
"hostname": "xmr-node.cakewallet.com",
|
||||||
"port": 443,
|
"ip": "172.104.202.210",
|
||||||
"ip_address": "103.244.206.102",
|
"port": 18081,
|
||||||
"protocol": "https",
|
"protocol": "http",
|
||||||
"is_tor": false,
|
"is_tor": false,
|
||||||
"status": "online",
|
"is_available": true,
|
||||||
"nettype": "mainnet",
|
"nettype": "mainnet",
|
||||||
"last_height": 2892329,
|
"last_height": 3074012,
|
||||||
"adjusted_time": 1684869115,
|
"adjusted_time": 1706708935,
|
||||||
"database_size": 171798691840,
|
"database_size": 193273528320,
|
||||||
"difficulty": 282381487137,
|
"difficulty": 255349054158,
|
||||||
"uptime": 99.49,
|
"node_version": "",
|
||||||
|
"uptime": 99.95,
|
||||||
"estimate_fee": 20000,
|
"estimate_fee": 20000,
|
||||||
"asn": 131759,
|
"asn": 63949,
|
||||||
"asn_name": "IDNIC-WDS-AS-ID",
|
"asn_name": "Akamai Connected Cloud",
|
||||||
"country": "ID",
|
"cc": "DE",
|
||||||
"city": "Tangerang",
|
"country_name": "Germany",
|
||||||
"postal": 0,
|
"city": "Frankfurt am Main",
|
||||||
"last_checked": 1684869296,
|
"latitude": 1.2868,
|
||||||
"cors": true,
|
"longitude": 103.8503,
|
||||||
|
"date_entered": 1632724330,
|
||||||
|
"last_checked": 1706708889,
|
||||||
"last_check_statuses": [
|
"last_check_statuses": [
|
||||||
null,
|
|
||||||
1,
|
1,
|
||||||
0,
|
1,
|
||||||
|
1,
|
||||||
1,
|
1,
|
||||||
1
|
1
|
||||||
|
],
|
||||||
|
"cors": false
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
|
||||||
"@meta": {
|
|
||||||
"cache": true,
|
|
||||||
"ttl": 32,
|
|
||||||
"response_time": 0.332
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
- `success`: *unsigned int*, `1` means everything looks good.
|
|
||||||
- `status`: *string*, `ok` means everything looks good.
|
- `status`: *string*, `ok` means everything looks good.
|
||||||
- `message`: *string*, Information related to your query, *success* or *error* message if any.
|
- `message`: *string*, Information related to your query, *success* or *error* message if any.
|
||||||
- `data`: *array* of nodes structure as follows:
|
- `data`: *array* of nodes structure as follows:
|
||||||
- `hostname`: *string*, The hostname / nodes IP address.
|
- `hostname`: *string*; The hostname / nodes IP address.
|
||||||
|
- `ip`: *string*; The IP address of node, empty string if hostname is not resolveable (Eg.: TOR nodes)
|
||||||
- `port`: *unsigned int*; TCP port the nodes is using to listen to RPC calls.
|
- `port`: *unsigned int*; TCP port the nodes is using to listen to RPC calls.
|
||||||
- `protocol`: *string*, The protocol used by nodes to listen RPC calls. This can be `http`, `https` or `empty string`.
|
- `protocol`: *string*; The protocol used by nodes to listen RPC calls. This can be `http`, `https` or `empty string`.
|
||||||
- `is_tor`: *boolean*, whether the node is accessed through the Tor network.
|
- `is_tor`: *boolean*; whether the node is accessed through the Tor network.
|
||||||
- `status`: *string*, General Monero daemon RPC status. `online` means everything looks good and nodes is syncronized to the network, `offline` means node wasn't ready or my bots can't connect to nodes RPC daemon.
|
- `is_available`: *boolean*; whether the node is online or not. False may means node wasn't ready or my bots can't connect to nodes RPC daemon.
|
||||||
- `nettype`: *string*; Network type (one of `mainnet`, `stagenet` or `testnet`).
|
- `nettype`: *string*; Network type (one of `mainnet`, `stagenet` or `testnet`).
|
||||||
- `last_height`: *unsigned int*; Current length of longest chain known to daemon.
|
- `last_height`: *unsigned int*; Current length of longest chain known to daemon.
|
||||||
- `adjusted_time`: *unsigned int*; Current time approximated from chain data, as Unix time.
|
- `adjusted_time`: *unsigned int*; Current time approximated from chain data, as Unix time.
|
||||||
- `database_size`: *unsigned int*; The size of the blockchain database, in bytes.
|
- `database_size`: *unsigned int*; The size of the blockchain database, in bytes.
|
||||||
- `difficulty`: *unsigned int*; Least-significant 64 bits of the 128-bit network difficulty.
|
- `difficulty`: *unsigned int*; Least-significant 64 bits of the 128-bit network difficulty.
|
||||||
- `uptime`: *float*, Uptime percentage of nodes for last 1 month. This likely **not** the real uptime value since my bots may experiencing network problems (I set connection timeout for 10 seconds).
|
- `node_version`: *string*; Vesion of remote monero node is running.
|
||||||
|
- `uptime`: *float*; Uptime percentage of nodes for last 1 month. This likely **not** the real uptime value since my bots may experiencing network problems (I set connection timeout for 60 seconds).
|
||||||
- `estimate_fee`: *unsigned int*; Amount of fees estimated per byte in atomic units. This just fee estimation, Malicious actors who running remote nodes [still can return high fee only when you about to create a transactions](monero-tx-fee-node.jpg).
|
- `estimate_fee`: *unsigned int*; Amount of fees estimated per byte in atomic units. This just fee estimation, Malicious actors who running remote nodes [still can return high fee only when you about to create a transactions](monero-tx-fee-node.jpg).
|
||||||
- `asn`: *unsigned int*, The AS number that owns nodes IP address.
|
- `asn`: *unsigned int*; The AS number that owns nodes IP address, `0` if no information available.
|
||||||
- `asn_name`: *string*, The AS name that owns nodes IP address
|
- `asn_name`: *string*; The AS name that owns nodes IP addres.
|
||||||
- `country`: *string*, two-letter ISO 3166-1 country code nodes location, empty string if no information available.
|
- `country`: *string*; two-letter ISO 3166-1 country code nodes location, empty string if no information available.
|
||||||
- `city`: *string*, City location based on nodes IP address, empty string if no information available.
|
- `city`: *string*; City location based on nodes IP address, empty string if no information available.
|
||||||
- `postal`: *unsigned int*, Postal code based on nodes IP address, `0` if no information available.
|
- `latitude`: *float*; Approx. latitude (geographic coordinate).
|
||||||
- `last_checked`: *unsigned int*, The Unix time when my bots check the nodes status.
|
- `longitude`: *float*; Approx. longitude (geographic coordinate).
|
||||||
- `cors`: *boolean*, whether the node return with `Access-Control-Allow-Origin` header or not.
|
- `date_entered`: *unsigned int*, The Unix time when my bots start monitoring the node.
|
||||||
- `last_check_statuses`: *array* (size: 5) of last node status avaibility status. Possible values:
|
- `last_checked`: *unsigned int*, The Unix time when was the last time my bot checked into a monero node.
|
||||||
- `null` : not yet checked.
|
- `last_check_statuses`: *array* (size: `5`); last node avaibility status. Possible values:
|
||||||
- `0`: Offline
|
- `0`: Offline
|
||||||
- `1`: Online
|
- `1`: Online
|
||||||
|
- `2`: not yet checked.
|
||||||
|
- `cors`: *boolean*, whether the node return with `Access-Control-Allow-Origin` header or not.
|
||||||
- `@meta`: *object*, Additional information related to API calls for debuging purpose.
|
- `@meta`: *object*, Additional information related to API calls for debuging purpose.
|
||||||
|
|
||||||
> You will get `200` response code, `ok` status, and **empty array** of data even if your query return no data.
|
> You will get `200` response code, `ok` status, and **empty array** of data even if your query return no data.
|
||||||
|
|
Loading…
Reference in a new issue