Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

Commit

Permalink
Fix CI for different chains and non EVM environments (#88)
Browse files Browse the repository at this point in the history
* fix: ignore local project files

* feat: init multichain

* chore: remove unused olf chain files

* ci: deploy multiple indexers

* fix: modify deployment

* fix: eth specific indexer version

* fix: indexer version

* fix: avoid specity workers for EVM

* fix: no arrays for endpoints

* ci: ignore cid files

* 167 extend data model to include evm accounts (#171)

* feat: extend data model to include EVM accounts
Fixes #167

* feat: extend data model to include EVM accounts
Fixes #167

* ci: deploy only cfg

* fix: currency init logic

* 169 support additional borrower transaction type (#172)

* feat: support additional borrowerTransactionType DebtTransferred
Fixes #169

* feat: support additional borrowerTransactionType DebtTransfer
Fixes #169

* chore: upgrde indexer to 3.4.6

* chore: node upgrade

* Update src/mappings/handlers/loansHandlers.ts

Co-authored-by: Jeroen <1748621+hieronx@users.noreply.github.com>

* Update chains-evm/base.yaml

Co-authored-by: Jeroen <1748621+hieronx@users.noreply.github.com>

* fix: update node versions

* fix: add missing chain files

* 165 implement transfer inout mechanism (#178)

* feat: implement transfer in/out mechanism
Fixes #165

* feat: implement transfer in/out mechanism
Fixes #165

* chore: implement transfer in/out mechanism
Fixes #165

* feat: adapt data model to be chain independent

* fix: end of line

* feat: implement transfer in/out mechanism
Fixes #165

* feat: implement new currency model for orml tokens

* fix: implement transfer in/out mechanism
Fixes #165

* fix: implement transfer in/out mechanism
Fixes #165

* fix: implement transfer in/out mechanism
Fixes #165

* fix: implement transfer in/out mechanism
Fixes #165

* fix: update tests

* fix: endpoints

* fix: transfer typo

* feat: connect to BASE EVM Chain (#179)

Fixes #175

* ci: improve deployment logic

* ci: fix

* ci: fix

* ci: fix

* Delete project-coinbase.yaml

* fix: ignore project files

* ci: handle missing multichain files

* ci: fix yaml multiline

* ci: improve build resilience

* ci: improve build resilience

* ci: remove unrequired chains

* ci: rename files

* ci: fix base file naming

* fix: ci naming

* ci: fix chains

* ci: fix dev contract

---------

Co-authored-by: Jeroen <1748621+hieronx@users.noreply.github.com>
  • Loading branch information
filo87 and hieronx authored Dec 21, 2023
1 parent c00d676 commit 912ec38
Show file tree
Hide file tree
Showing 17 changed files with 115 additions and 83 deletions.
56 changes: 38 additions & 18 deletions .github/workflows/subql_deploy_workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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: |
Expand Down Expand Up @@ -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 \
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -32,18 +28,21 @@ 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
steps:
- 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:
Expand All @@ -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:
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,5 @@ src/types
.data/

**/project.yaml
**/project-centrifuge.yaml
**/project-ethereum.yaml
**/project-*.yaml
*-cid
File renamed without changes.
15 changes: 15 additions & 0 deletions chains-evm/base.yaml → chains-evm/_root.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions chains-evm/altair.yaml

This file was deleted.

9 changes: 9 additions & 0 deletions chains-evm/base/centrifuge.yaml
Original file line number Diff line number Diff line change
@@ -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'
9 changes: 9 additions & 0 deletions chains-evm/base/demo.yaml
Original file line number Diff line number Diff line change
@@ -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'
11 changes: 11 additions & 0 deletions chains-evm/base/development-embrio.yaml
Original file line number Diff line number Diff line change
@@ -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'
4 changes: 0 additions & 4 deletions chains-evm/catalyst.yaml

This file was deleted.

21 changes: 0 additions & 21 deletions chains-evm/centrifuge.yaml

This file was deleted.

21 changes: 0 additions & 21 deletions chains-evm/demo.yaml

This file was deleted.

4 changes: 0 additions & 4 deletions chains-evm/development.yaml

This file was deleted.

9 changes: 9 additions & 0 deletions chains-evm/eth/centrifuge.yaml
Original file line number Diff line number Diff line change
@@ -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'
9 changes: 9 additions & 0 deletions chains-evm/eth/demo.yaml
Original file line number Diff line number Diff line change
@@ -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'
Original file line number Diff line number Diff line change
Expand Up @@ -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"
dictionary: "https://dict-tyk.subquery.network/query/eth-goerli"
dataSources:
- kind: ethereum/Runtime
startBlock: 10055835
options:
address: '0x53c155d44C03CC28f892f90aA0C442850716D75F'
1 change: 1 addition & 0 deletions subquery-multichain.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ query:
version: '2'
projects:
- project-centrifuge.yaml
- project-base.yaml
- project-ethereum.yaml

0 comments on commit 912ec38

Please sign in to comment.