|
| 1 | +import { |
| 2 | + EthereumProject, |
| 3 | + EthereumDatasourceKind, |
| 4 | + EthereumHandlerKind, |
| 5 | +} from "@subql/types-ethereum"; |
| 6 | + |
| 7 | +// Can expand the Datasource processor types via the generic param |
| 8 | +const project: EthereumProject = { |
| 9 | + specVersion: "1.0.0", |
| 10 | + version: "0.0.1", |
| 11 | + name: "subquery-example-ens", |
| 12 | + description: |
| 13 | + "This project can be use as a starting point for developing your new Ethereum SubQuery project", |
| 14 | + runner: { |
| 15 | + node: { |
| 16 | + name: "@subql/node-ethereum", |
| 17 | + version: ">=3.0.0", |
| 18 | + }, |
| 19 | + query: { |
| 20 | + name: "@subql/query", |
| 21 | + version: "*", |
| 22 | + }, |
| 23 | + }, |
| 24 | + schema: { |
| 25 | + file: "./schema.graphql", |
| 26 | + }, |
| 27 | + network: { |
| 28 | + /** |
| 29 | + * chainId is the EVM Chain ID, for Ethereum this is 1 |
| 30 | + * https://chainlist.org/chain/1 |
| 31 | + */ |
| 32 | + chainId: "11155111", |
| 33 | + /** |
| 34 | + * These endpoint(s) should be public non-pruned archive node |
| 35 | + * We recommend providing more than one endpoint for improved reliability, performance, and uptime |
| 36 | + * Public nodes may be rate limited, which can affect indexing speed |
| 37 | + * When developing your project we suggest getting a private API key |
| 38 | + * If you use a rate limited endpoint, adjust the --batch-size and --workers parameters |
| 39 | + * These settings can be found in your docker-compose.yaml, they will slow indexing but prevent your project being rate limited |
| 40 | + */ |
| 41 | + endpoint: ["http://142.215.53.16:8545/"], |
| 42 | + dictionary: "http://142.215.53.16:8545/", |
| 43 | + }, |
| 44 | + dataSources: [ |
| 45 | + // ENSRegistry |
| 46 | + { |
| 47 | + kind: EthereumDatasourceKind.Runtime, |
| 48 | + startBlock: 3702728, |
| 49 | + |
| 50 | + options: { |
| 51 | + // Must be a key of assets |
| 52 | + abi: "EnsRegistry", |
| 53 | + address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e", |
| 54 | + }, |
| 55 | + assets: new Map([["EnsRegistry", { file: "./abis/Registry.json" }]]), |
| 56 | + mapping: { |
| 57 | + file: "./dist/index.js", |
| 58 | + handlers: [ |
| 59 | + { |
| 60 | + kind: EthereumHandlerKind.Event, |
| 61 | + handler: "handleTransfer", |
| 62 | + filter: { |
| 63 | + topics: ["Transfer(bytes32,address)"], |
| 64 | + }, |
| 65 | + }, |
| 66 | + { |
| 67 | + kind: EthereumHandlerKind.Event, |
| 68 | + handler: "handleNewOwner", |
| 69 | + filter: { |
| 70 | + topics: ["NewOwner(bytes32,bytes32,address)"], |
| 71 | + }, |
| 72 | + }, |
| 73 | + { |
| 74 | + kind: EthereumHandlerKind.Event, |
| 75 | + handler: "handleNewResolver", |
| 76 | + filter: { |
| 77 | + topics: ["NewResolver(bytes32,address)"], |
| 78 | + }, |
| 79 | + }, |
| 80 | + { |
| 81 | + kind: EthereumHandlerKind.Event, |
| 82 | + handler: "handleNewTTL", |
| 83 | + filter: { |
| 84 | + topics: ["NewTTL(bytes32,uint64)"], |
| 85 | + }, |
| 86 | + }, |
| 87 | + ], |
| 88 | + }, |
| 89 | + }, |
| 90 | + // Resolver |
| 91 | + { |
| 92 | + kind: EthereumDatasourceKind.Runtime, |
| 93 | + startBlock: 3790251, |
| 94 | + |
| 95 | + options: { |
| 96 | + // Must be a key of assets |
| 97 | + abi: "Resolver", |
| 98 | + address: '0x8FADE66B79cC9f707aB26799354482EB93a5B7dD', |
| 99 | + }, |
| 100 | + assets: new Map([["Resolver", { file: "./abis/PublicResolver.json" }]]), |
| 101 | + mapping: { |
| 102 | + file: "./dist/index.js", |
| 103 | + handlers: [ |
| 104 | + { |
| 105 | + kind: EthereumHandlerKind.Event, |
| 106 | + handler: "handleABIChanged", |
| 107 | + filter: { |
| 108 | + topics: ["ABIChanged(bytes32,uint256)"], |
| 109 | + }, |
| 110 | + }, |
| 111 | + { |
| 112 | + kind: EthereumHandlerKind.Event, |
| 113 | + handler: "handleAddrChanged", |
| 114 | + filter: { |
| 115 | + topics: ["AddrChanged(bytes32,address)"], |
| 116 | + }, |
| 117 | + }, |
| 118 | + { |
| 119 | + kind: EthereumHandlerKind.Event, |
| 120 | + handler: "handleMulticoinAddrChanged", |
| 121 | + filter: { |
| 122 | + topics: ["AddressChanged(bytes32,uint256,bytes)"], |
| 123 | + }, |
| 124 | + }, |
| 125 | + { |
| 126 | + kind: EthereumHandlerKind.Event, |
| 127 | + handler: "handleAuthorisationChanged", |
| 128 | + filter: { |
| 129 | + topics: ["AuthorisationChanged(bytes32,address,address,bool)"], |
| 130 | + }, |
| 131 | + }, |
| 132 | + { |
| 133 | + kind: EthereumHandlerKind.Event, |
| 134 | + handler: "handleContentHashChanged", |
| 135 | + filter: { |
| 136 | + topics: ["ContenthashChanged(bytes32,bytes)"], |
| 137 | + }, |
| 138 | + }, |
| 139 | + { |
| 140 | + kind: EthereumHandlerKind.Event, |
| 141 | + handler: "handleInterfaceChanged", |
| 142 | + filter: { |
| 143 | + topics: ["InterfaceChanged(bytes32,bytes4,address)"], |
| 144 | + }, |
| 145 | + }, |
| 146 | + { |
| 147 | + kind: EthereumHandlerKind.Event, |
| 148 | + handler: "handleNameChanged", |
| 149 | + filter: { |
| 150 | + topics: ["NameChanged(bytes32,string)"], |
| 151 | + }, |
| 152 | + }, |
| 153 | + { |
| 154 | + kind: EthereumHandlerKind.Event, |
| 155 | + handler: "handlePubkeyChanged", |
| 156 | + filter: { |
| 157 | + topics: ["PubkeyChanged(bytes32,bytes32,bytes32)"], |
| 158 | + }, |
| 159 | + }, |
| 160 | + { |
| 161 | + kind: EthereumHandlerKind.Event, |
| 162 | + handler: "handleTextChanged", |
| 163 | + filter: { |
| 164 | + topics: ["TextChanged(bytes32,string,string)"], |
| 165 | + }, |
| 166 | + }, |
| 167 | + { |
| 168 | + kind: EthereumHandlerKind.Event, |
| 169 | + handler: "handleTextChangedWithValue", |
| 170 | + filter: { |
| 171 | + topics: ["TextChanged(bytes32,string,string,string)"], |
| 172 | + }, |
| 173 | + }, |
| 174 | + ], |
| 175 | + }, |
| 176 | + }, |
| 177 | + // BaseRegistrar |
| 178 | + { |
| 179 | + kind: EthereumDatasourceKind.Runtime, |
| 180 | + startBlock: 3702731, |
| 181 | + |
| 182 | + options: { |
| 183 | + // Must be a key of assets |
| 184 | + abi: "BaseRegistrar", |
| 185 | + address: "0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85", |
| 186 | + }, |
| 187 | + assets: new Map([ |
| 188 | + ["BaseRegistrar", { file: "./abis/BaseRegistrar.json" }], |
| 189 | + ]), |
| 190 | + mapping: { |
| 191 | + file: "./dist/index.js", |
| 192 | + handlers: [ |
| 193 | + { |
| 194 | + kind: EthereumHandlerKind.Event, |
| 195 | + handler: "handleNameRegistered", |
| 196 | + filter: { |
| 197 | + topics: ["NameRegistered(uint256,address,uint256)"], |
| 198 | + }, |
| 199 | + }, |
| 200 | + { |
| 201 | + kind: EthereumHandlerKind.Event, |
| 202 | + handler: "handleNameRenewed", |
| 203 | + filter: { |
| 204 | + topics: ["NameRenewed( uint256,uint256)"], |
| 205 | + }, |
| 206 | + }, |
| 207 | + { |
| 208 | + kind: EthereumHandlerKind.Event, |
| 209 | + handler: "handleNameTransferred", |
| 210 | + filter: { |
| 211 | + topics: ["Transfer(address,address,uint256)"], |
| 212 | + }, |
| 213 | + }, |
| 214 | + ], |
| 215 | + }, |
| 216 | + }, |
| 217 | + // EthRegistrarController |
| 218 | + { |
| 219 | + kind: EthereumDatasourceKind.Runtime, |
| 220 | + startBlock: 3790244, |
| 221 | + options: { |
| 222 | + // Must be a key of assets |
| 223 | + abi: "EthRegistrarController", |
| 224 | + address: "0xFED6a969AaA60E4961FCD3EBF1A2e8913ac65B72" |
| 225 | + }, |
| 226 | + assets: new Map([ |
| 227 | + [ |
| 228 | + "EthRegistrarController", |
| 229 | + { file: "./abis/EthRegistrarController.json" }, |
| 230 | + ], |
| 231 | + ]), |
| 232 | + mapping: { |
| 233 | + file: "./dist/index.js", |
| 234 | + handlers: [ |
| 235 | + { |
| 236 | + kind: EthereumHandlerKind.Event, |
| 237 | + handler: "handleNameRegisteredByController", |
| 238 | + filter: { |
| 239 | + topics: [ |
| 240 | + "NameRegistered(string, bytes32, address,uint256,uint256,uint256)", |
| 241 | + ], |
| 242 | + }, |
| 243 | + }, |
| 244 | + { |
| 245 | + kind: EthereumHandlerKind.Event, |
| 246 | + handler: "handleNameRenewedByController", |
| 247 | + filter: { |
| 248 | + topics: ["NameRenewed(string, bytes32,uint256,uint256)"], |
| 249 | + }, |
| 250 | + }, |
| 251 | + ], |
| 252 | + }, |
| 253 | + }, |
| 254 | + // NameWrapper |
| 255 | + { |
| 256 | + kind: EthereumDatasourceKind.Runtime, |
| 257 | + startBlock: 3790153, |
| 258 | + options: { |
| 259 | + // Must be a key of assets |
| 260 | + abi: "NameWrapper", |
| 261 | + address: "0x0635513f179D50A207757E05759CbD106d7dFcE8" |
| 262 | + }, |
| 263 | + assets: new Map([["NameWrapper", { file: "./abis/NameWrapper.json" }]]), |
| 264 | + mapping: { |
| 265 | + file: "./dist/index.js", |
| 266 | + handlers: [ |
| 267 | + { |
| 268 | + kind: EthereumHandlerKind.Event, |
| 269 | + handler: "handleNameWrapped", |
| 270 | + filter: { |
| 271 | + topics: ["NameWrapped( bytes32,bytes,address,uint32,uint64)"], |
| 272 | + }, |
| 273 | + }, |
| 274 | + { |
| 275 | + kind: EthereumHandlerKind.Event, |
| 276 | + handler: "handleNameUnwrapped", |
| 277 | + filter: { |
| 278 | + topics: ["NameUnwrapped( bytes32,address)"], |
| 279 | + }, |
| 280 | + }, |
| 281 | + { |
| 282 | + kind: EthereumHandlerKind.Event, |
| 283 | + handler: "handleFusesSet", |
| 284 | + filter: { |
| 285 | + topics: ["FusesSet( bytes32,uint32,uint64)"], |
| 286 | + }, |
| 287 | + }, |
| 288 | + { |
| 289 | + kind: EthereumHandlerKind.Event, |
| 290 | + handler: "handleTransferSingle", |
| 291 | + filter: { |
| 292 | + topics: [ |
| 293 | + "TransferSingle( address, address, address,uint256,uint256)", |
| 294 | + ], |
| 295 | + }, |
| 296 | + }, |
| 297 | + { |
| 298 | + kind: EthereumHandlerKind.Event, |
| 299 | + handler: "handleTransferBatch", |
| 300 | + filter: { |
| 301 | + topics: [ |
| 302 | + "TransferBatch( address, address, address,uint256[],uint256[])", |
| 303 | + ], |
| 304 | + }, |
| 305 | + }, |
| 306 | + ], |
| 307 | + }, |
| 308 | + }, |
| 309 | + ], |
| 310 | + repository: "https://github.com/subquery/ethereum-subql-starter", |
| 311 | +}; |
| 312 | + |
| 313 | +// Must set default to the project instance |
| 314 | +export default project; |
0 commit comments