mirror of
https://github.com/cerc-io/watcher-ts
synced 2025-01-22 02:59:06 +00:00
Lint fixes in bayc-watcher and rename database (#227)
* Lint fixes in bayc-watcher * Rename output to bayc-watcher and set contract kind to BAYC
This commit is contained in:
parent
d1a172017d
commit
9a4a7cf018
@ -1,4 +1,4 @@
|
||||
# output
|
||||
# bayc-watcher
|
||||
|
||||
## Setup
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
|
||||
```bash
|
||||
sudo su - postgres
|
||||
createdb output
|
||||
createdb bayc-watcher
|
||||
```
|
||||
|
||||
* If the watcher is an `active` watcher:
|
||||
@ -20,19 +20,19 @@
|
||||
Create database for the job queue and enable the `pgcrypto` extension on them (https://github.com/timgit/pg-boss/blob/master/docs/usage.md#intro):
|
||||
|
||||
```
|
||||
createdb output-job-queue
|
||||
createdb bayc-watcher-job-queue
|
||||
```
|
||||
|
||||
```
|
||||
postgres@tesla:~$ psql -U postgres -h localhost output-job-queue
|
||||
postgres@tesla:~$ psql -U postgres -h localhost bayc-watcher-job-queue
|
||||
Password for user postgres:
|
||||
psql (12.7 (Ubuntu 12.7-1.pgdg18.04+1))
|
||||
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off)
|
||||
Type "help" for help.
|
||||
|
||||
output-job-queue=# CREATE EXTENSION pgcrypto;
|
||||
bayc-watcher-job-queue=# CREATE EXTENSION pgcrypto;
|
||||
CREATE EXTENSION
|
||||
output-job-queue=# exit
|
||||
bayc-watcher-job-queue=# exit
|
||||
```
|
||||
|
||||
* In the [config file](./environments/local.toml):
|
||||
|
@ -30,7 +30,7 @@
|
||||
type = "postgres"
|
||||
host = "localhost"
|
||||
port = 5432
|
||||
database = "output"
|
||||
database = "bayc-watcher"
|
||||
username = "postgres"
|
||||
password = "postgres"
|
||||
synchronize = true
|
||||
@ -47,7 +47,7 @@
|
||||
deleteOnStart = false
|
||||
|
||||
[jobQueue]
|
||||
dbConnectionString = "postgres://postgres:postgres@localhost/output-job-queue"
|
||||
dbConnectionString = "postgres://postgres:postgres@localhost/bayc-watcher-job-queue"
|
||||
maxCompletionLagInSecs = 300
|
||||
jobDelayInMilliSecs = 100
|
||||
eventsInBatch = 50
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@cerc-io/output",
|
||||
"name": "@cerc-io/bayc-watcher",
|
||||
"version": "0.1.0",
|
||||
"description": "output",
|
||||
"description": "bayc-watcher",
|
||||
"private": true,
|
||||
"main": "dist/index.js",
|
||||
"scripts": {
|
||||
|
@ -36,7 +36,6 @@ export const handler = async (argv: any): Promise<void> => {
|
||||
const db = new Database(config.database);
|
||||
await db.init();
|
||||
|
||||
|
||||
const jobQueueConfig = config.jobQueue;
|
||||
assert(jobQueueConfig, 'Missing job queue config');
|
||||
|
||||
|
@ -56,7 +56,7 @@ import { Owner } from './entity/Owner';
|
||||
const log = debug('vulcanize:indexer');
|
||||
const JSONbigNative = JSONbig({ useNativeBigInt: true });
|
||||
|
||||
const KIND_BOREDAPEYACHTCLUB = 'Empty';
|
||||
const KIND_BOREDAPEYACHTCLUB = 'BAYC';
|
||||
|
||||
export class Indexer implements IndexerInterface {
|
||||
_db: Database
|
||||
@ -93,7 +93,6 @@ export class Indexer implements IndexerInterface {
|
||||
assert(BoredApeYachtClubStorageLayout);
|
||||
this._storageLayoutMap.set(KIND_BOREDAPEYACHTCLUB, BoredApeYachtClubStorageLayout);
|
||||
this._contractMap.set(KIND_BOREDAPEYACHTCLUB, new ethers.utils.Interface(BoredApeYachtClubABI));
|
||||
|
||||
}
|
||||
|
||||
get serverConfig (): ServerConfig {
|
||||
@ -801,12 +800,11 @@ export class Indexer implements IndexerInterface {
|
||||
TokenOfOwnerByIndex,
|
||||
TokenByIndex,
|
||||
BaseURI,
|
||||
Owner,
|
||||
Owner
|
||||
];
|
||||
await this._baseIndexer.resetWatcherToBlock(blockNumber, entities);
|
||||
}
|
||||
|
||||
|
||||
async _saveBlockAndFetchEvents ({
|
||||
cid: blockCid,
|
||||
blockHash,
|
||||
|
@ -13,7 +13,6 @@ import { ValueResult, BlockHeight, gqlTotalQueryCount, gqlQueryCount, jsonBigInt
|
||||
import { Indexer } from './indexer';
|
||||
import { EventWatcher } from './events';
|
||||
|
||||
|
||||
const log = debug('vulcanize:resolver');
|
||||
|
||||
export const createResolvers = async (indexer: Indexer, eventWatcher: EventWatcher): Promise<any> => {
|
||||
|
@ -1,4 +1,3 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user