From 36915c5adf9bd1c4d2763af679d6f079c810180e Mon Sep 17 00:00:00 2001 From: chandusai Date: Tue, 19 Oct 2021 14:00:56 +1300 Subject: [PATCH 1/4] updated project yaml files in all exmaples --- block-timestamp/package.json | 2 +- block-timestamp/project.yaml | 18 +++++++++------ entity-relation/package.json | 2 +- entity-relation/project.yaml | 31 ++++++++++++++++---------- extrinsic-finalized-block/package.json | 2 +- extrinsic-finalized-block/project.yaml | 22 ++++++++---------- kitty/package.json | 2 +- kitty/project.yaml | 16 ++++++++----- sum-reward/package.json | 2 +- sum-reward/project.yaml | 18 +++++++++------ validator-threshold/package.json | 2 +- validator-threshold/project.yaml | 16 ++++++++----- 12 files changed, 77 insertions(+), 56 deletions(-) diff --git a/block-timestamp/package.json b/block-timestamp/package.json index 81c568f..619412b 100644 --- a/block-timestamp/package.json +++ b/block-timestamp/package.json @@ -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" } } diff --git a/block-timestamp/project.yaml b/block-timestamp/project.yaml index 5cd330a..25c4613 100644 --- a/block-timestamp/project.yaml +++ b/block-timestamp/project.yaml @@ -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: "" 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 - startBlock: 500000 + - kind: substrate/Runtime + startBlock: 1 mapping: + file: "./dist/index.js" handlers: - handler: handleTimestampSet kind: substrate/CallHandler diff --git a/entity-relation/package.json b/entity-relation/package.json index 5e911ba..06a1168 100644 --- a/entity-relation/package.json +++ b/entity-relation/package.json @@ -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" } } diff --git a/entity-relation/project.yaml b/entity-relation/project.yaml index dfe344d..9d2636f 100644 --- a/entity-relation/project.yaml +++ b/entity-relation/project.yaml @@ -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: "" +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 diff --git a/extrinsic-finalized-block/package.json b/extrinsic-finalized-block/package.json index 6da07db..670c8f4 100644 --- a/extrinsic-finalized-block/package.json +++ b/extrinsic-finalized-block/package.json @@ -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" } } diff --git a/extrinsic-finalized-block/project.yaml b/extrinsic-finalized-block/project.yaml index eaffa74..f2dce38 100644 --- a/extrinsic-finalized-block/project.yaml +++ b/extrinsic-finalized-block/project.yaml @@ -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: "" 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 - - - - - diff --git a/kitty/package.json b/kitty/package.json index 9fb8c96..97de23c 100644 --- a/kitty/package.json +++ b/kitty/package.json @@ -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" }, diff --git a/kitty/project.yaml b/kitty/project.yaml index 4880d0e..2952883 100644 --- a/kitty/project.yaml +++ b/kitty/project.yaml @@ -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: "" 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", @@ -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 diff --git a/sum-reward/package.json b/sum-reward/package.json index f5828cb..ddc7b57 100644 --- a/sum-reward/package.json +++ b/sum-reward/package.json @@ -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" } } diff --git a/sum-reward/project.yaml b/sum-reward/project.yaml index 5f45d36..af11016 100644 --- a/sum-reward/project.yaml +++ b/sum-reward/project.yaml @@ -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: "" 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 @@ -57,4 +61,4 @@ dataSources: kind: substrate/EventHandler filter: module: staking - method: Slashed \ No newline at end of file + method: Slashed diff --git a/validator-threshold/package.json b/validator-threshold/package.json index 76b15c0..cc1996f 100644 --- a/validator-threshold/package.json +++ b/validator-threshold/package.json @@ -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" } } diff --git a/validator-threshold/project.yaml b/validator-threshold/project.yaml index 3b49f1a..4542012 100644 --- a/validator-threshold/project.yaml +++ b/validator-threshold/project.yaml @@ -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: "" 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 From abb7c5667b9b6c1633fd0f7c182dfacb71086a5f Mon Sep 17 00:00:00 2001 From: chandusai Date: Tue, 19 Oct 2021 15:23:50 +1300 Subject: [PATCH 2/4] fixed comments --- block-timestamp/project.yaml | 4 ++-- entity-relation/project.yaml | 2 +- extrinsic-finalized-block/project.yaml | 2 +- kitty/project.yaml | 4 ++-- sum-reward/project.yaml | 2 +- validator-threshold/project.yaml | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/block-timestamp/project.yaml b/block-timestamp/project.yaml index 25c4613..83b0783 100644 --- a/block-timestamp/project.yaml +++ b/block-timestamp/project.yaml @@ -2,7 +2,7 @@ specVersion: "0.2.0" name: "Subql-block-timestamp" version: "0.0.0" -description: "" +description: "https://github.com/subquery/subql-examples/blob/main/README.md" repository: "https://github.com/subquery/subql-examples" schema: @@ -13,7 +13,7 @@ network: endpoint: "wss://polkadot.api.onfinality.io/public-ws" dataSources: - kind: substrate/Runtime - startBlock: 1 + startBlock: 500000 mapping: file: "./dist/index.js" handlers: diff --git a/entity-relation/project.yaml b/entity-relation/project.yaml index 9d2636f..1cd47f4 100644 --- a/entity-relation/project.yaml +++ b/entity-relation/project.yaml @@ -2,7 +2,7 @@ specVersion: "0.2.0" name: "Subql-entityrelation" version: "0.0.0" -description: "" +description: " https://github.com/subquery/subql-examples/blob/main/README.md" repository: "https://github.com/subquery/subql-examples" schema: diff --git a/extrinsic-finalized-block/project.yaml b/extrinsic-finalized-block/project.yaml index f2dce38..fdbdaa1 100644 --- a/extrinsic-finalized-block/project.yaml +++ b/extrinsic-finalized-block/project.yaml @@ -1,7 +1,7 @@ specVersion: "0.2.0" name: "Subql-extrinsic-finalized-block" version: "0.0.0" -description: "" +description: "https://github.com/subquery/subql-examples/blob/main/README.md" repository: "https://github.com/subquery/subql-examples" schema: file: "./schema.graphql" diff --git a/kitty/project.yaml b/kitty/project.yaml index 2952883..4e77164 100644 --- a/kitty/project.yaml +++ b/kitty/project.yaml @@ -2,7 +2,7 @@ specVersion: "0.2.0" name: "Subql-kitty" version: "0.0.0" -description: "" +description: " https://github.com/subquery/subql-examples/blob/main/README.md" repository: "https://github.com/subquery/subql-examples" schema: @@ -45,7 +45,7 @@ network: } dataSources: - - kind: substrate/Runtime + - kind: substrate/Runtime startBlock: 1 mapping: file: "./dist/index.js" diff --git a/sum-reward/project.yaml b/sum-reward/project.yaml index af11016..d8a6cce 100644 --- a/sum-reward/project.yaml +++ b/sum-reward/project.yaml @@ -2,7 +2,7 @@ specVersion: "0.2.0" name: "Subql-sum-reward" version: "0.0.0" -description: "" +description:"https://github.com/subquery/subql-examples/blob/main/README.md" repository: "https://github.com/subquery/subql-examples" schema: diff --git a/validator-threshold/project.yaml b/validator-threshold/project.yaml index 4542012..1476b96 100644 --- a/validator-threshold/project.yaml +++ b/validator-threshold/project.yaml @@ -2,7 +2,7 @@ specVersion: "0.2.0" name: "Subql-validator-threshold" version: "0.0.0" -description: "" +description: "https://github.com/subquery/subql-examples/blob/main/README.md" repository: "https://github.com/subquery/subql-examples" schema: From 5f25e46c12ae463ceca82a6f596bd304b195b4a8 Mon Sep 17 00:00:00 2001 From: chandusai Date: Tue, 19 Oct 2021 15:59:35 +1300 Subject: [PATCH 3/4] updated description --- block-timestamp/project.yaml | 2 +- entity-relation/project.yaml | 2 +- extrinsic-finalized-block/project.yaml | 2 +- kitty/project.yaml | 2 +- sum-reward/project.yaml | 2 +- validator-threshold/project.yaml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/block-timestamp/project.yaml b/block-timestamp/project.yaml index 83b0783..1ac4b36 100644 --- a/block-timestamp/project.yaml +++ b/block-timestamp/project.yaml @@ -2,7 +2,7 @@ specVersion: "0.2.0" name: "Subql-block-timestamp" version: "0.0.0" -description: "https://github.com/subquery/subql-examples/blob/main/README.md" +description: "Indexes timestamp of each finalized block." repository: "https://github.com/subquery/subql-examples" schema: diff --git a/entity-relation/project.yaml b/entity-relation/project.yaml index 1cd47f4..19b0f38 100644 --- a/entity-relation/project.yaml +++ b/entity-relation/project.yaml @@ -2,7 +2,7 @@ specVersion: "0.2.0" name: "Subql-entityrelation" version: "0.0.0" -description: " https://github.com/subquery/subql-examples/blob/main/README.md" +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: diff --git a/extrinsic-finalized-block/project.yaml b/extrinsic-finalized-block/project.yaml index fdbdaa1..021e0a8 100644 --- a/extrinsic-finalized-block/project.yaml +++ b/extrinsic-finalized-block/project.yaml @@ -1,7 +1,7 @@ specVersion: "0.2.0" name: "Subql-extrinsic-finalized-block" version: "0.0.0" -description: "https://github.com/subquery/subql-examples/blob/main/README.md" +description: "Index extrinsics and so they can be queried by hash." repository: "https://github.com/subquery/subql-examples" schema: file: "./schema.graphql" diff --git a/kitty/project.yaml b/kitty/project.yaml index 4e77164..90cb71b 100644 --- a/kitty/project.yaml +++ b/kitty/project.yaml @@ -2,7 +2,7 @@ specVersion: "0.2.0" name: "Subql-kitty" version: "0.0.0" -description: " https://github.com/subquery/subql-examples/blob/main/README.md" +description: "Indexes birthinfo of kitties." repository: "https://github.com/subquery/subql-examples" schema: diff --git a/sum-reward/project.yaml b/sum-reward/project.yaml index d8a6cce..aa7a3a5 100644 --- a/sum-reward/project.yaml +++ b/sum-reward/project.yaml @@ -2,7 +2,7 @@ specVersion: "0.2.0" name: "Subql-sum-reward" version: "0.0.0" -description:"https://github.com/subquery/subql-examples/blob/main/README.md" +description: "Indexes staking bond, reward and slash from events of finalized block." repository: "https://github.com/subquery/subql-examples" schema: diff --git a/validator-threshold/project.yaml b/validator-threshold/project.yaml index 1476b96..b3c0650 100644 --- a/validator-threshold/project.yaml +++ b/validator-threshold/project.yaml @@ -2,7 +2,7 @@ specVersion: "0.2.0" name: "Subql-validator-threshold" version: "0.0.0" -description: "https://github.com/subquery/subql-examples/blob/main/README.md" +description: "Indexes the least staking amount required for a validator to be elected." repository: "https://github.com/subquery/subql-examples" schema: From 4b4d5bde36c9622761c9459965e6ce2ff0a8a976 Mon Sep 17 00:00:00 2001 From: chandusai Date: Tue, 19 Oct 2021 16:18:09 +1300 Subject: [PATCH 4/4] fix --- kitty/project.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kitty/project.yaml b/kitty/project.yaml index 90cb71b..869efb0 100644 --- a/kitty/project.yaml +++ b/kitty/project.yaml @@ -45,7 +45,7 @@ network: } dataSources: - - kind: substrate/Runtime + - kind: substrate/Runtime startBlock: 1 mapping: file: "./dist/index.js"