Skip to content

Commit

Permalink
Merge pull request #251 from input-output-hk/chore/bump-version
Browse files Browse the repository at this point in the history
Version 2.0.0-beta.0
  • Loading branch information
rhyslbw authored Jul 26, 2020
2 parents 9bd14b7 + be1ec6a commit f830e5b
Show file tree
Hide file tree
Showing 11 changed files with 68 additions and 20 deletions.
47 changes: 47 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,53 @@
Changelog
=========

## 2.0.0-beta.0
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.

### Compatible with:

- [`cardano-node`: `1.18.0`](https://github.com/input-output-hk/cardano-node/releases/tag/1.18.0)
- [`cardano-db-sync`: `3.0.0`](https://github.com/input-output-hk/cardano-db-sync/releases/tag/3.0.0) - Note: The database must be recreated using the new version.

## Features
### New Queries
- `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](https://hasura.io/docs/1.0/graphql/manual/hasura-cli/install-hasura-cli.html), which
is included in the [Dockerfile](./Dockerfile) and [NixOS](./nix/nixos/cardano-graphql-service.nix)
service, however outside of this you must install and place `hasura` on PATH.
- A new API package [`@cardano-graphql/api-genesis`](./packages/api-genesis/README.md) 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.

## Breaking Changes :warning:
### Removed fields
- `cardanoDbSync.slotDiffFromNetworkTip` **removed** in reponse to a change in strategy for determining
sync status with `cardano-db-sync` determining sync status relies on a chain
that has produce
- `Block.slotWithinEpoch` **removed** due to complexity with variation across eras. The Genesis API has information
for calculations based on context.

### Changed fields
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.createdAt` -> `Block.forgedAt`
- `Block.createdBy` -> `Block.slotLeader` links to an object, with a nullable `stakePool` field. For
previous behaviour, `Block.slotLeader.description` can be used, however the description prefixes have
changed upstream from `SlotLeader` to `ByronGenesis`

## Chores
- Migrations have been squashed into a single step.

## 1.0.0
## Features
- Optimised versions of some key aggregated queries:
Expand Down
7 changes: 4 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ services:
hasura:
build:
context: ./packages/api-cardano-db-hasura/hasura
image: inputoutput/cardano-graphql-hasura:${CARDANO_GRAPHQL_VERSION:-1.0.0}
image: inputoutput/cardano-graphql-hasura:${CARDANO_GRAPHQL_VERSION:-2.0.0-beta.0}
ports:
- "8090:8080"
- ${HASURA_PORT:-8090}:8080
depends_on:
- "postgres"
restart: on-failure
Expand All @@ -87,9 +87,10 @@ services:
build:
context: .
target: server
image: inputoutput/cardano-graphql:${CARDANO_GRAPHQL_VERSION:-1.0.0}
image: inputoutput/cardano-graphql:${CARDANO_GRAPHQL_VERSION:-2.0.0-beta.0}
environment:
- CACHE_ENABLED=true
- GENESIS_FILE_BYRON=/configuration/genesis_byron.json
- GENESIS_FILE_SHELLEY=/configuration/genesis_shelley.json
- HASURA_URI=http://hasura:8080
- POSTGRES_HOST=postgres
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cardano-graphql",
"description": "A TypeScript monorepo. Includes a server package and API modules for flexible implementation",
"version": "1.0.0",
"version": "2.0.0-beta.0",
"private": true,
"workspaces": [
"packages/*"
Expand All @@ -23,7 +23,7 @@
"service-dependencies": "docker-compose config --services | grep -v \"cardano-graphql\" | xargs docker-compose",
"start:mainnet": "GENESIS_FILE_BYRON=${PWD}/config/network/mainnet/genesis_byron.json GENESIS_FILE_SHELLEY=${PWD}/config/network/mainnet/genesis_shelley.json HASURA_URI=http://localhost:8090 yarn workspace @cardano-graphql/server start",
"start:shelley_testnet": "GENESIS_FILE_SHELLEY=${PWD}/config/network/shelley_testnet/genesis_shelley.json yarn workspace @cardano-graphql/server start",
"start:mainnet_candidate_3": "GENESIS_FILE_BYRON=${PWD}/config/network/mainnet_candidate_3/genesis_byron.json GENESIS_FILE_SHELLEY=${PWD}/config/network/mainnet_candidate_3/genesis_shelley.json yarn workspace @cardano-graphql/server start",
"start:mainnet_candidate_3": "GENESIS_FILE_BYRON=${PWD}/config/network/mainnet_candidate_3/genesis_byron.json GENESIS_FILE_SHELLEY=${PWD}/config/network/mainnet_candidate_3/genesis_shelley.json HASURA_URI=http://localhost:8090 yarn workspace @cardano-graphql/server start",
"test": "yarn workspaces run test"
},
"contributors": [
Expand Down
6 changes: 3 additions & 3 deletions packages/api-cardano-db-hasura/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cardano-graphql/api-cardano-db-hasura",
"version": "1.0.0",
"version": "2.0.0-beta.0",
"description": "Module for interfacing with the Cardano DB, populated by cardano-db-sync-extended that utilises Hasura for a powerful query interface",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down Expand Up @@ -32,7 +32,7 @@
"schema.graphql"
],
"dependencies": {
"@cardano-graphql/util": "1.0.0",
"@cardano-graphql/util": "2.0.0-beta.0",
"@graphql-tools/delegate": "^6.0.10",
"@graphql-tools/schema": "^6.0.9",
"@graphql-tools/wrap": "^6.0.9",
Expand All @@ -50,7 +50,7 @@
"set-interval-async": "^1.0.33"
},
"devDependencies": {
"@cardano-graphql/util-dev": "1.0.0",
"@cardano-graphql/util-dev": "2.0.0-beta.0",
"@graphql-codegen/cli": "^1.15.2",
"@graphql-codegen/typescript": "^1.15.2",
"@graphql-codegen/typescript-graphql-files-modules": "^1.15.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/api-genesis/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Cardano GraphQL - API Genesis

This API module provides access to the network's genesis file.
This API module provides access to the network's genesis files, keyed by era.
4 changes: 2 additions & 2 deletions packages/api-genesis/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cardano-graphql/api-genesis",
"version": "1.0.0",
"version": "2.0.0-beta.0",
"description": "Query the network genesis",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down Expand Up @@ -38,7 +38,7 @@
"graphql-scalars": "^1.2.2"
},
"devDependencies": {
"@cardano-graphql/util-dev": "1.0.0",
"@cardano-graphql/util-dev": "2.0.0-beta.0",
"@graphql-codegen/cli": "^1.15.2",
"@graphql-codegen/typescript": "^1.15.2",
"@graphql-codegen/typescript-graphql-files-modules": "^1.15.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cardano-graphql/cli",
"version": "1.0.0",
"version": "2.0.0-beta.0",
"description": "Management tool for managing a Cardano GraphQL deployment",
"main": "./dist/index.js",
"bin": {
Expand Down
2 changes: 1 addition & 1 deletion packages/client-ts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cardano-graphql/client-ts",
"version": "1.0.0",
"version": "2.0.0-beta.0",
"description": "A client package for Cardano GraphQL, including the GraphQL schema and TypeScript definitions generated from it",
"repository": {
"type": "git",
Expand Down
8 changes: 4 additions & 4 deletions packages/server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cardano-graphql/server",
"version": "1.0.0",
"version": "2.0.0-beta.0",
"description": "Serve the Cardano GraphQL API over HTTP",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand All @@ -24,8 +24,8 @@
},
"homepage": "https://github.com/input-output-hk/cardano-graphql/blob/master/packages/server/README.md",
"dependencies": {
"@cardano-graphql/api-cardano-db-hasura": "1.0.0",
"@cardano-graphql/api-genesis": "1.0.0",
"@cardano-graphql/api-cardano-db-hasura": "2.0.0-beta.0",
"@cardano-graphql/api-genesis": "2.0.0-beta.0",
"@graphql-tools/merge": "^6.0.10",
"apollo-metrics": "^1.0.1",
"apollo-server-core": "^2.14.3",
Expand All @@ -39,7 +39,7 @@
"ts-custom-error": "^3.1.1"
},
"devDependencies": {
"@cardano-graphql/util-dev": "1.0.0",
"@cardano-graphql/util-dev": "2.0.0-beta.0",
"@types/graphql-depth-limit": "^1.1.2",
"@types/node": "^14.0.13",
"shx": "^0.3.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/util-dev/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cardano-graphql/util-dev",
"version": "1.0.0",
"version": "2.0.0-beta.0",
"description": "Common development utilities",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand All @@ -22,7 +22,7 @@
},
"homepage": "https://github.com/input-output-hk/cardano-graphql/blob/master/packages/util-dev/README.md",
"devDependencies": {
"@cardano-graphql/util": "1.0.0",
"@cardano-graphql/util": "2.0.0-beta.0",
"shx": "^0.3.2"
},
"directories": {
Expand Down
2 changes: 1 addition & 1 deletion packages/util/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cardano-graphql/util",
"version": "1.0.0",
"version": "2.0.0-beta.0",
"description": "Common utilities",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down

0 comments on commit f830e5b

Please sign in to comment.