Skip to content

Commit

Permalink
adding bittensor (#14)
Browse files Browse the repository at this point in the history
* adding bittensor

* fix name
  • Loading branch information
stepanLav authored Aug 14, 2024
1 parent 49b77c8 commit 5874e45
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 1 deletion.
64 changes: 64 additions & 0 deletions bittensor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
specVersion: 1.0.0
name: subquery-proxy-bittensor
version: 1.0.0
runner:
node:
name: "@subql/node"
version: "*"
query:
name: "@subql/query"
version: v1.5.0
description: Nova SubQuery project
repository: https://github.com/nova-wallet/subquery-proxy
schema:
file: ./schema.graphql
network:
chainId: "0x2f0555cc76fc2840a25a6ea3b9637146806f1f44b090c175ffde2a7e5ab36c03"
endpoint: wss://archive.chain.opentensor.ai:443
chaintypes:
file: ./dist/bittensorChaintypes.js
dataSources:
- name: main
kind: substrate/Runtime
startBlock: 1
mapping:
file: ./dist/index.js
handlers:
- handler: handlePureProxyEvent
kind: substrate/EventHandler
filter:
module: proxy
method: PureCreated
- handler: handlePureProxyEvent
kind: substrate/EventHandler
filter:
module: proxy
method: AnonymousCreated
- handler: handleMultisigCall
kind: substrate/CallHandler
filter:
module: multisig
method: asMulti
success: true
isSigned: true
- handler: handleMultisigCall
kind: substrate/CallHandler
filter:
module: multisig
method: approveAsMulti
success: true
isSigned: true
- handler: handleMultisigCall
kind: substrate/CallHandler
filter:
module: multisig
method: cancelAsMulti
success: true
isSigned: true
- handler: handleMultisigCall
kind: substrate/CallHandler
filter:
module: multisig
method: asMultiThreshold1
success: true
isSigned: true
36 changes: 36 additions & 0 deletions chainTypes/bittensorChainTypes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
const definitions = {
types: [
{
// on all versions
minmax: [0, undefined],
types: {
Balance: "u64",
NeuronMetadata: {
version: "u32",
ip: "u128",
port: "u16",
ipType: "u8",
uid: "u32",
netuid: "u16",
modality: "u8",
hotkey: "AccountId",
coldkey: "AccountId",
active: "u32",
lastUpdate: "u64",
priority: "u64",
stake: "u64",
rank: "u64",
trust: "u64",
consensus: "u64",
incentive: "u64",
dividends: "u64",
emission: "u64",
bonds: "Vec<(u32, u64)>",
weights: "Vec<(u32, u32)>",
},
},
},
],
};

export default { typesBundle: { spec: { bittensor: definitions } } };
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"tslib": "^2.6.2"
},
"exports": {
"moonbeamChaintypes": "./chainTypes/moonbeamChaintypes.ts"
"moonbeamChaintypes": "./chainTypes/moonbeamChaintypes.ts",
"bittensorChaintypes": "./chainTypes/bittensorChainTypes.ts"
}
}

0 comments on commit 5874e45

Please sign in to comment.