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

Update starters to use TS manifest #91

Merged
merged 6 commits into from
Oct 6, 2023
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
22 changes: 22 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: PR
on:
pull_request:
paths-ignore:
- '.github/workflows/**'
jobs:
pr:
name: pr
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node.js environment
uses: actions/setup-node@v2
with:
node-version: 18
- run: yarn
- name: codegen
run: yarn codegen
# Need to update tsconfig inputs paths for this to work
# - name: build
# run: yarn build

3 changes: 2 additions & 1 deletion Acala/acala-evm-starter/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ package-lock.json
# Package files
*.jar

# Maven
# Generated files
target/
dist/
src/types
project.yaml

# JetBrains IDE
.idea/
Expand Down
4 changes: 2 additions & 2 deletions Acala/acala-evm-starter/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ services:
retries: 5

subquery-node:
image: onfinality/subql-node:latest
image: subquerynetwork/subql-node-substrate:latest
depends_on:
"postgres":
condition: service_healthy
Expand All @@ -32,7 +32,7 @@ services:
volumes:
- ./:/app
command:
- ${SUB_COMMAND} # set SUB_COMMAND env variable to "test" to run tests
- ${SUB_COMMAND:-} # set SUB_COMMAND env variable to "test" to run tests
- -f=/app
- --db-schema=app
- --workers=4
Expand Down
46 changes: 0 additions & 46 deletions Acala/acala-evm-starter/karura.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion Acala/acala-evm-starter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@subql/testing": "latest",
"@subql/types": "latest",
"@subql/types-ethereum": "latest",
"typescript": "^4.6.2"
"typescript": "^5.2.2"
},
"exports": {
"chaintypes": "./src/chaintypes.ts"
Expand Down
83 changes: 83 additions & 0 deletions Acala/acala-evm-starter/project.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import {
SubstrateDatasourceKind,
SubstrateHandlerKind,
SubstrateProject,
} from "@subql/types";

import { AcalaEvmDatasource } from '@subql/acala-evm-processor';

// Can expand the Datasource processor types via the genreic param
const project: SubstrateProject<AcalaEvmDatasource> = {
specVersion: "1.0.0",
version: "0.0.1",
name: "acala-evm-starter",
description:
"A basic Acala EVM example",
runner: {
node: {
name: "@subql/node",
version: ">=3.0.1",
},
query: {
name: "@subql/query",
version: "*",
},
},
schema: {
file: "./schema.graphql",
},
network: {
/* The genesis hash of the network (hash of block 0) */
chainId:
"0xfc41b9bd8ef8fe53d58c7ea67c794c7ec9a73daf05e6d54b14ff6342c99ba64c",
/**
* This endpoint must be a public non-pruned archive node
* Public nodes may be rate limited, which can affect indexing speed
* When developing your project we suggest getting a private API key
* You can get them from OnFinality for free https://app.onfinality.io
* https://documentation.onfinality.io/support/the-enhanced-api-service
*/
endpoint: [
"wss://acala-polkadot.api.onfinality.io/public-ws",
"wss://acala-rpc-0.aca-api.network",
],
dictionary: 'https://explorer.subquery.network/subquery/subquery/acala-dictionary',
},
dataSources: [
{
kind: 'substrate/AcalaEvm',
startBlock: 1000000,
processor: {
file: './node_modules/@subql/acala-evm-processor/dist/bundle.js',
options: {
abi: 'erc20',
address: "0x0000000000000000000100000000000000000000" // ACA Token https://blockscout.acala.network/address/0x0000000000000000000100000000000000000000
}
},
assets: new Map([['erc20', { file: './erc20.abi.json' }]]),
mapping: {
file: './dist/index.js',
handlers: [
{
handler: 'handleAcalaEvmEvent',
kind: 'substrate/AcalaEvmEvent',
filter: {
topics: [
'Transfer(address indexed from,address indexed to,uint256 value)'
]
}
},
{
handler: 'handleAcalaEvmCall',
kind: 'substrate/AcalaEvmCall',
filter: {
function: 'approve(address to,uint256 value)'
}
}
]
},
},
],
};

export default project;
57 changes: 0 additions & 57 deletions Acala/acala-evm-starter/project.yaml

This file was deleted.

6 changes: 5 additions & 1 deletion Acala/acala-evm-starter/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,9 @@
"target": "es2017",
"strict": true
},
"include": ["src/**/*", "node_modules/@subql/types/dist/global.d.ts"]
"include": [
"src/**/*",
"node_modules/@subql/types-core/dist/global.d.ts",
"node_modules/@subql/types/dist/global.d.ts"
]
}
5 changes: 4 additions & 1 deletion Acala/acala-starter/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ package-lock.json
# Package files
*.jar

