Skip to content
This repository was archived by the owner on Jan 25, 2022. It is now read-only.
Open
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 block-timestamp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
"@polkadot/api": "^4",
"@subql/types": "^0.7.1",
"typescript": "^4.1.3",
"@subql/cli": "^0.9.3"
"@subql/cli": "^0.13.0"
}
}
16 changes: 10 additions & 6 deletions block-timestamp/project.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
specVersion: "0.0.1"
description: "This subquery indexes timestamp of each block"
specVersion: "0.2.0"

name: "Subql-block-timestamp"
version: "0.0.0"
description: "Indexes timestamp of each finalized block."
repository: "https://github.com/subquery/subql-examples"

schema: "./schema.graphql"
schema:
file: "./schema.graphql"

network:
genesisHash: "0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3" # Polkadot
endpoint: "wss://polkadot.api.onfinality.io/public-ws"

dataSources:
- name: runtime
kind: substrate/Runtime
- kind: substrate/Runtime
startBlock: 500000
mapping:
file: "./dist/index.js"
handlers:
- handler: handleTimestampSet
kind: substrate/CallHandler
Expand Down
2 changes: 1 addition & 1 deletion entity-relation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
"@polkadot/api": "^4",
"@subql/types": "^0.7.1",
"typescript": "^4.1.3",
"@subql/cli": "^0.9.3"
"@subql/cli": "^0.13.0"
}
}
31 changes: 19 additions & 12 deletions entity-relation/project.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
specVersion: 0.0.1
description: This is an example of using 1-N relations
repository: ''
schema: ./schema.graphql
specVersion: "0.2.0"

name: "Subql-entityrelation"
version: "0.0.0"
description: "Indexes balance transfers between accounts, also indexes utility batchAll to find out the content of the extrinsic calls."
repository: "https://github.com/subquery/subql-examples"

schema:
file: "./schema.graphql"

network:
endpoint: 'wss://polkadot.api.onfinality.io/public-ws'
genesisHash: "0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3" # Polkadot
endpoint: "wss://polkadot.api.onfinality.io/public-ws"
dataSources:
- name: main
kind: substrate/Runtime
- kind: substrate/Runtime
startBlock: 1
mapping:
file: "./dist/index.js"
handlers:
- handler: handleTransfer
kind: substrate/EventHandler
filter:
module: balances
method: Transfer
- handler: handleCall
kind: substrate/CallHandler
filter:
module: utility
method: batchAll
success: true
- handler: handleTransfer
kind: substrate/EventHandler
filter:
module: balances
method: Transfer
2 changes: 1 addition & 1 deletion extrinsic-finalized-block/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
"@polkadot/api": "^4",
"@subql/types": "^0.7.1",
"typescript": "^4.1.3",
"@subql/cli": "^0.9.3"
"@subql/cli": "^0.13.0"
}
}
22 changes: 9 additions & 13 deletions extrinsic-finalized-block/project.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
specVersion: "0.0.1"
description: "This subquery indexes which block a given extrinsic is finalized in"
specVersion: "0.2.0"
name: "Subql-extrinsic-finalized-block"
version: "0.0.0"
description: "Index extrinsics and so they can be queried by hash."
repository: "https://github.com/subquery/subql-examples"

schema: "./schema.graphql"

schema:
file: "./schema.graphql"
network:
genesisHash: "0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3"
endpoint: "wss://polkadot.api.onfinality.io/public-ws"

dataSources:
- name: runtime
kind: substrate/Runtime
- kind: substrate/Runtime
startBlock: 1
mapping:
file: "./dist/index.js"
handlers:
- handler: handleBlock
kind: substrate/BlockHandler





2 changes: 1 addition & 1 deletion kitty/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@polkadot/api": "4.6.1",
"@subql/types": "^0.7.1",
"typescript": "^4.1.3",
"@subql/cli": "^0.9.3",
"@subql/cli": "^0.13.0",
"@polkadot/typegen": "4.6.1",
"ts-node": "^8.6.2"
},
Expand Down
16 changes: 11 additions & 5 deletions kitty/project.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
specVersion: "0.0.1"
description: "This subquery indexes kitty's birth info"
specVersion: "0.2.0"

name: "Subql-kitty"
version: "0.0.0"
description: "Indexes birthinfo of kitties."
repository: "https://github.com/subquery/subql-examples"

schema: "./schema.graphql"
schema:
file: "./schema.graphql"

network:
genesisHash: '0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3' # Polkadot
# replace this one by user
endpoint: "ws://host.docker.internal:9944"
types: {
"KittyIndex": "u32",
Expand Down Expand Up @@ -39,10 +45,10 @@ network:
}

dataSources:
- name: runtime
kind: substrate/Runtime
- kind: substrate/Runtime
startBlock: 1
mapping:
file: "./dist/index.js"
handlers:
- handler: handleKittyCreated
kind: substrate/EventHandler
Expand Down
2 changes: 1 addition & 1 deletion sum-reward/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
"@polkadot/api": "^4",
"@subql/types": "^0.7.1",
"typescript": "^4.1.3",
"@subql/cli": "^0.9.3"
"@subql/cli": "^0.13.0"
}
}
18 changes: 11 additions & 7 deletions sum-reward/project.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
specVersion: "0.0.1"
description: "This subquery indexes bond,reward and slash of each block, summarize total earning of an account"
specVersion: "0.2.0"

name: "Subql-sum-reward"
version: "0.0.0"
description: "Indexes staking bond, reward and slash from events of finalized block."
repository: "https://github.com/subquery/subql-examples"

schema: "./schema.graphql"
schema:
file: "./schema.graphql"

network:
endpoint: "wss://polkadot.api.onfinality.io/public-ws"

genesisHash: "0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3" # Polkadot
dataSources:
- name: runtime
kind: substrate/Runtime
- kind: substrate/Runtime
startBlock: 1
mapping:
file: "./dist/index.js"
handlers:
- handler: handleBond
kind: substrate/EventHandler
Expand Down Expand Up @@ -57,4 +61,4 @@ dataSources:
kind: substrate/EventHandler
filter:
module: staking
method: Slashed
method: Slashed
2 changes: 1 addition & 1 deletion validator-threshold/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
"@polkadot/api": "^4",
"@subql/types": "^0.7.1",
"typescript": "^4.1.3",
"@subql/cli": "^0.9.3"
"@subql/cli": "^0.13.0"
}
}
16 changes: 10 additions & 6 deletions validator-threshold/project.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
specVersion: "0.0.1"
description: "This subquery indexes bond,reward and slash of each block, summarize total earning of an account"
specVersion: "0.2.0"

name: "Subql-validator-threshold"
version: "0.0.0"
description: "Indexes the least staking amount required for a validator to be elected."
repository: "https://github.com/subquery/subql-examples"

schema: "./schema.graphql"
schema:
file: "./schema.graphql"

network:
genesisHash: "0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3" # Polkadot
endpoint: "wss://polkadot.api.onfinality.io/public-ws"

dataSources:
- name: runtime
kind: substrate/Runtime
# for kusama startBlock: 1445458
- kind: substrate/Runtime
startBlock: 1
mapping:
file: "./dist/index.js"
handlers:
- handler: handleBlock
kind: substrate/EventHandler
Expand Down