cardano-foundation / cardano-graphql

GraphQL API for Cardano
Apache License 2.0
262 stars 104 forks source link

Alonzo Support #539

Closed CyberCyclone closed 3 years ago

CyberCyclone commented 3 years ago

I know Alonzo support is currently being worked on, however I'm wondering if there's a way to get the current master to work against alonzo-white and later versions as they're rolled out?

I'm not after anything alonzo related, just wanting to run against the network so I can have a alonzo-white version of ADATools.io (just like testnet.adatools.io).

Is cardano-graphql:master technically compatible with alonzo-white and just requires some network param updates?


Here's some of the attempts I've tried so far.

cardano-graphql:master

  1. Network params are hard coded to some extent (can't simply swap out config files with alonzo-white).

cardano-graphql:4.0.0

  1. Changing cardano-node -> alonzo-blue2.0 and cardano-db-sync -> 10.0.0 runs fine, but cardano-graphql:4.0.0 isn't compatible as cardano-db-sync:10.0.0 has in the changelog Remove merkle_root field from block table. and therefore can't start up.
  2. Keeping cardano-db-sync:9.0.0 starts and syncs fine, however some features don't work. E.g, Doing a query on ada throws "ada results are only available when close to the network tip. This is expected during the initial chain-sync." even though it is fully synced.

These are the config files I'm running against: Changed config files in /config/network/testnet to the ones found here: https://hydra.iohk.io/build/6854041/download/1/index.html (from https://github.com/input-output-hk/Alonzo-testnet/blob/main/Alonzo-exercises/alonzo-white/1_Alonzo-white-exercise-1.md)

rhyslbw commented 3 years ago

Is cardano-graphql:master technically compatible with alonzo-white and just requires some network param updates?

No. cardano-db-sync@10, which is still unreleased but has been tagged, only supports Alonzo blue. There will be a release branch shortly, and then master can be updated to use cardano-db-sync@10.1 which will support Alonzo white

Network params are hard coded to some extent (can't simply swap out config files with alonzo-white).

The config and Dockerfile design allows you to load in any network config at build time as long as it's transformed with the minor path changes relating to the genesis files. We're now using a separate repo to centralise and automate the process, so I'll add Alonzo white and then update the submodule for us to access here.

erikd commented 3 years ago

No sure if this helps, but the release/10.1.x branch of db-sync supports alonzo_white .

CyberCyclone commented 3 years ago

No sure if this helps, but the release/10.1.x branch of db-sync supports alonzo_white .

I'm probably 'jumping the gun' here, however I gave release/10.1.x a go but somewhere something isn't compatible. Here's the steps I did in case there's something obvious I've done wrong. Otherwise I'll wait until cardano-db-sync:10.1 is released.

  1. Clone and cardano-db-sync branch release/10.1.x
  2. In docker-compose.yml, change cardano-node version to alonzo-white-1.2
  3. Since the release tag hasn’t been submitted to docker hub, build an image using docker load -i $(nix-build -A dockerImage --no-out-link). Took a Ryzen 9 four hours to build.
  4. Checkout cardano-graphql master (and tried 5-0-stable)
  5. Navigate to config/ and checkout master
  6. Navigate to ogmios/server/config and checkout master
  7. Build using tagged cardano-db-sync: sudo NETWORK=alonzo-white CARDANO_DB_SYNC_VERSION=84226d33eed66be8e61d50b7e1dacebdc095cee9 docker-compose up -d --build && sudo docker-compose logs -f

A lot of errors appeared.

Screen Shot 2021-07-25 at 6 03 26 pm
rhyslbw commented 3 years ago

The incompatibility is with Ogmios. Hang tight for now and I'll let you know when you can try this out on master

rhyslbw commented 3 years ago

Bumping to the alonzo-white-1.2 tag in https://github.com/CardanoSolutions/ogmios/pull/100

rhyslbw commented 3 years ago

https://github.com/input-output-hk/cardano-graphql/releases/tag/5.1.0-beta.0