Skip to content

Commit

Permalink
Merge pull request #100 from input-output-hk/release/1.0.0-rc.0
Browse files Browse the repository at this point in the history
Release/1.0.0 rc.0
  • Loading branch information
rhyslbw authored Nov 28, 2019
2 parents ab52491 + 861fd07 commit 3b573c3
Show file tree
Hide file tree
Showing 29 changed files with 273 additions and 792 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
Changelog
=========

## 1.0.0
## Features
- `Block.transactionsCount` - An optimised version of the aggregate query.
- `Cardano.networkName` - Unlocks application-side logic based on the network it's connected to.
- `Transaction.size` - New
## Fixes
- 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.
- `cardano` query return value is accurately defined to always return an object of type `Cardano`
- `Transaction.fee` was a String, now a `BigInt`

### Chores
- The PostgreSQL views have been incorperated upstream, and are no longer managed in this codebase.
- Updates to Hasura 1.0.0-beta.10
- Includes script to dump a sample using a Cardano Docker stack.
- Improves CI process by consolidating the Jest snapshot files.
- Renamed npm scripts `start-dependencies` and `stop-dependencies` for alignment with `start:*` and `stop:*`
- `Cardano` now matches the postgres view, and is an improvement over the previous version which performed two queries.

## 0.4.0
### Features
- Block.nextBlock
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ Integrated query UI and documentation is available in the GraphQL Playground, av
- [API Consumer Documentation](./docs/api_consumer)
- [Developer Documentation](./docs/developer)
- [Updating Hasura Metadata](./docs/hasura)
- [Refresh Test DB Dump](./docs/refresh_db)

2 changes: 1 addition & 1 deletion docker/docker-compose.service-deps.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3.7'
services:
hasura:
image: hasura/graphql-engine:v1.0.0-beta.6.cli-migrations
image: hasura/graphql-engine:v1.0.0-beta.10.cli-migrations
ports:
- "8090:8080"
depends_on:
Expand Down
2 changes: 1 addition & 1 deletion docker/docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
ports:
- ${API_PORT:-3100}:3100
hasura:
image: hasura/graphql-engine:v1.0.0-beta.6.cli-migrations
image: hasura/graphql-engine:v1.0.0-beta.10.cli-migrations
depends_on:
- "postgres"
restart: always
Expand Down
8 changes: 8 additions & 0 deletions docs/refresh_db/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Refresh Test DB Dump

1. clone `cardano-docker-stack` from GH
2. From cardano-docker-stack, run `./scripts/start_mainnet.sh`
3. Once the stack starts, use `docker ps` to identify `cardano-explorer` container. Then use `docker logs -f _container_name_` to monitor the block height as the explorer receives and writes blocks.
4. Once block height is above 70000, run `yarn refresh-db` from the root directory of `cardano-graphql`

