All notable changes to this project will be documented in this file. See standard-version for commit guidelines.
8.0.0 (2023-02-03)
- drop support for average aggregation fields
- align GraphQL types to conform with database and Hasura string casts
- api-cardano-db-hasura: separate DB and Hasura management tasks to new process
- api-cardano-db-hasura: separate DB and Hasura management tasks to new process (8acb58f)
- improve uncaught exception logging (800a587)
- api-cardano-db-hasura: remove VARCHAR limits from Asset table (a4092f8)
- api-cardano-db-hasura: retry initialization of data fetcher (d5a794d)
- server: avoid producing NaN in asset sync percentage calc, and clamp to max 100% (b48e804)
- align GraphQL types to conform with database and Hasura string casts (ad4e736)
- drop support for average aggregation fields (3cd6445)
7.0.2 (2022-10-03)
7.0.1 (2022-09-19)
- api-cardano-db-hasura: correct close and error handling of Ogmios connection (df82008)
- api-cardano-db-hasura: mitigate unexpected Ogmios socket disconnect (3d81bf5)
- gracefully handle Ogmios socket disconnection (18bf3e1)
- mount local config into cardano-node-ogmios (f055378)
7.0.0 (2022-08-19)
cardano-node
:1.35.3
cardano-ogmios
:v5.5.5
cardano-db-sync
:13.0.4
- Note: The database must be recreated using the new version.hasura/graphql-engine
:1.3.3
- collateral outputs
- add ProtocolParams type to better represent current protocol params
- remove remnants of previously deprecated config
- Reward.receivedIn nullability
Reward.stakePool
is now nullable to handle rewards of typetreasury
orreserves
.
- add
TransactionOutput
|CollateralOutput
.paymentCredential
(e6e2d45) - add Transaction.referenceInputs (2c5e0b5)
- collateral outputs (a222cb4)
- support Babbage block (fe484e1)
- support Plutus data (58f6c48)
- remove remnants of previously deprecated config (c3fc2aa)
- update to Ogmios v5.5.0 cardano-db-sync 13.0.0 (b821f21)
Redeemer.fee
is nullable in the Babbage era (813a7ae)- add ProtocolParams type to better represent current protocol params (73cf785)
- api-cardano-db-hasura: define response as optional in metadata server errors (ca5d556)
- cli: correct services option (f600d31)
- gracefully shutdown cardano-db-sync (2f02e56), closes /github.com/CardanoSolutions/ogmios/blob/c32341e56ccbeb1cf1e803d4607699668a1e2cc2/Dockerfile#L73
- Reward.receivedIn nullability (9a3dcf5)
- trim whitespace from credentials in server config (b40a596)
6.2.0 (2022-01-26)
- support change to asset ticker length (b858445)
6.1.0 (2021-12-09)
cardano-node
:1.31.0
cardano-ogmios
:v4.2.1
cardano-db-sync
:12.0.0
- Note: The database must be recreated using the new version.hasura/graphql-engine
:1.3.3
- add missing Transaction.collateral Hasura table config (8a5f93e)
6.0.0 (2021-10-03)
Reward.stakePool
is now nullable to handle rewards of typetreasury
orreserves
.
- include all reward types in Reward model, adds
type
field (6f1ddd9) Reward.receivedIn
(e9e5715)TransactionInput_order_by.transaction
(f775c45)- use Asset table sync status to determine Server readiness (dfff8d5)
- add permission to Reward.type, and index the column (6f157a5)
- make METADATA_SERVER_URI required config (552c5e8)
5.1.0 (2021-08-27)
cardano-node
:1.29.0
cardano-ogmios
:v4.0.0-beta.9
cardano-db-sync
:11.0.0
- Note: The database must be recreated using the new version.hasura/graphql-engine
:1.3.3
- add network suffix to Docker Compose file (53059b9)
- guard sync drift between cardano-db-sync and cardano-graphql (3c9707b)
- properly handle error as known exception (755c500)
5.1.0-beta.1 (2021-08-15)
cardano-node
:alonzo-purple-1.0.1
cardano-ogmios
:v4.0.0-beta.6
cardano-db-sync
:alonzo-purple-1.0.1
- Note: The database must be recreated using the new version.hasura/graphql-engine
:1.3.3
- support Docker pull and run to skip builds (ee03a57)
- invalid cache target in compose file (4b4dfc3)
5.1.0-beta.0 (2021-08-12)
cardano-node
:alonzo-purple-1.0.1
cardano-db-sync
:alonzo-purple-1.0.1
- Note: The database must be recreated using the new version.hasura/graphql-engine
:1.3.3
- feature: Alonzo data mapping (eff1d9c)
- feature: add
AlonzoGenesis
(d600dc0) - feature: add Alonzo blocks to conditional chain following (8d6aaf4)
- Guard logic (110deaa)
- OperationRequiresNodeInCurrentEra -> OperationRequiresSyncedNode (6165965)
- startup race-condition with chain-followers (0b15315)
5.0.0 (2021-07-14)
cardano-node
:1.27.0
cardano-db-sync
:10.0.1
- Note: The database must be recreated using the new version.hasura/graphql-engine
:1.3.3
-
Asset.assetName
andAsset.assetId
are now typed asHex
, as the relationship fromAssets
toTokenMints
needed to be established using the underlying table, whereassetId
is not present. -
Configuration of the asset metadata fetching is now a single value.
POLLING_INTERVAL_METADATA_SYNC_INITIAL
andPOLLING_INTERVAL_METADATA_SYNC_ONGOING
are replaced byASSET_METADATA_UPDATE_INTERVAL
, which is the number of seconds before the service checks the registry for updates. -
AssetSupply.total is now an optional field, and can return null.
-
Transaction.metadata is now
JSON
type, notJSONObject
- Despite the name,
JSONObject
was mapped to the underlying JSON resolver as a workaround to avoid breaking changes.
- Despite the name,
-
The fields previously modelled on Token have been nested under Token.asset
-
tokens
andtokens_aggregate
have been removed in favour of assets and assets_aggregate
- Asset properties nested under
PaymentAddress.assets
are now underPaymentAddress.assets.asset
Block.merkleRoot
removed, as no longer part ofcardano-db-sync
schema. (8b3b718)
- Replaces the use of
cardano-cli
with Ogmios for interacting with the node using JSON-WSP, and implements the convenientcardano-node-ogmios
Docker image as a drop-in replacement for thecardano-node
image. - Sync assets using chain-sync protocol via Ogmios (784509e)
tokenMints
andtokenMints_aggregate
queries (f803b94)- add query complexity validations (24a14a9),
- add default query complexity calculations with arguments (b16c77d)
- implement complexity in resolvers (5664a55)
- use cardano-node config for lastConfiguredMajorVersion (5a621c2), closes #454
- add Epoch_bool_exp.startedAt (4cc580a)
- add TransactionOutput_bool_exp.index (34d5438)
- allow ordering of assets by token mint count (cfbb039)
- Asset metadata decimals (082f509)
- improve startup robustness (7054a59)
- The GraphQL server is now delayed until all modules are initialized, and running. If
cardano-db-sync
reboots, all modules are shutdown, and restarted and therefore links the server availability with a fully initialized stack.
- The GraphQL server is now delayed until all modules are initialized, and running. If
- Add order_by to asset query (5848c24)
- Asset_bool_exp.tokenMints (7616a49)
- assetFingerprint bug when no assetName present (9a61d91), closes #487
- await all promises in shutdown function (3d7ef11)
- await CardanoNodeClient init before starting server (f33f6aa)
- cardanoDbSyncMeta.initialized during startup (d6649cf)
- casing on invalid hereafter in GraphQL schema (854ec4a), closes #390
- Copy cardano-node config into Docker image (4bf4866)
- default metadata server URI (2a98055)
- disable CORS in Hasura graphql-engine (4499422), closes #392
- Ensure DB is in current era before completing HasuraClient initialization (0d43abc)
- guards on missing current epoch row (6204c96)
- log all error messages during service startup, not just
HostDoesNotExist
(c81aad8) - memory leak in Hasura GraphQL client (3c8511d)
- move current era check to be lazy operation (7830c91)
- move graphql-engine option under serve command (f76e944)
- policyId comparison expression type (99318cc), closes #485
- remove promise chaining cycle (8b55ca0), closes #459
- Reorder logging arguments based on Bunyan interface (46b26a0)
- Restore protocol params fetcher init (e86fc1a)
- scoping on package (82e2040)
- submitTransaction error mapping (3629725)
4.0.0 (2021-03-29)
cardano-node
:1.25.1
cardano-db-sync
:9.0.0
- Note: The database must be recreated using the new version.hasura/graphql-engine
:1.3.3
-
StakePool.url no longer URL type. The ledger does not validate the url value provided by the owner, therefore trying to impose rules around the structure will fail.
-
Transaction.metadata is now more accurately JSON type, not JSONObject. Despite the name, JSONObject was currently mapped to the underlying JSON resolver as a workaround to avoid breaking changes.
-
The fields previously modelled on Token have been nested under Token.asset. tokens and tokens_aggregate have been removed in favour of assets and assets_aggregate. Asset properties are now nested under PaymentAddress.summary.assetBalances.asset
- ActiveStake.stakePoolHash field name (08fe609)
- add Mint.asset relationship (0deaaac)
- add remaining Asset fields Hasura query used to fulfil paymentAddress query (879db94)
- batch asset synchronising operations (637d607)
- Block.merkelRoot -> Block.merkleRoot (b9e1e13)
- include rewards in ada circulating supply (69f23c1)
- StakePool.url is now type String (a661525)
- StakePoolRetirement_bool_exp.inEffectFrom type (96aa708)
- Correct Transaction.metadata type (79205a2)
- Remove cardano-cli ledger-state query, make AssetSupply.total optional (f86ef42)
- use cardano-node config for lastConfiguredMajorVersion (5a621c2), closes #454
- replace cardano-cli query with db lookup for protocol params (a6387b3)
- throw error in resolver rather than return it (dd9a031)
3.2.0 (2021-02-01)
cardano-node
:1.25.1
cardano-db-sync
:8.0.0
- Note: The database must be recreated using the new version.hasura/graphql-engine
:1.3.3
- Ada supply query (e716d51)
- Submit transaction mutation (29f1adb)
- Multi-asset support (86e4206)
- Structured logging (f948cf5)
- Improve delegation and active stake models (ad06274)
- Report sync progress in logs during initialisation (83279c3)
- GraphQL schema order_by (9869a48)
- guard against simultaneous data fetches (93e198f)
- Opt-out of Hasura CLI telemetry (196086c)
- pass logger to onFailedAttempt (1b8b0cf)
- Replaces the time-based logic to determine sync progress and initialisation state (b29ef3e), closes #248
3.1.1 (2020-12-21)
cardano-node
:1.24.2
cardano-db-sync
:7.1.0
- Note: The database must be recreated using the new version.hasura/graphql-engine
:1.3.3
3.1.0 (2020-12-10)
cardano-node
:1.24.2
cardano-db-sync
:7.1.0
- Note: The database must be recreated using the new version.hasura/graphql-engine
:1.3.3
- Transaction validity interval fields (ad9b4e5)
Transaction.invalidBefore
Transaction.invalidHereafter
- associated input fields
3.0.1 (2020-11-27)
cardano-node
:1.21.1
cardano-db-sync
:6.0.1
- Note: The database must be recreated using the new version.hasura/graphql-engine
:1.3.3
- add missing comparison operator fields to bool expressions (89addef)
- StakePool_bool_exp.rewards type (1f02a68)
3.0.0 (2020-11-05)
This new major version, now based on the current Node.js LTS, brings the second round of Shelley-era features to the API. Most notably, rewards, active stake captured at each epoch boundary, transaction metadata, protocol parameters in effect during the epoch, and custom types for the Bech32 values covered by CIP5.
You may be impacted by breaking changes, which are listed below.
cardano-node
:1.21.1
cardano-db-sync
:6.0.0
- Note: The database must be recreated using the new version.hasura/graphql-engine
:1.3.2
- Omitting the limit in queries will now return 2500 records, rather than 100
WHITELIST_PATH
is nowALLOW_LIST_PATH
HASURA_CLI_PATH
is now required configuration, however it's set in the Dockerfile and nix service by default.- All schema instances for stake addresses are now validated for the correct prefix using a custom scalar
Block.vrfKey
and the associated input types are now a validated for the correct prefix using a custom scalarStakePool.id
and the associated input types are now a validated for the correct prefix using a custom scalarHash32HexString
->Hash32Hex
Hash32HexString_comparison_exp
->Hash32Hex_comparison_exp
SlotLeader.hash
,StakePool.hash
,StakePoolOwner.hash
are nowHash28Hex
typeBlock.vrfKey
is now the bech32 encoded value as per CIP5. It's now typed asVRFVerificationKey
.
- Rewards (46cc878)
- top-level queries rewards and rewards_aggregate
- StakePool.rewards and StakePool.rewards_aggregate
StakePool.id
(3fc763c)- Bech32 encoded, prefixed with
pool
- Bech32 encoded, prefixed with
- Introduce ActiveStake concept (1b66fee)
- Snapshot of the stake linked to a registered stake key, per epoch.
- This features adds an activeStake query, and extends the Epoch type to include activeStake and activeStake_aggregate fields.
- top-level activeStake_aggregate query (8e13a52)
Epoch.protocolParams
andEpoch.nonce
(c08d652)Transaction.metadata
(8cec6e8)- Custom GraphQL scalars
- consolidate
api-genesis
withapi-cardano-db-hasura
(0f927c4) - upgrade to Node.js 14 (950852a)
- Require explicit path to hasura CLI executable (ca22d42)
- Remove depreciated config option
WHITELIST_PATH
(a2d00ff) - Change Hasura record limit from 100 to 2500 (212bc47), closes #333
- server configuration lifted to Dockerfile (167ff42)
- expose the API port (Removes the hard-coding) (e422734)
- accurately allocate hashes to 28 byte type (f9597bc)
- add port and custom column names to pool_relay mapping (879a51a), closes #328 #329
- Change Block.vrfKey type to String (a34c8aa)
- properly type ShelleyProtocolParams (a7a2c3a)
- remove invalid Genesis.shelley.protocolMagicId (a73ba1e), closes #327
- remove StakePool.withdrawals field (46dd937)
- typo in missing config error message (d904a72)
2.2.0 (2020-09-24)
- api-cardano-db-hasura: add Transaction.withdrawals (b608cc8)
- client-ts: combine graphql schemas in client package (bd52a16), closes #273
2.1.0 (2020-09-17)
cardano-node
:1.19.1
cardano-db-sync
:5.0.0
- Note: The database must be recreated using the new version.
- api-cardano-db-hasura: add custom $SECRET_DIR support for docker image (ff79b10)
- api-cardano-db-hasura: add Epoch.fees (4482338)
- api-cardano-db-hasura: add Transaction.deposit (2726d80)
- Add build arg to include genesis files (c06912d)
- Improve logging during retry attempts (e24df95)
- replace DB polling with postgres notification listener for migrations (e42eb3d)
- add missing GraphQL model for Delegation.transaction (3ac55b1)
- address ordering type mismatch in GraphQL schema (45f3c73)
- ensure migration is run before introspection (079a248)
- include @types/* packages in workspace devDependencies (6c5f075)
- include pools without metadata in StakePool view (d978094)
- api-cardano-db-hasura: harden schema introspection (3ca88b4), closes #281
- scope allow list to graphql path (bee2005), closes #303
- api-cardano-db-hasura: improve error handling with Cardano query delegation (4e532a3)
- api-cardano-db-hasura: Move each query to separate test (3b29f48)
- api-cardano-db-hasura: Properly model and relate StakePoolRetirements (a5fef40)
- api-cardano-db-hasura: Support 28 byte hex encoded hashes (9e28ffa)
- server: better align server config options (30a7534)
- server: rename whitelist to allow-list (eeeafa9)
- server: return HTTP 403 errors when rejecting disallowed queries (b8892ca)
This new major version brings the first round of Shelley-era features to the API, introduces a new genesis file API package, and hardens the migrations and metadata handling. This version is required for transitioning through the upcoming Shelley hard fork.
cardano-node
:1.18.0
cardano-db-sync
:3.1.0
- Note: The database must be recreated using the new version.
stakePools
,stakePools_aggregate
delegations
,delegations_aggregate
stakeRegistrations
,stakeRegistrations_aggregate
stakeDeregistrations
,stakeDeregistrations_aggregate
withdrawals
,withdrawals_aggregate
genesis
- Metadata and SQL migrations are now performed within the application layer, and make the service immune to schema
being removed should
cardano-db-sync
restart. using the Hasura CLI, which is included in the Dockerfile and NixOS service, however outside of this you must install and placehasura
on PATH. - A new API package
@cardano-graphql/api-genesis
allows access to the network genesis files. It's integrated into the server, with the config exposed as environment variables. As usual, the docker-compose.yaml serves as a good reference.
- The docker-compose file now mounts configuration managed in the repository, restoring the usual
separation of concerns with service configuration. The Docker images still have the
configuration included at build time, however in practice, being ready to managing your own
configuration if required is a good strategy. Simply copying the top level
config
and committing to source control gives you full control over the services using their native interface.
Cardano.networkName
removed. Use network magic from the genesis API identify networks.Cardano.protocolConst
,Cardano.slotDuration
,Cardano.startTime
,Cardano.slotsPerEpoch
removed. Access this info from the Genesis API.cardanoDbSync.slotDiffFromNetworkTip
removed in reponse to a change in strategy for determining sync status withcardano-db-sync
determining sync status relies on a chain that has produce
Dates we're previously formatted to ISO 3339, however ISO 8601 is being adopted with this release for alignment with the Shelley genesis file format and simplification when the precision is not required.
2017-10-03T21:43:51.000Z
->2017-10-03T21:43:51Z
Block.createdBy
->Block.slotLeader
links to an object, with a nullablestakePool
field. For previous behaviour,Block.slotLeader.description
can be used, however the description prefixes have changed upstream fromSlotLeader
toByronGenesis
Block.createdAt
->Block.forgedAt
Block.slotWithinEpoch
->Block.slotInEpoch
- Migrations have been squashed into a single step.
- Optimised versions of some key aggregated queries:
Block.transactionsCount
Epoch.transactionsCount
Epoch.blocksCount
Cardano.networkName
Transaction.size
Transaction.blockIndex
- Allow explicit ordering of
Transaction.outputs
by their naturalindex
Cardano
now matches the postgres view, and is an improvement over the previous version which performed two queries.- CLI tool
cgql
with commands to assist with Docker-based deployments, including init, snapshotting, and db rebuild. - Establish relationships to easily access transaction and block information from inputs and outputs
TransactionInput.transaction
TransactionInput.sourceTransaction
(where it was an output)TransactionOutput.transaction
CardanoDbMeta
viaQuery.cardanoDbMeta
exposes information to understand if the dataset is complete including:initialized
,syncPercentage
, andslotDiffFromNetworkTip
. Theepoch
data is incomplete untilinitialized = true
, which takes around 2 hours for the initial sync as of block number4388632
.syncPercentage
orslotDiffFromNetworkTip
provides progress.- The codebase is now modularized to enable new API segments to be added alongside as an extension, composition of services
for more use-cases, ability to import the executable schema and host on a different server. The packages are published,
to npm, or can be built from source:
- @cardano-graphql/server
- @cardano-graphql/api-cardano-db-hasura
- @cardano-graphql/client-ts
- @cardano-graphql/cli
- @cardano-graphql/util-dev
- @cardano-graphql/util
- Packages are now managed via an offline npm package cache, to facilitate reproducible builds when the --offline flag is passed to yarn install
- PostgreSQL views are now being managed in this codebase, so either switch to the
new Docker image
inputoutput/cardano-graphql-hasura
, or use the Hasura CLI as demonstrated in the entrypoint This change was needed to be compatible with the migration strategy determind bycardano-db-sync
, where the migrations need to be applied on each start of the service. The custom Docker image makes it possible to check your own docker-compose file into source control, as it supports Docker secrets, and also removes the requirement to clone this source repo to get data for mounting at runtime. - Transaction and Block IDs are now labelled as
hash
, aligning with the domain terminology. Block.merkelRootHash
->Block.merkelRoot
- The aggregated and known very large numbers are now typed as String. Cardano JS has utilities to work with these return values, currently limited to currency conversion.
Transaction.fee
previouslyString
, nowBigInt
- Entrypoint for the service previously found in
./dist/index.js
is now./packages/server/dist/index.js
after building. Cardano.blockHeight
removed in favour ofCardano.tip.number
, wheretip
= the most recentBlock
. This unlocks more information such asslotNo
, and capability to traverse the chain etc.- Dates are now coerced to RFC 3339 UTC date-time strings
- Updates to Hasura 1.2.1
- Improves CI process by consolidating the Jest snapshot files.
Block.nextBlock
Block.epochNo
is a workaround for the less performant Block.epoch.number
- Can now scope aggregated queries to the same filters as the non-aggregated counterparts
- Improves the domain-specific input type filtering, enabling control of results for Address summaries, and to deal with the model edge-cases such as Epoch Boundary Blocks needing to be excluded in most cases.
- Adds logical operators to filter fields, allowing stacking and more powerful expressions.
- Adds Block.createdBy identifier
- Corrected unnecessarily nullable fields in schema.
- Removed invalid Epoch_order_by fields
- Updates the pacakage manager to Yarn
- Runs the test suite on Jenkins with e2e assurance, deploying the service in a Docker container, and using an instance of ApolloClient to call the HTTP server. Previously the same setup suited to local development was being used, and was missing the full simulation of a real client.
- Extends API to include support for aggregated Epoch results
- Extends API to include network metadata:
protocolConst
,slotDuration
, andstartTime
- Extends API to include support for aggregated results
- Optional in-memory cache
- More control over nested list results
- Adds a load test
Initial pre-production release, scoped to the Byron-era network.