sushiswap / sushiswap-subgraph

Sushiswap Subgraph
https://thegraph.com/explorer/subgraph/sushiswap/sushiswap
MIT License
150 stars 257 forks source link

Sushiswap Exchange Goerli deployment #98

Closed justincavery closed 2 years ago

justincavery commented 2 years ago

I'm trying to deploy a Goerli version of the SushiSwap Exchange Subgraph - https://github.com/sushiswap/sushiswap-subgraph/tree/master/subgraphs/exchange

When I build I get some warnings but no errors (sample below)

WARNING AS206: Compiling constant with non-constant initializer as mutable.
   const token1DayData = updateTokenDayData(token1 as Token, event)
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 in src/mappings/pair.ts(658,8)

When I try to deploy I get the message

The current version of graph-cli can't be used with mappings on apiVersion less than '0.0.5'

After updating the apiVersion to 0.0.5 and deploying the following error appears

To use this version of the graph-cli you must upgrade the graph-ts dependency to a version greater than or equal to 0.22.0
Also, you'll probably need to take a look at our AssemblyScript migration guide because of language breaking changes: https://gist.github.com/otaviopace/8406cb39644d2e7678570d1e7f50dac4

(side note, that warning with a link to the migration guide is a 404 and should probably link to https://thegraph.com/docs/en/developer/assemblyscript-migration-guide/)

When I update the graph-ts to 0.22.0 the yarn build command fails with

✖ Failed to compile subgraph: Failed to compile data source mapping: Compile error
Error: Failed to compile data source mapping: Compile error
    at Compiler._compileDataSourceMapping (/Users/justinavery/Documents/GitHub/sushiswap-subgraph/node_modules/@graphprotocol/graph-cli/src/compiler.js:314:13)
    at /Users/justinavery/Documents/GitHub/sushiswap-subgraph/node_modules/@graphprotocol/graph-cli/src/compiler.js:207:20
    at updateInDeepMap (/Users/justinavery/Documents/GitHub/sushiswap-subgraph/node_modules/immutable/dist/immutable.js:1971:22)
    at updateInDeepMap (/Users/justinavery/Documents/GitHub/sushiswap-subgraph/node_modules/immutable/dist/immutable.js:1980:23)
    at updateInDeepMap (/Users/justinavery/Documents/GitHub/sushiswap-subgraph/node_modules/immutable/dist/immutable.js:1980:23)
    at Map.updateIn (/Users/justinavery/Documents/GitHub/sushiswap-subgraph/node_modules/immutable/dist/immutable.js:1278:26)
    at /Users/justinavery/Documents/GitHub/sushiswap-subgraph/node_modules/@graphprotocol/graph-cli/src/compiler.js:206:24
    at /Users/justinavery/Documents/GitHub/sushiswap-subgraph/node_modules/immutable/dist/immutable.js:3016:46
    at List.__iterate (/Users/justinavery/Documents/GitHub/sushiswap-subgraph/node_modules/immutable/dist/immutable.js:2206:13)
    at mappedSequence.__iterateUncached (/Users/justinavery/Documents/GitHub/sushiswap-subgraph/node_modules/immutable/dist/immutable.js:3015:23)
error Command failed with exit code 1.

Am I right in assuming that someone need to go back through the mappings /entities and fix the breaking changes moving from 0.19.0 - 0.22.0?

justincavery commented 2 years ago

This has been redeployed https://thegraph.com/hosted-service/subgraph/sushiswap/exchange-goerli