Skip to content

Commit

Permalink
Merge pull request #42 from novasamatech/dev
Browse files Browse the repository at this point in the history
Update master
  • Loading branch information
ERussel authored Jan 26, 2024
2 parents 51f4707 + f8c8330 commit 49288b6
Show file tree
Hide file tree
Showing 37 changed files with 1,146 additions and 84 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cli-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup Node.js environment
uses: actions/setup-node@v2
with:
node-version: 16
node-version: 18
- run: yarn
- name: Codegen
run: yarn codegen
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Setup Node.js environment
uses: actions/setup-node@v2
with:
node-version: 16
node-version: 18
- run: yarn
- name: Codegen
run: yarn codegen
Expand Down
54 changes: 54 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,33 @@ services:
timeout: 5s
retries: 5

subquery-node-polimec:
image: onfinality/subql-node:v2.2.1
depends_on:
"postgres":
condition: service_healthy
restart: always
environment:
DB_USER: postgres
DB_PASS: postgres
DB_DATABASE: postgres
DB_HOST: postgres
DB_PORT: 5432
volumes:
- ./:/app
command:
- -f=/app/project-polimec.yaml
- --multi-chain
- --db-schema=app
- --disable-historical
- --query-limit=1000000
- --batch-size=30
healthcheck:
test: [ "CMD", "curl", "-f", "http://subquery-node-polimec:3000/ready" ]
interval: 3s
timeout: 5s
retries: 10

subquery-node-polkadot:
image: onfinality/subql-node:v2.2.1
depends_on:
Expand Down Expand Up @@ -71,6 +98,33 @@ services:
timeout: 5s
retries: 10

subquery-node-manta:
image: onfinality/subql-node:v2.2.1
depends_on:
"postgres":
condition: service_healthy
restart: always
environment:
DB_USER: postgres
DB_PASS: postgres
DB_DATABASE: postgres
DB_HOST: postgres
DB_PORT: 5432
volumes:
- ./:/app
command:
- -f=/app/project-manta.yaml
- --multi-chain
- --db-schema=app
- --disable-historical
- --query-limit=1000000
- --batch-size=30
healthcheck:
test: [ "CMD", "curl", "-f", "http://subquery-node-manta:3000/ready" ]
interval: 3s
timeout: 5s
retries: 10

subquery-node-moonbeam:
image: onfinality/subql-node:v2.2.1
depends_on:
Expand Down
1 change: 1 addition & 0 deletions ipfs-cids/.project-multichain-cid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
QmWS7DE27CzG4SUTjpKhb7eeNbYBm4jL39udBPCrtRBoD7
4 changes: 4 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default {
preset: 'ts-jest',
testMatch: ['**/tests/**/*.test.ts'],
}
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@
"devDependencies": {
"@jest/globals": "^29.3.1",
"@polkadot/api": "^9",
"@subql/cli": "1.13.2-2",
"@subql/cli": "3.6.1",
"@subql/types": "1.7.3-2",
"@zeitgeistpm/type-defs": "^1.0.0",
"@zeroio/type-definitions": "^0.0.14",
"jest": "^29.3.1",
"jest": "^29.5.0",
"moonbeam-types-bundle": "^2.0.8",
"ts-jest": "^29.0.3",
"ts-jest": "^29.1.0",
"ts-node": "^10.9.1",
"@types/jest": "^29.5.1",
"typescript": "^4.1.3"
},
"exports": {
Expand All @@ -47,4 +49,4 @@
"@types/big.js": "^6.1.6",
"big.js": "^6.2.1"
}
}
}
19 changes: 19 additions & 0 deletions project-aleph-zero.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ schema:
network:
chainId: "0x70255b4d28de0fc4e1a193d7e175ad1ccef431598211c55538f1018651a0344e"
endpoint: "wss://ws.azero.dev"
dictionary: "https://api.subquery.network/sq/subquery/aleph-zero-dictionary"
chaintypes:
file: ./dist/alephZeroChaintypes.js
dataSources:
Expand Down Expand Up @@ -48,6 +49,12 @@ dataSources:
module: staking
method: Rewarded

- handler: handleAlephZeroPoolStakingReward
kind: substrate/EventHandler
filter:
module: nominationPools
method: PaidOut

- handler: handleAlephZeroStakingSlash
kind: substrate/EventHandler
filter:
Expand All @@ -59,3 +66,15 @@ dataSources:
filter:
module: staking
method: Slashed

- handler: handleAlephZeroPoolStakingBondedSlash
kind: substrate/EventHandler
filter:
module: nominationPools
method: PoolSlashed

- handler: handleAlephZeroPoolStakingUnbondingSlash
kind: substrate/EventHandler
filter:
module: nominationPools
method: UnbondingPoolSlashed
18 changes: 18 additions & 0 deletions project-kusama.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ dataSources:
module: staking
method: Rewarded

