Leszek Wiesner 8cd0d2d850 Merge branch 'giza_feature_NewContentFeaturesAndNFT' into olympia 3 éve
..
codegen d403b61998 Merge branch 'giza' into giza-update-hydra 3 éve
mappings 8cd0d2d850 Merge branch 'giza_feature_NewContentFeaturesAndNFT' into olympia 3 éve
schemas 8cd0d2d850 Merge branch 'giza_feature_NewContentFeaturesAndNFT' into olympia 3 éve
.gitignore 8cd0d2d850 Merge branch 'giza_feature_NewContentFeaturesAndNFT' into olympia 3 éve
README.md db55b797bd Update query-node/README.md 3 éve
build.sh 4ddc1b99b1 Giza Query Node: Update Hydra and remove workarounds 3 éve
kill.sh 765f5c0371 Query node kill script fix 3 éve
manifest.yml 8cd0d2d850 Merge branch 'giza_feature_NewContentFeaturesAndNFT' into olympia 3 éve
package.json 8cd0d2d850 Merge branch 'giza_feature_NewContentFeaturesAndNFT' into olympia 3 éve
run-tests.sh e39b3f71d8 Olympia: Improve query-node setup and update README 3 éve
start.sh 8cd0d2d850 Merge branch 'giza_feature_NewContentFeaturesAndNFT' into olympia 3 éve

README.md

Query node

This is a query-node project generated by hydra-cli. Experiment by modifying schema.graphql and the mappings in the mappings folder, defined in manifest.yml.

For more information about Hydra see: https://dzhelezov.gitbook.io/hydra/

1. Building the node

Run

# Make sure these steps are executed first:
# yarn build:packages; # OR:
# yarn && yarn workspace @joystream/types build && yarn workspace @joystream/metadata-protobuf build
yarn workspace query-node-root build

This will generate event decorations for the mappings via hydra-typegen inside mappings/generated (based on the runtime metadata saved in ../chain-metadata.json) and a graphql-server along with the TypeORM models based on schema.graphql inside generated/graphql-server.

2. Building the mappings

In order to re-build the mappings only, without re-generating the graphql-server code and event decorations (in case there were no changes in the runtime and schema.graphql) you can also run:

yarn workspace query-node-mappings build

3. Initializing the database and starting the node

yarn workspace query-node-root start

This script script will:

  • Bring up joystream-node service (if not already started)
  • Bring up db service (query node is using a PostgreSQL database to store the data)
  • Configure the database (yarn workspace query-node config:dev)
  • Create the database and initialize schema (yarn workspace query-node-root db:prepare && yarn workspace query-node-root db:processor:migrate)
  • Start the GraphQL server service (docker-compose up -d graphql-server)
  • Start the Hydra Processor responsible for processing the runtime events and running the mappings' functions (docker-compose up -d processor)

4. Stopping the node and removing all associated containers

You can stop the query-node and remove all associated docker containers without affecting any other services by running:

yarn workspace query-node-root kill