You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On MacOS, you'll need to install `libffi` and `bzip2` if they aren't already installed.
@@ -273,6 +273,25 @@ info:
273
273
$ man kupo
274
274
```
275
275
276
+
# Custom database indexes
277
+
278
+
Kupo supports custom database indexes, provided by environment variable.
279
+
Hence, any environment variable prefixed with `KUPO_INDEX_` will be parsed
280
+
and interpreted as a custom database index, managed with the pre-defined
281
+
indexes.
282
+
283
+
For example, you can add a custom index `inputsByPaymentCredentialUnspent`
284
+
for matching unspent inputs by payment cred by setting the following
285
+
environment variable:
286
+
287
+
```env
288
+
KUPO_INDEX_inputsByPaymentCredentialUnspent="inputs(payment_credential COLLATE NOCASE) WHERE spent_at IS NULL"
289
+
```
290
+
291
+
Use this carefully, as too many indexes may greatly impact the database sync performances and also other queries.
292
+
293
+
Existing indexes and the overall database internal schema is [available here](https://github.com/CardanoSolutions/kupo/tree/master/db#overview).
294
+
276
295
# Patterns
277
296
278
297
## Overview
@@ -569,7 +588,7 @@ info:
569
588
| Last Allegra block | N/A | N/A |
570
589
| Last Mary block | N/A | N/A |
571
590
| Last Alonzo block | 259180 | 0ad91d3bbe350b1cfa05b13dba5263c47c5eca4f97b3a3105eba96416785a487 |
572
-
| Last Conway block | 55814394 | bdd4baa2c81d0500a695f836332193ea06c2ce364e585057142220fc0782144c |
591
+
| Last Babbage block | 55814394 | bdd4baa2c81d0500a695f836332193ea06c2ce364e585057142220fc0782144c |
573
592
| Last Conway block | N/A | N/A |
574
593
575
594
See <a target="_blank" href="https://github.com/input-output-hk/cardano-configurations/tree/master/network/preview">configuration files for <strong>Preview</strong></a>.
description: The resolved datum, if available. The field is only and always present (yet may be `null`) if `?resolve_hashes` was set.
1392
+
oneOf:
1393
+
- <<: *BinaryData
1394
+
description: A serialized Plutus' Data.
1395
+
- type: "null"
1396
+
description: None or unknown datum.
1397
+
datum_type:
1398
+
$ref: "#/components/schemas/DatumType"
1399
+
script_hash:
1400
+
$ref: "#/components/schemas/ScriptHash"
1401
+
script:
1402
+
description: The resolved script, if available. The field is only and always present (yet may be `null`) if `?resolve_hashes` was set.
1403
+
oneOf:
1404
+
- $ref: "#/components/schemas/Script"
1405
+
- type: "null"
1406
+
description: None or unknown script.
1407
+
created_at:
1408
+
<<: *Point
1409
+
description: Block reference at which this transaction was included in the ledger.
1410
+
spent_at:
1411
+
description: Block reference at which this transaction input was spent, if any.
1412
+
oneOf:
1413
+
- $ref: "#/components/schemas/SpentAt"
1414
+
- type: "null"
1415
+
1320
1416
Health:
1321
1417
type: object
1322
1418
description: An overview of the server & connection status. Note that, when `most_recent_checkpoint` and `most_recent_node_tip` are equal, the index is fully synchronized.
@@ -1325,6 +1421,8 @@ components:
1325
1421
- connection_status
1326
1422
- most_recent_checkpoint
1327
1423
- most_recent_node_tip
1424
+
- seconds_since_last_block
1425
+
- network_synchronization
1328
1426
- configuration
1329
1427
- version
1330
1428
properties:
@@ -1346,6 +1444,20 @@ components:
1346
1444
description: Absolute slot number of the current tip of the node.
1347
1445
- type: "null"
1348
1446
description: Absolute slot number of the current tip of the node.
1447
+
seconds_since_last_block:
1448
+
oneOf:
1449
+
- type: integer
1450
+
description: Number of seconds elapsed since the last block was ingested by Kupo.
1451
+
- type: "null"
1452
+
description: Number of seconds elapsed since the last block was ingested by Kupo.
1453
+
network_synchronization:
1454
+
oneOf:
1455
+
- type: number
1456
+
minimum: 0
1457
+
maximum: 1
1458
+
description: A progress percentage of the synchronization towards the node tip.
1459
+
- type: "null"
1460
+
description: A progress percentage of the synchronization towards the node tip.
1349
1461
configuration:
1350
1462
type: object
1351
1463
description: A summary of hand-picked configuration parameters.
@@ -1371,20 +1483,6 @@ components:
1371
1483
- `connected` and `disconnected` (from `connection_status`) are encoded as `1.0` and `0.0` respectively.
1372
1484
- `installed` and `deferred` (from `configuration.indexes`) are encoded as `1.0` and `0.0` respectively.
1373
1485
- `version` is not present in the Prometheus metrics.
1374
-
examples:
1375
-
response:
1376
-
value: |
1377
-
# TYPE kupo_connection_status gauge
1378
-
kupo_connection_status 1.0
1379
-
1380
-
# TYPE kupo_most_recent_checkpoint counter
1381
-
kupo_most_recent_checkpoint 294998
1382
-
1383
-
# TYPE kupo_most_recent_node_tip counter
1384
-
kupo_most_recent_node_tip 71753381
1385
-
1386
-
# TYPE kupo_configuration_indexes gauge
1387
-
kupo_configuration_indexes 1.0
1388
1486
1389
1487
parameters:
1390
1488
asset-name:
@@ -1778,6 +1876,13 @@ paths:
1778
1876
Optionally, use `?resolve_hashes` to automatically resolve and include `datum` and `script` associated with hash references, if available. Datums and scripts can otherwise be fetched using the [_Get Datum by Hash_](#tag/Datums/paths/~1datums~1{datum-hash}/get) and [_Get Script by Hash_](#tag/Scripts/paths/~1scripts~1{script-hash}/get) endpoints respectively.
1779
1877
1780
1878
Note that it is generally a bad idea to fetch **ALL matches** for indexes built off permissive patterns (e.g. `*`), for the server will yield a large response.
1879
+
1880
+
> <sup><strong>TIP</strong></sup> <br/>
1881
+
>
1882
+
> You can customize coins and assets quantities encoding to always be strings instead of integers through the
0 commit comments