Closed TrevorBenson closed 4 years ago
Looking at the instructions to build cardano-graphql from source it appears the directory and index.js in question are probably ~/git/cardano-graphql/packages/server/dist/index.js
? If this is the correct path then whichever method below is preferred by the other contributors I will submit as a PR from my fork.
Symlink it:
cd ~/git/cardano-graphql ; ln -s ./packages/server/dist ./
Dull copy of the source:
cd ~/git/cardano-graphql ; cp -rf ./packages/server/dist ./
The graphql documentation is indeed behind. The dist
folder being in root was output package that's moved since to packages/server/dist
. We prolly might want to switch to that build folder instead of dist :
Also, the environment variables required would need to be updated as they've been changed since.
I made a couple of notes last time I tried to build Hasura and cardano-graphql. Not sure if it is better handled in some other way or if there are more changes that are needed but here they are:
ghcup install 8.10.1
ghcup set 8.10.1
sudo yum install -y krb5-devel
sudo apt-get install -y libkrb5-dev
curl -L https://github.com/hasura/graphql-engine/raw/stable/cli/get.sh | INSTALL_PATH=$HOME/bin bash`
Build from source instructions taken from Hasura docs:
cd graphql-engine/cli
make deps
make build
# binaries will be in _output directory
cd ~/git
git clone https://github.com/input-output-hk/cardano-graphql
cd cardano-graphql
git checkout tags/2.0.0
yarn --offline --frozen-lockfile && yarn build
Set up environment for cardano-graphql
section, I replaced the last three rows.
cd ~/git/cardano-graphql/dist
graphql-engine serve &
node index.js
with these lines
cd ~/git/cardano-graphql
graphql-engine serve &
node ./packages/server/dist/index.js
FYI - this is parked for now, as cardano-graphql
doco and prerequisites are not being maintained (was removed in #476 ).
There is not a lot being bought to the table via cardano-graphql
other than pre-defined queries, no reason why a lightweight service like postgREST or postgres.rest cant be used instead. Besides, this was only component using npm in the build tools.
This may be revisited in future
o.0
@Scitz0 Anything that CNTools does not compile I will build a dedicated container for. Since cardano-graphql
docs/prereqs are not being maintained I am closing out this ticket to reduce backlog.
If I misunderstood and you meant the upstream docs & prerequisites are not actively maintained and cardano-graphql
is intended to remain part of CNTools feel free to reopen this issue.
Describe the bug Instructions say to
cd ~/git/cardano-graphql/dist
but after runningyarn build
directory does not exist and returns the following error:Using
find ~/git/cardano-db-sync/ -type f -iname "index.js" | grep '/dist/' | wc -l
there are 104 directories that are named dist which contain a file named index.js. There are too many dist/index.js to determine which one to start with node.To Reproduce Steps to reproduce the behavior:
No such file or directory
error when trying tocd ~/git/cardano-graphql/dist
Expected behavior
Version: