Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Further chain support CI improvements #104

Merged
merged 1 commit into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/template/template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[SubQuery](https://subquery.network) is a fast, flexible, and reliable open-source data indexer that provides you with custom APIs for your web3 project across all of our supported networks. To learn about how to get started with SubQuery, [visit our docs](https://academy.subquery.network).

**This SubQuery project indexes all transfers and approval events for the {{ERC20}} on {{name}}**
**This SubQuery project indexes all transfers and approval events for the {{ERC20Name}} ({{contractAddress}}) on {{prettyName}}**

## Start

Expand Down
4 changes: 2 additions & 2 deletions .github/template/template/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "{{lowercased_name}}-starter",
"version": "0.0.1",
"description": "This project can be use as a starting point for developing your new Aurora EVM SubQuery project",
"description": "This project can be use as a starting point for developing your new {{prettyName}} SubQuery project",
"main": "dist/index.js",
"scripts": {
"build": "subql build",
Expand Down Expand Up @@ -33,4 +33,4 @@
"ethers": "^5.7.2",
"typescript": "4.5.5"
}
}
}
5 changes: 2 additions & 3 deletions .github/template/template/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,16 @@ const project: EthereumProject = {
kind: EthereumDatasourceKind.Runtime,
startBlock: {{ startBlock }},
options: {
// Must be a key of assets
abi: "erc20",
// This is the contract address for {{ ERC20Name }} https://explorer.aurora.dev/address/0x4988a896b1227218e4A686fdE5EabdcAbd91571f
// This is the contract address for {{ ERC20Name }}
address: "{{ contractAddress }}",
},
assets: new Map([["erc20", { file: "./abis/erc20.abi.json" }]]),
mapping: {
file: "./dist/index.js",
handlers: [
{
kind: EthereumHandlerKind.Call, // We use ethereum handlers since Aurora is EVM-compatible
kind: EthereumHandlerKind.Call, // We use ethereum handlers since {{prettyName}} is EVM-compatible
handler: "handleTransaction",
filter: {
/**
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/chain_support.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,14 @@ jobs:
INPUT_JSON=$(cat input.json)
NAME=$(echo "$INPUT_JSON" | jq '.name')
FORMATTED_NAME=$(echo "$NAME" | tr '[:upper:]' '[:lower:]' | tr ' ' '-')
UPDATED_JSON=$(echo "$INPUT_JSON" | jq '. + { "lowercased_name": '"$FORMATTED_NAME"' }')
ENVIRONMENT=$(echo "$INPUT_JSON" | jq '.environment')
LOWERCASE_ENVIRONMENT=$(echo "$ENVIRONMENT" | tr '[:upper:]' '[:lower:]')
if [ "$LOWERCASE_ENVIRONMENT" = "mainnet" ]; then
PRETTYNAME="$NAME"
else
PRETTYNAME="$NAME $ENVIRONMENT"
fi
UPDATED_JSON=$(echo "$INPUT_JSON" | jq '. + { "lowercased_name": '"$FORMATTED_NAME"', "prettyName": '"$PRETTYNAME"'}')
echo "$UPDATED_JSON" > input.json
- name: Cat input.json
run: |
Expand Down
Loading