Skip to content

Commit

Permalink
Merge pull request #92 from subquery/update-postgres
Browse files Browse the repository at this point in the history
Update postgres and CI, revert manifest file format
  • Loading branch information
jiqiang90 authored Oct 9, 2023
2 parents 6827928 + 5ad1229 commit d2868e9
Show file tree
Hide file tree
Showing 222 changed files with 2,981 additions and 4,590 deletions.
File renamed without changes.
20 changes: 20 additions & 0 deletions .github/scripts/ci.tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"esModuleInterop": true,
"declaration": true,
"importHelpers": true,
"resolveJsonModule": true,
"module": "commonjs",
"outDir": "dist",
"rootDir": "src",
"target": "es2017",
"strict": true
},
"include": [
"src/**/*",
"../../node_modules/@subql/types-core/dist/global.d.ts",
"../../node_modules/@subql/types/dist/global.d.ts"
]
}
13 changes: 13 additions & 0 deletions .github/scripts/copy-ts-config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

# This file copies over a modified TS config that works with workspaces so we can build all projects

set -e

for DEST_PATH in ./*/*/; do

SRC="./.github/scripts/ci.tsconfig.json"
DEST="${DEST_PATH}tsconfig.json"

[ -f "$DEST" ] && cp "$SRC" "$DEST"
done
29 changes: 16 additions & 13 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,24 @@ name: PR
on:
pull_request:
paths-ignore:
- '.github/workflows/**'
- ".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

- uses: actions/checkout@v2
- name: Setup Node.js environment
uses: actions/setup-node@v2
with:
node-version: 18
- name: setup workspace
run: cp .github/scripts/ci.package.json package.json
# Do this before yarn to avoid node_modules directory
- name: update tsconfigs for workspace
run: ./.github/scripts/copy-ts-config.sh
- run: yarn
- name: codegen
run: yarn codegen
- name: build
run: yarn build
2 changes: 1 addition & 1 deletion Acala/acala-evm-starter/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ package-lock.json
target/
dist/
src/types
project.yaml
# project.yaml

# JetBrains IDE
.idea/
Expand Down
4 changes: 2 additions & 2 deletions Acala/acala-evm-starter/docker/pg-Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM postgres:12-alpine
FROM postgres:16-alpine

# Variables needed at runtime to configure postgres and run the initdb scripts
ENV POSTGRES_DB 'postgres'
Expand All @@ -9,4 +9,4 @@ ENV POSTGRES_PASSWORD 'postgres'
COPY docker/load-extensions.sh /docker-entrypoint-initdb.d/

# Convert line endings to LF
RUN sed -i 's/\r$//' /docker-entrypoint-initdb.d/load-extensions.sh && chmod +x /docker-entrypoint-initdb.d/load-extensions.sh
RUN sed -i 's/\r$//' /docker-entrypoint-initdb.d/load-extensions.sh && chmod +x /docker-entrypoint-initdb.d/load-extensions.sh
83 changes: 0 additions & 83 deletions Acala/acala-evm-starter/project.ts

This file was deleted.

57 changes: 57 additions & 0 deletions Acala/acala-evm-starter/project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
specVersion: 1.0.0
name: acala-evm-starter
version: 1.0.0
runner:
node:
name: "@subql/node"
version: "*"
query:
name: "@subql/query"
version: "*"
description: A basic Acala EVM example
repository: "https://github.com/subquery/acala-evm-starter"
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",
]
# Optionally provide the HTTP endpoint of a full chain dictionary to speed up processing
dictionary: https://explorer.subquery.network/subquery/subquery/acala-dictionary
chaintypes:
file: ./dist/chaintypes.js
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:
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)"
- null
- null
- null
- handler: handleAcalaEvmCall
kind: substrate/AcalaEvmCall
filter:
function: "approve(address to,uint256 value)"
2 changes: 1 addition & 1 deletion Acala/acala-starter/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ package-lock.json
target/
dist/
src/types
project.yaml
# project.yaml

# JetBrains IDE
.idea/
Expand Down
4 changes: 2 additions & 2 deletions Acala/acala-starter/docker/pg-Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM postgres:12-alpine
FROM postgres:16-alpine

# Variables needed at runtime to configure postgres and run the initdb scripts
ENV POSTGRES_DB 'postgres'
Expand All @@ -9,4 +9,4 @@ ENV POSTGRES_PASSWORD 'postgres'
COPY docker/load-extensions.sh /docker-entrypoint-initdb.d/

# Convert line endings to LF
RUN sed -i 's/\r$//' /docker-entrypoint-initdb.d/load-extensions.sh && chmod +x /docker-entrypoint-initdb.d/load-extensions.sh
RUN sed -i 's/\r$//' /docker-entrypoint-initdb.d/load-extensions.sh && chmod +x /docker-entrypoint-initdb.d/load-extensions.sh
82 changes: 0 additions & 82 deletions Acala/acala-starter/project.ts

This file was deleted.

51 changes: 51 additions & 0 deletions Acala/acala-starter/project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
specVersion: 1.0.0
name: acala-starter
version: 1.0.0
runner:
node:
name: "@subql/node"
version: "*"
query:
name: "@subql/query"
version: "*"
description: This project can be used as a starting point for developing your SubQuery project. It indexes all transfers on Acala network
repository: "https://github.com/subquery/acala-subql-starter"
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",
]
# Optionally provide the HTTP endpoint of a full chain dictionary to speed up processing
dictionary: "https://api.subquery.network/sq/subquery/acala-dictionary"
chaintypes:
file: ./dist/chaintypes.js
dataSources:
- kind: substrate/Runtime
startBlock: 1
mapping:
file: ./dist/index.js
handlers:
# - handler: handleBlock
# kind: substrate/BlockHandler
# - handler: handleCall
# kind: substrate/CallHandler
# filter:
# method:
# module: balances
# method: Deposit
# success: true
- handler: handleEvent
kind: substrate/EventHandler
filter:
module: balances
method: Transfer
Loading

0 comments on commit d2868e9

Please sign in to comment.