# Maven
# Generated files
target/
dist/
src/types
project.yaml

# JetBrains IDE
.idea/
Expand All @@ -53,3 +54,5 @@ Thumbs.db
*.mov
*.wmv

.data
.eslintcache
4 changes: 2 additions & 2 deletions Acala/acala-starter/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ services:
retries: 5

subquery-node:
image: onfinality/subql-node:latest
image: subquerynetwork/subql-node-substrate:latest
depends_on:
"postgres":
condition: service_healthy
Expand All @@ -32,7 +32,7 @@ services:
volumes:
- ./:/app
command:
- ${SUB_COMMAND} # set SUB_COMMAND env variable to "test" to run tests
- ${SUB_COMMAND:-} # set SUB_COMMAND env variable to "test" to run tests
- -f=/app
- --db-schema=app
- --workers=4
Expand Down
2 changes: 1 addition & 1 deletion Acala/acala-starter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"devDependencies": {
"@polkadot/api": "^10",
"@subql/types": "latest",
"typescript": "^4.1.3",
"typescript": "^5.2.2",
"@subql/cli": "latest",
"@acala-network/type-definitions": "latest",
"@subql/testing": "latest",
Expand Down
82 changes: 82 additions & 0 deletions Acala/acala-starter/project.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import {
SubstrateDatasourceKind,
SubstrateHandlerKind,
SubstrateProject,
} from "@subql/types";

// Can expand the Datasource processor types via the genreic param
const project: SubstrateProject = {
specVersion: "1.0.0",
version: "0.0.1",
name: "acala-starter",
description:
"This project can be used as a starting point for developing your SubQuery project. It indexes all transfers on Acala network",
runner: {
node: {
name: "@subql/node",
version: ">=3.0.1",
},
query: {
name: "@subql/query",
version: "*",
},
},
schema: {
file: "./schema.graphql",
},
network: {
/* The genesis hash of the network (hash of block 0) */
chainId:
"0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3",
/**
* This endpoint must be a public non-pruned archive node
* Public nodes may be rate limited, which can affect indexing speed
* When developing your project we suggest getting a private API key
* You can get them from OnFinality for free https://app.onfinality.io
* https://documentation.onfinality.io/support/the-enhanced-api-service
*/
endpoint: [
"wss://acala-polkadot.api.onfinality.io/public-ws",
"wss://acala-rpc-0.aca-api.network",
],
dictionary: 'https://api.subquery.network/sq/subquery/acala-dictionary',
chaintypes: {
file: './dist/chaintypes.js',
}
},
dataSources: [
{
kind: SubstrateDatasourceKind.Runtime,
startBlock: 1,
mapping: {
file: "./dist/index.js",
handlers: [
/*{
kind: SubstrateHandlerKind.Block,
handler: "handleBlock",
filter: {
modulo: 100,
},
},*/
/*{
kind: SubstrateHandlerKind.Call,
handler: "handleCall",
filter: {
module: "balances",
},
},*/
{
kind: SubstrateHandlerKind.Event,
handler: "handleEvent",
filter: {
module: "balances",
method: "Transfer",
},
},
],
},
},
],
};

export default project;
Loading
Loading