Amxx / subgraphs

53 stars 22 forks source link

Instructions to build/fork eip721? #5

Open firepol opened 1 year ago

firepol commented 1 year ago

Hi,

I'm new to subgraph & my goal is to fork the eip721 subgraph for difference chains.

I try to run yarn in the common folder and it fails because it can't find some open-zeppelin dependencies. I fix a wrong dependency: "@amxx/graphprotocol-utils": "^1.1.0-alpha.2", should be "@amxx/graphprotocol-utils": "^1.1.0", It still doesn't work. yarn puts all packages in the main node_modules folder.

I removed the main packages.json file and run again yarn from inside the common folder. This time all packages + the @amxx/graphprotocol-utils (previously missing) are saved in common/node_modules

Still I get an error when I run yarn in the common folder.

$ scripts/prepare.sh
/myhome/subgraphs/subgraphs/common/node_modules/@amxx/graphprotocol-utils/scripts/graph-compiler/utils.js:14
    throw new Error(error);
    ^

Error: Error merging schema entries: incompatible fields found for Account
    at assert (/myhome/subgraphs/subgraphs/common/node_modules/@amxx/graphprotocol-utils/scripts/graph-compiler/utils.js:14:11)

I was hoping to be able to somehow prepare the dependencies needed, then change "chain": "mainnet", to "chain": "avalanche", in the config/eip721.json file (and then try to deploy from there)... but I'm stuck and I'd like some help.

OS: Fedora Linux (i case anyone needs this, I had to install libsecret-devel: sudo dnf install libsecret-devel) Node version: v16.17.0

Any help/hint is appreciated. Thank you

Amxx commented 1 year ago

Can you share which version of @graphprotocol/graph-cli and @graphprotocol/graph-ts you are using ?

Amxx commented 1 year ago

Also, did you get this package by cloning the repo, or did you get it through npm. If through npm, which version?