-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #129 from embrio-tech/main
20240425 EMBRIO Sprint 30
- Loading branch information
Showing
28 changed files
with
1,084 additions
and
341 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
on: | ||
workflow_call: | ||
inputs: | ||
chainId: | ||
required: true | ||
type: string | ||
projOrg: | ||
required: true | ||
type: string | ||
projImage: | ||
required: false | ||
type: string | ||
deploymentType: | ||
description: stage or primary | ||
required: false | ||
type: string | ||
default: stage | ||
resetProject: | ||
default: false | ||
type: boolean | ||
secrets: | ||
accessToken: | ||
required: true | ||
onfinalityApiKey: | ||
required: true | ||
|
||
jobs: | ||
subql_deploy_workflow: | ||
runs-on: ubuntu-latest | ||
env: | ||
SUBQL_INDEXER_VERSION: v4.0.1 | ||
SUBQL_ETH_INDEXER_VERSION: v4.1.0 | ||
SUBQL_QUERY_VERSION: v2.10.0 | ||
CHAIN_ID: ${{ inputs.chainId }} | ||
SUBQL_ACCESS_TOKEN: ${{ secrets.accessToken }} | ||
SUBQL_PROJ_ORG: ${{ inputs.projOrg }} | ||
SUBQL_PROJ_IMAGE: ${{ inputs.projImage }} | ||
SUBQL_DEPLOYMENT_TYPE: ${{ inputs.deploymentType }} | ||
ONFINALITY_API_KEY: ${{ secrets.onfinalityApiKey }} | ||
steps: | ||
- name: Check out repo's default branch | ||
uses: actions/checkout@v3 | ||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: npm | ||
- name: Setup Yarn | ||
run: yarn install --frozen-lockfile | ||
- name: Codegen | ||
run: | | ||
CHAIN_ID=centrifuge yarn projectgen | ||
yarn codegen | ||
- name: SubQL CLI Version | ||
run: yarn subql --version | ||
- name: Generate new project data | ||
run: 'yarn projectgen' | ||
- name: Extract Chain Parameters to ENV | ||
run: | | ||
SUBQL_ENDPOINTS="" | ||
SUBQL_DICTIONARIES="" | ||
SUBQL_VERSIONS="" | ||
for projectFile in project-*.yaml; do | ||
echo "Reading $projectFile" | ||
chainId=$(yq '.network.chainId' $projectFile) | ||
endpoint=$(yq '.network.endpoint' $projectFile) | ||
dictionary=$(yq '.network.dictionary' $projectFile) | ||
if [[ -n "$SUBQL_ENDPOINTS" ]]; then SUBQL_ENDPOINTS+=","; fi | ||
SUBQL_ENDPOINTS+="${chainId}:${endpoint}" | ||
if [[ "$dictionary" != "null" ]]; then | ||
if [[ -n "$SUBQL_DICTIONARIES" ]]; then SUBQL_DICTIONARIES+=","; fi | ||
SUBQL_DICTIONARIES+="${chainId}:${dictionary}" | ||
fi | ||
done | ||
echo "SUBQL_PROJ_NAME=$(yq '.name' project-centrifuge.yaml)-multichain" >> $GITHUB_ENV | ||
echo "SUBQL_PROJ_DECRIPTION=$(yq '.description' project-centrifuge.yaml)" >> $GITHUB_ENV | ||
echo "SUBQL_ENDPOINTS=${SUBQL_ENDPOINTS}" >> $GITHUB_ENV | ||
echo "SUBQL_DICTIONARIES=${SUBQL_DICTIONARIES}" >> $GITHUB_ENV | ||
- name: Publish SubQL version | ||
run: | | ||
echo "IPFSCID=$(node_modules/.bin/subql publish -o)" >> $GITHUB_ENV | ||
- name: Delete Project | ||
if: ${{ inputs.resetProject }} | ||
run: | | ||
npx subql project:delete-project \ | ||
--org="$SUBQL_PROJ_ORG" \ | ||
--projectName="$SUBQL_PROJ_NAME" | ||
continue-on-error: true | ||
- name: Create Project | ||
if: ${{ inputs.resetProject }} | ||
run: | | ||
npx subql project:create-project \ | ||
--apiVersion=2 \ | ||
--description="$SUBQL_PROJ_DESCRIPTION" \ | ||
--gitRepo="https://github.com/$GITHUB_REPOSITORY" \ | ||
--org="$SUBQL_PROJ_ORG" \ | ||
--projectName="$SUBQL_PROJ_NAME" \ | ||
--logoURL="$SUBQL_PROJ_IMAGE" | ||
- name: Deploy Multichain Version | ||
run: | | ||
npx subql multi-chain:deploy \ | ||
-d \ | ||
--location=./subquery-multichain.yaml \ | ||
--org="$SUBQL_PROJ_ORG" \ | ||
--projectName="$SUBQL_PROJ_NAME" \ | ||
--endpoint="$SUBQL_ENDPOINTS" \ | ||
--dict="$SUBQL_DICTIONARIES" \ | ||
--type=$SUBQL_DEPLOYMENT_TYPE \ | ||
--disableHistorical \ | ||
--indexerWorkers=1 \ | ||
--indexerUnsafe \ | ||
--queryAggregate | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
network: | ||
chainId: '42220' #Celo Mainnet | ||
endpoint: "https://celo.api.onfinality.io/ws?apikey=${ONFINALITY_API_KEY}" | ||
#dictionary: "" | ||
dataSources: | ||
- kind: ethereum/Runtime | ||
startBlock: 23428180 | ||
options: | ||
address: '0x78E9e622A57f70F1E0Ec652A4931E4e278e58142' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
network: | ||
chainId: '5' #Ethereum Goerli | ||
endpoint: "https://goerli.infura.io/v3/a4ba76cd4be643618572e7467a444e3a" | ||
dictionary: "https://dict-tyk.subquery.network/query/eth-goerli" | ||
chainId: '11155111' #Ethereum Sepolia | ||
endpoint: "https://sepolia.infura.io/v3/ed5e0e19bcbc427cbf8f661736d44516" | ||
dataSources: | ||
- kind: ethereum/Runtime | ||
startBlock: 10055835 | ||
startBlock: 5232630 | ||
options: | ||
address: '0x53c155d44C03CC28f892f90aA0C442850716D75F' | ||
address: '0x5c8657b827a138D52a4e3f03683A28B1FaD86893' |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.