- handler: handleKusamaPoolStakingReward
kind: substrate/EventHandler
filter:
module: nominationPools
method: PaidOut

- handler: handleKusamaStakingSlash
kind: substrate/EventHandler
filter:
Expand All @@ -58,3 +64,15 @@ dataSources:
filter:
module: staking
method: Slashed

- handler: handleKusamaPoolStakingBondedSlash
kind: substrate/EventHandler
filter:
module: nominationPools
method: PoolSlashed

- handler: handleKusamaPoolStakingUnbondingSlash
kind: substrate/EventHandler
filter:
module: nominationPools
method: UnbondingPoolSlashed
35 changes: 35 additions & 0 deletions project-manta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
specVersion: 1.0.0
name: nova-wallet-staking
version: 0.0.1
runner:
node:
name: "@subql/node"
version: ">=1.0.0"
query:
name: "@subql/query"
version: "*"
description: >-
Project that provides up-to-date information about on-chain staking APY
repository: "[email protected]:nova-wallet/subquery-staking.git"
schema:
file: ./schema.graphql
network:
chainId: "0xf3c7ad88f6a80f366c4be216691411ef0622e8b809b1046ea297ef106058d4eb"
endpoint: "wss://ws.manta.systems"
dataSources:
- kind: substrate/Runtime
startBlock: 2192400
mapping:
file: ./dist/index.js
handlers:
- handler: handleMantaNewEra
kind: substrate/EventHandler
filter:
module: parachainStaking
method: NewRound

- handler: handleMantaStakingReward
kind: substrate/EventHandler
filter:
module: parachainStaking
method: Rewarded
35 changes: 35 additions & 0 deletions project-polimec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
specVersion: 1.0.0
name: nova-wallet-staking
version: 0.0.1
runner:
node:
name: "@subql/node"
version: ">=1.0.0"
query:
name: "@subql/query"
version: "*"
description: >-
Project that provides up-to-date information about on-chain staking APY
repository: "[email protected]:nova-wallet/subquery-staking.git"
schema:
file: ./schema.graphql
network:
chainId: "0x7eb9354488318e7549c722669dcbdcdc526f1fef1420e7944667212f3601fdbd"
endpoint: "wss://rpc.polimec.org"
dataSources:
- kind: substrate/Runtime
startBlock: 1
mapping:
file: ./dist/index.js
handlers:
- handler: handlePolimecNewEra
kind: substrate/EventHandler
filter:
module: parachainStaking
method: NewRound

- handler: handlePolimecStakingReward
kind: substrate/EventHandler
filter:
module: parachainStaking
method: Rewarded
18 changes: 18 additions & 0 deletions project-polkadot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ dataSources:
module: staking
method: Rewarded

- handler: handlePolkadotPoolStakingReward
kind: substrate/EventHandler
filter:
module: nominationPools
method: PaidOut

- handler: handlePolkadotStakingSlash
kind: substrate/EventHandler
filter:
Expand All @@ -58,3 +64,15 @@ dataSources:
filter:
module: staking
method: Slashed

- handler: handlePolkadotPoolStakingBondedSlash
kind: substrate/EventHandler
filter:
module: nominationPools
method: PoolSlashed

- handler: handlePolkadotPoolStakingUnbondingSlash
kind: substrate/EventHandler
filter:
module: nominationPools
method: UnbondingPoolSlashed
18 changes: 18 additions & 0 deletions project-westend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ dataSources:
module: staking
method: Rewarded

- handler: handleWestendPoolStakingReward
kind: substrate/EventHandler
filter:
module: nominationPools
method: PaidOut

- handler: handleWestendStakingSlash
kind: substrate/EventHandler
filter:
Expand All @@ -59,3 +65,15 @@ dataSources:
filter:
module: staking
method: Slashed

- handler: handleWestendPoolStakingBondedSlash
kind: substrate/EventHandler
filter:
module: nominationPools
method: PoolSlashed

- handler: handleWestendPoolStakingUnbondingSlash
kind: substrate/EventHandler
filter:
module: nominationPools
method: UnbondingPoolSlashed
1 change: 1 addition & 0 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,5 @@ type Reward @entity {
amount: BigInt!
accumulatedAmount: BigInt!
type: RewardType!
poolId: Int
}
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
//Exports all handler functions
export * from "./mappings/polimec";
export * from "./mappings/polkadot";
export * from "./mappings/kusama";
export * from "./mappings/manta";
export * from "./mappings/moonbeam";
export * from "./mappings/moonriver";
export * from "./mappings/aleph-zero";
Expand Down
Loading

0 comments on commit 49288b6

Please sign in to comment.