diff --git a/CHANGELOG.md b/CHANGELOG.md index 91e51c23..c0955b73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,25 @@ Changelog - Allow explicit ordering of `Transaction.outputs` by their natural `index` - `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` via `Query.cardanoDbMeta` exposes information to understand if the dataset is complete including: + `initialized`, `syncPercentage`, and `slotDiffFromNetworkTip`. The `epoch` data is incomplete until `initialized = true` + , which takes around 2 hours for the initial sync as of block number `4388632`. `syncPercentage` or + `slotDiffFromNetworkTip` 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 + + ## Breaking changes - PostgreSQL views are now being managed in this codebase, so either switch to the @@ -26,6 +45,11 @@ Changelog - `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` previously `String`, now `BigInt` +- Entrypoint for the service previously found in `./dist/index.js` is now `./packages/server/dist/index.js` after building. +- `Cardano.blockHeight` removed in favour of `Cardano.tip.number`, where `tip` = the most recent `Block`. This unlocks +more information such as `slotNo`, and capability to traverse the chain etc. +- Dates are now coerced to RFC 3339 UTC date-time strings + ### Chores - Updates to Hasura 1.2.1 diff --git a/docker-compose.yml b/docker-compose.yml index a6378af5..6959aac8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -58,7 +58,7 @@ services: hasura: build: context: ./packages/api-cardano-db-hasura/hasura - image: inputoutput/cardano-graphql-hasura:v1.0.0-rc.12 + image: inputoutput/cardano-graphql-hasura:v1.0.0-rc.13 ports: - "8090:8080" depends_on: @@ -86,7 +86,7 @@ services: build: context: . target: server - image: inputoutput/cardano-graphql:v1.0.0-rc.12 + image: inputoutput/cardano-graphql:v1.0.0-rc.13 environment: - CACHE_ENABLED=true - HASURA_URI=http://hasura:8080 diff --git a/package.json b/package.json index 9da6dfad..29d59a08 100644 --- a/package.json +++ b/package.json @@ -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-rc.12", + "version": "1.0.0-rc.13", "private": true, "workspaces": [ "packages/*" diff --git a/packages/api-cardano-db-hasura/package.json b/packages/api-cardano-db-hasura/package.json index e5b9cf7d..721c3bf7 100644 --- a/packages/api-cardano-db-hasura/package.json +++ b/packages/api-cardano-db-hasura/package.json @@ -1,6 +1,6 @@ { "name": "@cardano-graphql/api-cardano-db-hasura", - "version": "1.0.0-rc.12", + "version": "1.0.0-rc.13", "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", @@ -32,7 +32,7 @@ "schema.graphql" ], "dependencies": { - "@cardano-graphql/util": "1.0.0-rc.12", + "@cardano-graphql/util": "1.0.0-rc.13", "@graphql-tools/delegate": "^6.0.10", "@graphql-tools/schema": "^6.0.9", "@graphql-tools/wrap": "^6.0.9", @@ -48,7 +48,7 @@ "p-retry": "^4.2.0" }, "devDependencies": { - "@cardano-graphql/util-dev": "1.0.0-rc.12", + "@cardano-graphql/util-dev": "1.0.0-rc.13", "@graphql-codegen/cli": "^1.15.2", "@graphql-codegen/typescript": "^1.15.2", "@graphql-codegen/typescript-graphql-files-modules": "^1.15.2", diff --git a/packages/cli/package.json b/packages/cli/package.json index 1831e509..c4c72c56 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@cardano-graphql/cli", - "version": "1.0.0-rc.12", + "version": "1.0.0-rc.13", "description": "Management tool for managing a Cardano GraphQL deployment", "main": "./dist/index.js", "bin": { @@ -11,7 +11,7 @@ "access": "public" }, "scripts": { - "build": "tsc -b ./src && shx cp src/Docker/docker-compose.yml dist/Docker/", + "build": "tsc -b ./src && shx cp ../../docker-compose.yml dist/Docker/", "cleanup": "shx rm -rf dist node_modules", "dev": "ts-node-dev --no-notify --respawn --transpileOnly src/index.ts", "global:add": "yarn build && yarn global add file:$PWD", diff --git a/packages/cli/src/Docker/docker-compose.yml b/packages/cli/src/Docker/docker-compose.yml index 9c6e33b8..6959aac8 100644 --- a/packages/cli/src/Docker/docker-compose.yml +++ b/packages/cli/src/Docker/docker-compose.yml @@ -16,6 +16,11 @@ services: volumes: - postgres-data:/var/lib/postgresql/data restart: on-failure + logging: + driver: "json-file" + options: + max-size: "200k" + max-file: "10" cardano-node: image: inputoutput/cardano-node:${CARDANO_NODE_VERSION:-1.13.0} environment: @@ -24,9 +29,12 @@ services: - node-db:/data/db - node-ipc:/ipc logging: - driver: none + driver: "json-file" + options: + max-size: "400k" + max-file: "20" cardano-db-sync-extended: - image: inputoutput/cardano-db-sync:${CARDANO_DB_SYNC_VERSION:-2.0.0} + image: inputoutput/cardano-db-sync:${CARDANO_DB_SYNC_VERSION:-2.1.0} environment: - EXTENDED=true - NETWORK=${NETWORK:-mainnet} @@ -42,13 +50,20 @@ services: volumes: - node-ipc:/node-ipc restart: on-failure + logging: + driver: "json-file" + options: + max-size: "200k" + max-file: "10" hasura: - image: inputoutput/cardano-graphql-hasura:v1.0.0-rc.12 + build: + context: ./packages/api-cardano-db-hasura/hasura + image: inputoutput/cardano-graphql-hasura:v1.0.0-rc.13 ports: - "8090:8080" depends_on: - "postgres" - restart: always + restart: on-failure environment: - POSTGRES_HOST=postgres - POSTGRES_PORT=5432 @@ -62,8 +77,16 @@ services: - postgres_db - postgres_password - postgres_user + logging: + driver: "json-file" + options: + max-size: "200k" + max-file: "10" cardano-graphql: - image: inputoutput/cardano-graphql:v1.0.0-rc.12 + build: + context: . + target: server + image: inputoutput/cardano-graphql:v1.0.0-rc.13 environment: - CACHE_ENABLED=true - HASURA_URI=http://hasura:8080 @@ -71,6 +94,11 @@ services: - 3100 ports: - ${API_PORT:-3100}:3100 + logging: + driver: "json-file" + options: + max-size: "200k" + max-file: "10" secrets: postgres_db: file: ./config/secrets/postgres_db @@ -81,4 +109,4 @@ secrets: volumes: node-db: node-ipc: - postgres-data: \ No newline at end of file + postgres-data: diff --git a/packages/client-ts/package.json b/packages/client-ts/package.json index 1cb1e28f..2bfa4e61 100644 --- a/packages/client-ts/package.json +++ b/packages/client-ts/package.json @@ -1,6 +1,6 @@ { "name": "@cardano-graphql/client-ts", - "version": "1.0.0-rc.12", + "version": "1.0.0-rc.13", "description": "A client package for Cardano GraphQL, including the GraphQL schema and TypeScript definitions generated from it", "repository": { "type": "git", diff --git a/packages/server/package.json b/packages/server/package.json index 8fda2193..69ac8e82 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,6 +1,6 @@ { "name": "@cardano-graphql/server", - "version": "1.0.0-rc.12", + "version": "1.0.0-rc.13", "description": "Serve the Cardano GraphQL API over HTTP", "main": "dist/index.js", "typings": "dist/index.d.ts", @@ -23,7 +23,7 @@ }, "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-rc.12", + "@cardano-graphql/api-cardano-db-hasura": "1.0.0-rc.13", "@graphql-tools/merge": "^6.0.10", "apollo-metrics": "^1.0.1", "apollo-server-core": "^2.14.3", @@ -37,7 +37,7 @@ "ts-custom-error": "^3.1.1" }, "devDependencies": { - "@cardano-graphql/util-dev": "1.0.0-rc.12", + "@cardano-graphql/util-dev": "1.0.0-rc.13", "@types/graphql-depth-limit": "^1.1.2", "@types/node": "^14.0.13", "typescript": "^3.9.5" diff --git a/packages/util-dev/package.json b/packages/util-dev/package.json index 34e0b8d5..ef2d2c8b 100644 --- a/packages/util-dev/package.json +++ b/packages/util-dev/package.json @@ -1,6 +1,6 @@ { "name": "@cardano-graphql/util-dev", - "version": "1.0.0-rc.12", + "version": "1.0.0-rc.13", "description": "Common development utilities", "main": "dist/index.js", "typings": "dist/index.d.ts", @@ -21,7 +21,7 @@ }, "homepage": "https://github.com/input-output-hk/cardano-graphql/blob/master/packages/util-dev/README.md", "devDependencies": { - "@cardano-graphql/util": "1.0.0-rc.12" + "@cardano-graphql/util": "1.0.0-rc.13" }, "directories": { "lib": "src", diff --git a/packages/util/package.json b/packages/util/package.json index ee4bd4d8..c78bb1c5 100644 --- a/packages/util/package.json +++ b/packages/util/package.json @@ -1,6 +1,6 @@ { "name": "@cardano-graphql/util", - "version": "1.0.0-rc.12", + "version": "1.0.0-rc.13", "description": "Common utilities", "main": "dist/index.js", "typings": "dist/index.d.ts",