diff --git a/app/data/compose/docker-compose-sushiswap-subgraph-v3.yml b/app/data/compose/docker-compose-sushiswap-subgraph-v3.yml index ed10c9cf..e8f70957 100644 --- a/app/data/compose/docker-compose-sushiswap-subgraph-v3.yml +++ b/app/data/compose/docker-compose-sushiswap-subgraph-v3.yml @@ -12,12 +12,13 @@ services: - APP=v3 # - NETWORK=lotus-fixturenet - NETWORK=filecoin - command: ["bash", "-c", "./run-v3.sh"] - working_dir: /app/subgraphs/v3 + command: ["bash", "-c", "./v3/run-v3.sh && ./blocks/run-blocks.sh"] + working_dir: /app/subgraphs volumes: - ../config/sushiswap-subgraph-v3/filecoin.js:/app/config/filecoin.js # - ../config/sushiswap-subgraph-v3/lotus-fixturenet.js.template:/app/config/lotus-fixturenet.js.template - ../config/sushiswap-subgraph-v3/run-v3.sh:/app/subgraphs/v3/run-v3.sh + - ../config/sushiswap-subgraph-v3/run-blocks.sh:/app/subgraphs/blocks/run-blocks.sh # - sushiswap_core_deployment:/app/subgraphs/v3/core-deployments/docker # - sushiswap_periphery_deployment:/app/subgraphs/v3/deployments/docker extra_hosts: diff --git a/app/data/config/sushiswap-subgraph-v3/filecoin.js b/app/data/config/sushiswap-subgraph-v3/filecoin.js index 34cefae9..a1422809 100644 --- a/app/data/config/sushiswap-subgraph-v3/filecoin.js +++ b/app/data/config/sushiswap-subgraph-v3/filecoin.js @@ -20,5 +20,10 @@ module.exports = { ], // TODO: Check value minimumEthLocked: 1.5 - } + }, + blocks: { + // https://github.com/sushiswap/subgraphs/blob/master/config/filecoin.js + address: '0x719e14fcb364bb05649bd525eb6c4a2d0d4ea2b7', + startBlock: 2867000, + }, } diff --git a/app/data/config/sushiswap-subgraph-v3/run-blocks.sh b/app/data/config/sushiswap-subgraph-v3/run-blocks.sh new file mode 100755 index 00000000..72af062a --- /dev/null +++ b/app/data/config/sushiswap-subgraph-v3/run-blocks.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +set -e + +echo "Building blocks subgraph and deploying to graph-node..." + +cd blocks + +pnpm run generate +pnpm run build + +pnpm exec graph create --node http://graph-node:8020/ sushiswap/blocks +pnpm exec graph deploy --node http://graph-node:8020/ --ipfs http://ipfs:5001 --version-label 0.1.0 sushiswap/blocks + +echo "Done" diff --git a/app/data/config/sushiswap-subgraph-v3/run-v3.sh b/app/data/config/sushiswap-subgraph-v3/run-v3.sh index d62a5885..19e17871 100755 --- a/app/data/config/sushiswap-subgraph-v3/run-v3.sh +++ b/app/data/config/sushiswap-subgraph-v3/run-v3.sh @@ -29,7 +29,10 @@ set -e # Write the replaced content back to the JavaScript file # echo "$replaced_content" > /app/config/lotus-fixturenet.js -echo "Building subgraph and deploying to graph-node..." +echo "Building v3 subgraph and deploying to graph-node..." + +cd v3 + pnpm run generate pnpm run build