diff --git a/.github/workflows/subql_deploy_workflow.yaml b/.github/workflows/subql_deploy_workflow.yaml index 76037587..3e359831 100644 --- a/.github/workflows/subql_deploy_workflow.yaml +++ b/.github/workflows/subql_deploy_workflow.yaml @@ -40,17 +40,6 @@ jobs: steps: - name: Check out repo's default branch uses: actions/checkout@v3 - - name: Generate new project-centrifuge.yaml - run: yq ". *=d load(\"chains-cfg/$CHAIN_ID.yaml\")" chains-cfg/base.yaml > project-centrifuge.yaml - - name: Generate new project-ethereum.yaml - run: yq ". *=d load(\"chains-evm/$CHAIN_ID.yaml\")" chains-evm/base.yaml | envsubst > project-ethereum.yaml - - name: Extract Chain Parameters to ENV - run: | - echo "SUBQL_PROJ_NAME=$(yq '.name' project-centrifuge.yaml)" >> $GITHUB_ENV - echo "SUBQL_PROJ_DECRIPTION=$(yq '.description' project-centrifuge.yaml)" >> $GITHUB_ENV - echo "SUBQL_CFG_ENDPOINT=$(yq '.network.endpoint' project-centrifuge.yaml)" >> $GITHUB_ENV - echo "SUBQL_EVM_ENDPOINT=$(yq '.network.endpoint' project-ethereum.yaml)" >> $GITHUB_ENV - echo "SUBQL_EVM_DICT=$(yq '.network.dictionary' project-ethereum.yaml)" >> $GITHUB_ENV - name: Setup Node uses: actions/setup-node@v3 with: @@ -59,14 +48,45 @@ jobs: - name: Setup Yarn run: yarn install --frozen-lockfile - name: Codegen - run: yarn codegen + run: | + cp chains-evm/_root.yaml project-centrifuge.yaml + cp chains-evm/_root.yaml project-ethereum.yaml + cp chains-evm/_root.yaml project-base.yaml + yarn codegen - name: SubQL CLI Version run: yarn subql --version + - name: Generate new project-centrifuge.yaml + run: 'yq ". *=d load(\"chains-cfg/$CHAIN_ID.yaml\")" chains-cfg/_root.yaml > project-centrifuge.yaml || true' + - name: Generate new project-ethereum.yaml + run: '[ -e chains-evm/eth/$CHAIN_ID.yaml ] && yq ". *=d load(\"chains-evm/eth/$CHAIN_ID.yaml\")" chains-evm/_root.yaml > project-ethereum.yaml || true' + - name: Generate new project-base.yaml + run: '[ -e chains-evm/base/$CHAIN_ID.yaml ] && yq ". *=d load(\"chains-evm/base/$CHAIN_ID.yaml\")" chains-evm/_root.yaml > project-base.yaml || true' + - name: Extract Chain Parameters to ENV + run: | + echo "SUBQL_PROJ_NAME=$(yq '.name' project-centrifuge.yaml)" >> $GITHUB_ENV + echo "SUBQL_PROJ_DECRIPTION=$(yq '.description' project-centrifuge.yaml)" >> $GITHUB_ENV + echo "SUBQL_CFG_ENDPOINT=$(yq '.network.endpoint' project-centrifuge.yaml)" >> $GITHUB_ENV + echo "SUBQL_CFG_DICT=$(yq '.network.dictionary' project-centrifuge.yaml)" >> $GITHUB_ENV + echo "SUBQL_ETH_ENDPOINT=$(yq '.network.endpoint' project-ethereum.yaml)" >> $GITHUB_ENV + echo "SUBQL_ETH_DICT=$(yq '.network.dictionary' project-ethereum.yaml)" >> $GITHUB_ENV + echo "SUBQL_BASE_ENDPOINT=$(yq '.network.endpoint' project-base.yaml)" >> $GITHUB_ENV + echo "SUBQL_BASE_DICT=$(yq '.network.dictionary' project-base.yaml)" >> $GITHUB_ENV + - name: Generate new subquery-multichain.yaml + run: | + cat > subquery-multichain.yaml <<'EOF' + specVersion: 1.0.0 + query: + name: '@subql/query' + version: '2' + projects: + EOF + find ./ -regex '\./project-.*\.yaml$' -exec echo " - {}" >> subquery-multichain.yaml \; - name: Publish SubQL version run: | npx subql publish -o -f . - echo "CFG_IPFSCID=$(cat .project-centrifuge-cid)" >> $GITHUB_ENV - echo "EVM_IPFSCID=$(cat .project-ethereum-cid)" >> $GITHUB_ENV + echo "CFG_IPFSCID=$(cat .project-centrifuge-cid)" >> $GITHUB_ENV || true + echo "ETH_IPFSCID=$(cat .project-ethereum-cid)" >> $GITHUB_ENV || true + echo "BASE_IPFSCID=$(cat .project-base-cid)" >> $GITHUB_ENV || true - name: Delete Project if: ${{ inputs.resetProject }} run: | @@ -96,15 +116,15 @@ jobs: --disableHistorical \ --indexerVersion="$SUBQL_INDEXER_VERSION" \ --queryVersion="$SUBQL_QUERY_VERSION" - # - name: Deploy EVM Version + # - name: Deploy ETH Version # run: | # npx subql deployment:deploy \ # -d \ # --org="$SUBQL_PROJ_ORG" \ - # --endpoint="$SUBQL_EVM_ENDPOINT" \ - # --dict="$SUBQL_EVM_DICT" \ + # --endpoint="$SUBQL_ETH_ENDPOINT" \ + # --dict="$SUBQL_ETH_DICT" \ # --projectName="$SUBQL_PROJ_NAME" \ - # --ipfsCID="$EVM_IPFSCID" \ + # --ipfsCID="$ETH_IPFSCID" \ # --type=$SUBQL_DEPLOYMENT_TYPE \ # --disableHistorical \ # --indexerBatchSize=30 \ diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7c2ea847..bd77c8d4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,10 +20,6 @@ jobs: steps: - name: Check out repo's default branch uses: actions/checkout@v3 - - name: Generate new project-centrifuge.yaml - run: yq ". *=d load(\"chains-cfg/$CHAIN_ID.yaml\")" chains-cfg/base.yaml > project-centrifuge.yaml - - name: Generate new project-ethereum.yaml - run: yq ". *=d load(\"chains-evm/$CHAIN_ID.yaml\")" chains-evm/base.yaml | envsubst > project-ethereum.yaml - name: Setup Node uses: actions/setup-node@v3 with: @@ -32,10 +28,13 @@ jobs: - name: Setup Yarn run: yarn install --frozen-lockfile - name: Codegen - run: yarn codegen + run: | + cp chains-evm/_root.yaml project-centrifuge.yaml + cp chains-evm/_root.yaml project-ethereum.yaml + cp chains-evm/_root.yaml project-base.yaml + yarn codegen - name: Build run: yarn build - lint: name: 'Run Linter' runs-on: ubuntu-latest @@ -43,7 +42,7 @@ jobs: - name: 'Checkout Repository' uses: actions/checkout@v3 - name: Initialise project.yaml - run: cp chains-cfg/base.yaml project.yaml + run: cp chains-cfg/_root.yaml project.yaml - name: 'Setup Node' uses: actions/setup-node@v3 with: @@ -61,7 +60,7 @@ jobs: - name: 'Checkout Repository' uses: actions/checkout@v3 - name: Initialise project.yaml - run: cp chains-cfg/base.yaml project.yaml + run: cp chains-cfg/_root.yaml project.yaml - name: 'Setup Node' uses: actions/setup-node@v3 with: diff --git a/.gitignore b/.gitignore index 04ceb770..c6b3c355 100644 --- a/.gitignore +++ b/.gitignore @@ -139,6 +139,5 @@ src/types .data/ **/project.yaml -**/project-centrifuge.yaml -**/project-ethereum.yaml +**/project-*.yaml *-cid diff --git a/chains-cfg/base.yaml b/chains-cfg/_root.yaml similarity index 100% rename from chains-cfg/base.yaml rename to chains-cfg/_root.yaml diff --git a/chains-evm/base.yaml b/chains-evm/_root.yaml similarity index 68% rename from chains-evm/base.yaml rename to chains-evm/_root.yaml index 87e09531..22ff290c 100644 --- a/chains-evm/base.yaml +++ b/chains-evm/_root.yaml @@ -12,6 +12,21 @@ description: 'SubQuery API powered by EMBRIO.tech to query Centrifuge chain data repository: https://github.com/centrifuge/pools-subql schema: file: './schema.graphql' +dataSources: + - kind: ethereum/Runtime + options: + abi: poolManager + assets: + poolManager: + file: './poolManager.abi.json' + mapping: + file: './dist/index.js' + handlers: + - handler: handleEvmDeployTranche + kind: ethereum/LogHandler + filter: + topics: + - DeployTranche(uint64 indexed poolId, bytes16 indexed trancheId, address indexed token) templates: - name: TrancheTracker kind: ethereum/Runtime diff --git a/chains-evm/altair.yaml b/chains-evm/altair.yaml deleted file mode 100644 index 619d4ae0..00000000 --- a/chains-evm/altair.yaml +++ /dev/null @@ -1,4 +0,0 @@ -network: - chainId: '5' #Goerli - endpoint: "https://goerli.infura.io/v3/${ETH_NODE_API_KEY}" - dictionary: "https://dict-tyk.subquery.network/query/eth-goerli" \ No newline at end of file diff --git a/chains-evm/base/centrifuge.yaml b/chains-evm/base/centrifuge.yaml new file mode 100644 index 00000000..8047168b --- /dev/null +++ b/chains-evm/base/centrifuge.yaml @@ -0,0 +1,9 @@ +network: + chainId: '8453' #Base Mainnet + endpoint: https://mainnet.base.org + dictionary: "https://api.subquery.network/sq/subquery/base-dictionary" +dataSources: + - kind: ethereum/Runtime + startBlock: 8053055 + options: + address: '0x78E9e622A57f70F1E0Ec652A4931E4e278e58142' \ No newline at end of file diff --git a/chains-evm/base/demo.yaml b/chains-evm/base/demo.yaml new file mode 100644 index 00000000..0dc22ef3 --- /dev/null +++ b/chains-evm/base/demo.yaml @@ -0,0 +1,9 @@ +network: + chainId: '84531' #Base Goerli + endpoint: https://goerli.base.org + dictionary: "https://api.subquery.network/sq/subquery/base-goerli-dictionary" +dataSources: + - kind: ethereum/Runtime + startBlock: 13078300 + options: + address: '0xa5Beda1F48a07740b8f4bDb223C861Cc7702b14e' \ No newline at end of file diff --git a/chains-evm/base/development-embrio.yaml b/chains-evm/base/development-embrio.yaml new file mode 100644 index 00000000..8df10edc --- /dev/null +++ b/chains-evm/base/development-embrio.yaml @@ -0,0 +1,11 @@ +name: 'centrifuge-subql' +repository: 'https://github.com/embrio-tech/centrifuge-subql' +network: + chainId: '84531' #Goerli + endpoint: https://goerli.base.org + dictionary: "https://api.subquery.network/sq/subquery/base-goerli-dictionary" +dataSources: + - kind: ethereum/Runtime + startBlock: 13078300 + options: + address: '0xa5Beda1F48a07740b8f4bDb223C861Cc7702b14e' \ No newline at end of file diff --git a/chains-evm/catalyst.yaml b/chains-evm/catalyst.yaml deleted file mode 100644 index 619d4ae0..00000000 --- a/chains-evm/catalyst.yaml +++ /dev/null @@ -1,4 +0,0 @@ -network: - chainId: '5' #Goerli - endpoint: "https://goerli.infura.io/v3/${ETH_NODE_API_KEY}" - dictionary: "https://dict-tyk.subquery.network/query/eth-goerli" \ No newline at end of file diff --git a/chains-evm/centrifuge.yaml b/chains-evm/centrifuge.yaml deleted file mode 100644 index 724601e9..00000000 --- a/chains-evm/centrifuge.yaml +++ /dev/null @@ -1,21 +0,0 @@ -network: - chainId: '1' # Ethereum Mainnet - endpoint: "https://mainnet.infura.io/v3/${ETH_NODE_API_KEY}" - dictionary: "https://gx.api.subquery.network/sq/subquery/eth-dictionary" -dataSources: - - kind: ethereum/Runtime - startBlock: 18671269 - options: - abi: poolManager - address: '0x78E9e622A57f70F1E0Ec652A4931E4e278e58142' - assets: - poolManager: - file: './poolManager.abi.json' - mapping: - file: './dist/index.js' - handlers: - - handler: handleEvmDeployTranche - kind: ethereum/LogHandler - filter: - topics: - - DeployTranche(uint64 indexed poolId, bytes16 indexed trancheId, address indexed token) \ No newline at end of file diff --git a/chains-evm/demo.yaml b/chains-evm/demo.yaml deleted file mode 100644 index ab7e17fe..00000000 --- a/chains-evm/demo.yaml +++ /dev/null @@ -1,21 +0,0 @@ -network: - chainId: '5' #Goerli - endpoint: "https://goerli.infura.io/v3/${ETH_NODE_API_KEY}" - dictionary: "https://dict-tyk.subquery.network/query/eth-goerli" -dataSources: - - kind: ethereum/Runtime - startBlock: 10055835 - options: - abi: poolManager - address: '0x53c155d44C03CC28f892f90aA0C442850716D75F' - assets: - poolManager: - file: './poolManager.abi.json' - mapping: - file: './dist/index.js' - handlers: - - handler: handleEvmDeployTranche - kind: ethereum/LogHandler - filter: - topics: - - DeployTranche(uint64 indexed poolId, bytes16 indexed trancheId, address indexed token) \ No newline at end of file diff --git a/chains-evm/development.yaml b/chains-evm/development.yaml deleted file mode 100644 index 619d4ae0..00000000 --- a/chains-evm/development.yaml +++ /dev/null @@ -1,4 +0,0 @@ -network: - chainId: '5' #Goerli - endpoint: "https://goerli.infura.io/v3/${ETH_NODE_API_KEY}" - dictionary: "https://dict-tyk.subquery.network/query/eth-goerli" \ No newline at end of file diff --git a/chains-evm/eth/centrifuge.yaml b/chains-evm/eth/centrifuge.yaml new file mode 100644 index 00000000..6719529c --- /dev/null +++ b/chains-evm/eth/centrifuge.yaml @@ -0,0 +1,9 @@ +network: + chainId: '1' # Ethereum Mainnet + endpoint: "https://mainnet.infura.io/v3/a4ba76cd4be643618572e7467a444e3a" + dictionary: "https://gx.api.subquery.network/sq/subquery/eth-dictionary" +dataSources: + - kind: ethereum/Runtime + startBlock: 18671269 + options: + address: '0x78E9e622A57f70F1E0Ec652A4931E4e278e58142' diff --git a/chains-evm/eth/demo.yaml b/chains-evm/eth/demo.yaml new file mode 100644 index 00000000..6f8131f7 --- /dev/null +++ b/chains-evm/eth/demo.yaml @@ -0,0 +1,9 @@ +network: + chainId: '5' #Ethereum Goerli + endpoint: "https://goerli.infura.io/v3/a4ba76cd4be643618572e7467a444e3a" + dictionary: "https://dict-tyk.subquery.network/query/eth-goerli" +dataSources: + - kind: ethereum/Runtime + startBlock: 10055835 + options: + address: '0x53c155d44C03CC28f892f90aA0C442850716D75F' \ No newline at end of file diff --git a/chains-evm/development-embrio.yaml b/chains-evm/eth/development-embrio.yaml similarity index 64% rename from chains-evm/development-embrio.yaml rename to chains-evm/eth/development-embrio.yaml index 11cacb47..130350e3 100644 --- a/chains-evm/development-embrio.yaml +++ b/chains-evm/eth/development-embrio.yaml @@ -3,4 +3,9 @@ repository: 'https://github.com/embrio-tech/centrifuge-subql' network: chainId: '5' #Goerli endpoint: "https://goerli.infura.io/v3/a4ba76cd4be643618572e7467a444e3a" - dictionary: "https://dict-tyk.subquery.network/query/eth-goerli" \ No newline at end of file + dictionary: "https://dict-tyk.subquery.network/query/eth-goerli" +dataSources: + - kind: ethereum/Runtime + startBlock: 10055835 + options: + address: '0x53c155d44C03CC28f892f90aA0C442850716D75F' \ No newline at end of file diff --git a/subquery-multichain.yaml b/subquery-multichain.yaml index 250feea4..2314fd31 100644 --- a/subquery-multichain.yaml +++ b/subquery-multichain.yaml @@ -4,4 +4,5 @@ query: version: '2' projects: - project-centrifuge.yaml + - project-base.yaml - project-ethereum.yaml