Note: It is _expected_ that some of the snapshot values will change and need to be updated, as you will not dump the db at the exact same block as the last dump
2 changes: 1 addition & 1 deletion hasura/migrations/metadata.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"functions":["utxo_set_at_block"],"remote_schemas":[],"query_collections":[],"allowlist":[],"tables":[{"table":"Meta","is_enum":false,"object_relationships":[],"array_relationships":[],"insert_permissions":[],"select_permissions":[{"role":"cardano-graphql","comment":null,"permission":{"allow_aggregations":false,"columns":["slotDuration","startTime","protocolConst"],"filter":{}}}],"update_permissions":[],"delete_permissions":[],"event_triggers":[]},{"table":"Utxo","is_enum":false,"object_relationships":[],"array_relationships":[],"insert_permissions":[],"select_permissions":[{"role":"cardano-graphql","comment":null,"permission":{"allow_aggregations":true,"columns":["address","value","txId","index"],"limit":100,"filter":{}}}],"update_permissions":[],"delete_permissions":[],"event_triggers":[]},{"table":"TransactionOutput","is_enum":false,"object_relationships":[],"array_relationships":[],"insert_permissions":[],"select_permissions":[{"role":"cardano-graphql","comment":null,"permission":{"allow_aggregations":true,"columns":["address","value","txId","index"],"limit":100,"filter":{}}}],"update_permissions":[],"delete_permissions":[],"event_triggers":[]},{"table":"Cardano","is_enum":false,"object_relationships":[{"using":{"manual_configuration":{"remote_table":"Epoch","column_mapping":{"currentEpochNo":"number"}}},"name":"currentEpoch","comment":null}],"array_relationships":[],"insert_permissions":[],"select_permissions":[{"role":"cardano-graphql","comment":null,"permission":{"allow_aggregations":true,"columns":["blockHeight","currentEpochNo"],"filter":{}}}],"update_permissions":[],"delete_permissions":[],"event_triggers":[]},{"table":"Block","is_enum":false,"object_relationships":[{"using":{"manual_configuration":{"remote_table":"Epoch","column_mapping":{"epochNo":"number"}}},"name":"epoch","comment":null},{"using":{"manual_configuration":{"remote_table":"Block","column_mapping":{"previousBlockId":"id"}}},"name":"previousBlock","comment":null},{"using":{"manual_configuration":{"remote_table":"Block","column_mapping":{"nextBlockId":"id"}}},"name":"nextBlock","comment":null}],"array_relationships":[{"using":{"manual_configuration":{"remote_table":"Transaction","column_mapping":{"id":"blockId"}}},"name":"transactions","comment":null}],"insert_permissions":[],"select_permissions":[{"role":"cardano-graphql","comment":null,"permission":{"allow_aggregations":true,"columns":["createdAt","createdBy","epochNo","fees","id","merkelRootHash","number","previousBlockId","size","slotNo","slotWithinEpoch"],"limit":100,"filter":{}}}],"update_permissions":[],"delete_permissions":[],"event_triggers":[]},{"table":"Transaction","is_enum":false,"object_relationships":[{"using":{"manual_configuration":{"remote_table":"Block","column_mapping":{"blockId":"id"}}},"name":"block","comment":null}],"array_relationships":[{"using":{"manual_configuration":{"remote_table":"TransactionInput","column_mapping":{"id":"txId"}}},"name":"inputs","comment":null},{"using":{"manual_configuration":{"remote_table":"TransactionOutput","column_mapping":{"id":"txId"}}},"name":"outputs","comment":null}],"insert_permissions":[],"select_permissions":[{"role":"cardano-graphql","comment":null,"permission":{"allow_aggregations":true,"columns":["blockId","fee","id","totalOutput","includedAt"],"limit":100,"filter":{}}}],"update_permissions":[],"delete_permissions":[],"event_triggers":[]},{"table":"Epoch","is_enum":false,"object_relationships":[],"array_relationships":[{"using":{"manual_configuration":{"remote_table":"Block","column_mapping":{"number":"epochNo"}}},"name":"blocks","comment":null}],"insert_permissions":[],"select_permissions":[{"role":"cardano-graphql","comment":null,"permission":{"allow_aggregations":true,"columns":["output","transactionsCount","number","startedAt","lastBlockTime"],"limit":10,"filter":{}}}],"update_permissions":[],"delete_permissions":[],"event_triggers":[]},{"table":"TransactionInput","is_enum":false,"object_relationships":[],"array_relationships":[],"insert_permissions":[],"select_permissions":[{"role":"cardano-graphql","comment":null,"permission":{"allow_aggregations":true,"columns":["address","value","txId","sourceTxId","sourceTxIndex"],"limit":100,"filter":{}}}],"update_permissions":[],"delete_permissions":[],"event_triggers":[]}]}
{"functions":["utxo_set_at_block"],"remote_schemas":[],"query_collections":[],"allowlist":[],"tables":[{"table":"Block","is_enum":false,"configuration":{"custom_root_fields":{"select":null,"select_by_pk":null,"select_aggregate":null,"insert":null,"update":null,"delete":null},"custom_column_names":{}},"object_relationships":[{"using":{"manual_configuration":{"remote_table":"slot_leader","column_mapping":{"createdBy":"id"}}},"name":"creator","comment":null},{"using":{"manual_configuration":{"remote_table":"Epoch","column_mapping":{"epochNo":"number"}}},"name":"epoch","comment":null},{"using":{"manual_configuration":{"remote_table":"Block","column_mapping":{"nextBlockId":"id"}}},"name":"nextBlock","comment":null},{"using":{"manual_configuration":{"remote_table":"Block","column_mapping":{"previousBlockId":"id"}}},"name":"previousBlock","comment":null}],"array_relationships":[{"using":{"manual_configuration":{"remote_table":"Transaction","column_mapping":{"id":"blockId"}}},"name":"transactions","comment":null}],"insert_permissions":[],"select_permissions":[{"role":"cardano-graphql","comment":null,"permission":{"allow_aggregations":true,"computed_fields":[],"columns":["fees","id","merkelRootHash","number","previousBlockId","nextBlockId","createdBy","size","transactionsCount","epochNo","slotNo","slotWithinEpoch","createdAt"],"limit":100,"filter":{}}}],"update_permissions":[],"delete_permissions":[],"event_triggers":[],"computed_fields":[]},{"table":"Cardano","is_enum":false,"configuration":{"custom_root_fields":{"select":null,"select_by_pk":null,"select_aggregate":null,"insert":null,"update":null,"delete":null},"custom_column_names":{}},"object_relationships":[{"using":{"manual_configuration":{"remote_table":"Epoch","column_mapping":{"currentEpochNo":"number"}}},"name":"currentEpoch","comment":null}],"array_relationships":[],"insert_permissions":[],"select_permissions":[{"role":"cardano-graphql","comment":null,"permission":{"allow_aggregations":false,"computed_fields":[],"columns":["blockHeight","currentEpochNo","slotDuration","startTime","protocolConst","networkName"],"filter":{}}}],"update_permissions":[],"delete_permissions":[],"event_triggers":[],"computed_fields":[]},{"table":"Epoch","is_enum":false,"configuration":{"custom_root_fields":{"select":null,"select_by_pk":null,"select_aggregate":null,"insert":null,"update":null,"delete":null},"custom_column_names":{}},"object_relationships":[],"array_relationships":[{"using":{"manual_configuration":{"remote_table":"Block","column_mapping":{"number":"epochNo"}}},"name":"blocks","comment":null}],"insert_permissions":[],"select_permissions":[{"role":"cardano-graphql","comment":null,"permission":{"allow_aggregations":true,"computed_fields":[],"columns":["output","transactionsCount","number","startedAt","lastBlockTime"],"limit":100,"filter":{}}}],"update_permissions":[],"delete_permissions":[],"event_triggers":[],"computed_fields":[]},{"table":"Transaction","is_enum":false,"configuration":{"custom_root_fields":{"select":null,"select_by_pk":null,"select_aggregate":null,"insert":null,"update":null,"delete":null},"custom_column_names":{}},"object_relationships":[{"using":{"manual_configuration":{"remote_table":"Block","column_mapping":{"blockId":"id"}}},"name":"block","comment":null}],"array_relationships":[{"using":{"manual_configuration":{"remote_table":"TransactionInput","column_mapping":{"id":"txId"}}},"name":"inputs","comment":null},{"using":{"manual_configuration":{"remote_table":"TransactionOutput","column_mapping":{"id":"txId"}}},"name":"outputs","comment":null}],"insert_permissions":[],"select_permissions":[{"role":"cardano-graphql","comment":null,"permission":{"allow_aggregations":true,"computed_fields":[],"columns":["blockId","fee","id","totalOutput","size","includedAt"],"limit":100,"filter":{}}}],"update_permissions":[],"delete_permissions":[],"event_triggers":[],"computed_fields":[]},{"table":"TransactionInput","is_enum":false,"configuration":{"custom_root_fields":{"select":null,"select_by_pk":null,"select_aggregate":null,"insert":null,"update":null,"delete":null},"custom_column_names":{}},"object_relationships":[],"array_relationships":[],"insert_permissions":[],"select_permissions":[{"role":"cardano-graphql","comment":null,"permission":{"allow_aggregations":true,"computed_fields":[],"columns":["address","value","txId","sourceTxId","sourceTxIndex"],"limit":100,"filter":{}}}],"update_permissions":[],"delete_permissions":[],"event_triggers":[],"computed_fields":[]},{"table":"TransactionOutput","is_enum":false,"configuration":{"custom_root_fields":{"select":null,"select_by_pk":null,"select_aggregate":null,"insert":null,"update":null,"delete":null},"custom_column_names":{}},"object_relationships":[],"array_relationships":[],"insert_permissions":[],"select_permissions":[{"role":"cardano-graphql","comment":null,"permission":{"allow_aggregations":true,"computed_fields":[],"columns":["address","value","txId","index"],"filter":{}}}],"update_permissions":[],"delete_permissions":[],"event_triggers":[],"computed_fields":[]},{"table":"Utxo","is_enum":false,"configuration":{"custom_root_fields":{"select":null,"select_by_pk":null,"select_aggregate":null,"insert":null,"update":null,"delete":null},"custom_column_names":{}},"object_relationships":[],"array_relationships":[],"insert_permissions":[],"select_permissions":[{"role":"cardano-graphql","comment":null,"permission":{"allow_aggregations":true,"computed_fields":[],"columns":["address","value","txId","index"],"limit":100,"filter":{}}}],"update_permissions":[],"delete_permissions":[],"event_triggers":[],"computed_fields":[]},{"table":"slot_leader","is_enum":false,"configuration":{"custom_root_fields":{"select":null,"select_by_pk":null,"select_aggregate":null,"insert":null,"update":null,"delete":null},"custom_column_names":{}},"object_relationships":[],"array_relationships":[],"insert_permissions":[],"select_permissions":[{"role":"cardano-graphql","comment":null,"permission":{"allow_aggregations":true,"computed_fields":[],"columns":["id","hash","description"],"limit":100,"filter":{}}}],"update_permissions":[],"delete_permissions":[],"event_triggers":[],"computed_fields":[]}]}
16 changes: 9 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
{
"name": "cardano-graphql",
"version": "0.4.0",
"version": "1.0.0-rc.0",
"description": "GraphQL API for Cardano with client-consumable types generated",
"scripts": {
"codegen:external": "graphql-codegen --config ./codegen.external.yml",
"codegen:internal": "graphql-codegen",
"lint": "eslint \"src/**/*.ts\"",
"dev": "yarn codegen:internal --watch",
"dev:test": "HASURA_URI=http://localhost:8090/v1/graphql stmux -w always -e ERROR -M -- [[ \"yarn dev\" .. \"yarn start-dependencies\" .. \"tsc --watch --noEmit\" .. \"yarn test:integration --watchAll\" ]]",
"dev:test": "HASURA_URI=http://localhost:8090/v1/graphql stmux -w always -e ERROR -M -- [[ \"yarn dev\" .. \"yarn start:dependencies\" .. \"tsc --watch --noEmit\" .. \"yarn test:integration --watchAll\" ]]",
"dev:start": "HASURA_URI=http://localhost:8090/v1/graphql stmux -w always -e ERROR -M -- [[ \"docker-compose -f docker/docker-compose.service-deps.yml up\" .. \"ts-node-dev --no-notify --respawn --transpileOnly src/index.ts\" ]]",
"build": "rm -rf dist && yarn codegen:internal && yarn codegen:external && tsc && npx cpx src/**/*.graphql dist",
"test:integration": "NODE_ENV=test jest integration",
"test:e2e": "NODE_ENV=test jest e2e",
"test:integration": "NODE_ENV=test TEST_MODE=integration jest suite",
"test:e2e": "NODE_ENV=test TEST_MODE=e2e jest suite",
"start": "HASURA_URI=http://localhost:8090/v1/graphql node dist/index.js",
"start-dependencies": "docker-compose -f docker/docker-compose.service-deps.yml up",
"start:dependencies": "docker-compose -f docker/docker-compose.service-deps.yml up",
"start:test-stack": "docker-compose -f docker/docker-compose.test.yml up",
"stop-dependencies": "docker-compose -f docker/docker-compose.service-deps.yml down",
"stop:dependencies": "docker-compose -f docker/docker-compose.service-deps.yml down",
"stop:test-stack": "docker-compose -f docker/docker-compose.test.yml down",
"loadtest:byron-staging": "artillery run test/loadtest/byron-staging-config.yml"
"loadtest:byron-staging": "artillery run test/loadtest/byron-staging-config.yml",
"refresh-db": "sh ./test/postgres/refresh_dump.sh"
},
"contributors": [
"Rhys Bartels-Waller <rhys.bartelswaller@iohk.io> (https://iohk.io)",
Expand Down Expand Up @@ -56,6 +57,7 @@
"apollo-server-core": "^2.8.1",
"apollo-server-testing": "^2.8.1",
"artillery": "^1.6.0-29",
"bignumber.js": "9.0.0",
"cpx": "^1.5.0",
"eslint": "^6.1.0",
"eslint-config-standard": "^13.0.1",
Expand Down
Loading

0 comments on commit 3b573c3

Please sign in to comment.