diff --git a/packages/moby-mask-watcher/.eslintignore b/packages/mobymask-watcher/.eslintignore similarity index 100% rename from packages/moby-mask-watcher/.eslintignore rename to packages/mobymask-watcher/.eslintignore diff --git a/packages/moby-mask-watcher/.eslintrc.json b/packages/mobymask-watcher/.eslintrc.json similarity index 100% rename from packages/moby-mask-watcher/.eslintrc.json rename to packages/mobymask-watcher/.eslintrc.json diff --git a/packages/moby-mask-watcher/README.md b/packages/mobymask-watcher/README.md similarity index 94% rename from packages/moby-mask-watcher/README.md rename to packages/mobymask-watcher/README.md index d8b44d35..93b6f267 100644 --- a/packages/moby-mask-watcher/README.md +++ b/packages/mobymask-watcher/README.md @@ -1,4 +1,4 @@ -# moby-mask-watcher +# mobymask-watcher ## Setup @@ -18,7 +18,7 @@ ```bash sudo su - postgres - createdb moby-mask-watcher + createdb mobymask-watcher ``` * If the watcher is an `active` watcher: @@ -26,19 +26,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 moby-mask-watcher-job-queue + createdb mobymask-watcher-job-queue ``` ``` - postgres@tesla:~$ psql -U postgres -h localhost moby-mask-watcher-job-queue + postgres@tesla:~$ psql -U postgres -h localhost mobymask-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. - moby-mask-watcher-job-queue=# CREATE EXTENSION pgcrypto; + mobymask-watcher-job-queue=# CREATE EXTENSION pgcrypto; CREATE EXTENSION - moby-mask-watcher-job-queue=# exit + mobymask-watcher-job-queue=# exit ``` * In the [config file](./environments/local.toml): diff --git a/packages/moby-mask-watcher/demo.md b/packages/mobymask-watcher/demo.md similarity index 89% rename from packages/moby-mask-watcher/demo.md rename to packages/mobymask-watcher/demo.md index 91619a20..7976b561 100644 --- a/packages/moby-mask-watcher/demo.md +++ b/packages/mobymask-watcher/demo.md @@ -51,30 +51,30 @@ sudo su - postgres # If database already exists - # dropdb moby-mask-watcher + # dropdb mobymask-watcher - createdb moby-mask-watcher + createdb mobymask-watcher ``` * 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): ```bash # If database already exists - # dropdb moby-mask-watcher-job-queue + # dropdb mobymask-watcher-job-queue - createdb moby-mask-watcher-job-queue + createdb mobymask-watcher-job-queue ``` ``` - postgres@tesla:~$ psql -U postgres -h localhost moby-mask-watcher-job-queue + postgres@tesla:~$ psql -U postgres -h localhost mobymask-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. - moby-mask-watcher-job-queue=# CREATE EXTENSION pgcrypto; + mobymask-watcher-job-queue=# CREATE EXTENSION pgcrypto; CREATE EXTENSION - moby-mask-watcher-job-queue=# exit + mobymask-watcher-job-queue=# exit ``` * In the [config file](./environments/local.toml) update the `database` connection settings. @@ -86,7 +86,7 @@ yarn && yarn build ``` -* Change directory to `packages/moby-mask-watcher/` and run the watcher: +* Change directory to `packages/mobymask-watcher/` and run the watcher: ```bash yarn server @@ -217,7 +217,7 @@ * The events should be visible in the subscription at GQL endpoint. Note down the event blockHash from result. -* The isMember and isPhisher lists should be indexed. Check the database (moby-mask-watcher) tables `is_phisher` and `is_member`, there should be entries at the event blockHash and the value should be true. The data is indexed in `handleEvent` method in the [hooks file](./src/hooks.ts). +* The isMember and isPhisher lists should be indexed. Check the database (mobymask-watcher) tables `is_phisher` and `is_member`, there should be entries at the event blockHash and the value should be true. The data is indexed in `handleEvent` method in the [hooks file](./src/hooks.ts). * Update the the previous query with event blockHash and check isPhisher and isMember in GraphQL playground diff --git a/packages/moby-mask-watcher/environments/local.toml b/packages/mobymask-watcher/environments/local.toml similarity index 90% rename from packages/moby-mask-watcher/environments/local.toml rename to packages/mobymask-watcher/environments/local.toml index cb19c9c3..b1fddfcc 100644 --- a/packages/moby-mask-watcher/environments/local.toml +++ b/packages/mobymask-watcher/environments/local.toml @@ -16,7 +16,7 @@ type = "postgres" host = "localhost" port = 5432 - database = "moby-mask-watcher" + database = "mobymask-watcher" username = "postgres" password = "postgres" synchronize = true @@ -26,7 +26,7 @@ [upstream.ethServer] gqlApiEndpoint = "http://127.0.0.1:8082/graphql" rpcProviderEndpoint = "http://127.0.0.1:8081" - blockDelayInMilliSecs = 2000 + blockDelayInMilliSecs = 60000 [upstream.cache] name = "requests" @@ -34,7 +34,7 @@ deleteOnStart = false [jobQueue] - dbConnectionString = "postgres://postgres:postgres@localhost/moby-mask-watcher-job-queue" + dbConnectionString = "postgres://postgres:postgres@localhost/mobymask-watcher-job-queue" maxCompletionLagInSecs = 300 jobDelayInMilliSecs = 100 eventsInBatch = 50 diff --git a/packages/moby-mask-watcher/package.json b/packages/mobymask-watcher/package.json similarity index 96% rename from packages/moby-mask-watcher/package.json rename to packages/mobymask-watcher/package.json index 8bba6e53..06a2b907 100644 --- a/packages/moby-mask-watcher/package.json +++ b/packages/mobymask-watcher/package.json @@ -1,7 +1,7 @@ { - "name": "@vulcanize/moby-mask-watcher", + "name": "@vulcanize/mobymask-watcher", "version": "0.1.0", - "description": "moby-mask-watcher", + "description": "mobymask-watcher", "private": true, "main": "dist/index.js", "scripts": { diff --git a/packages/moby-mask-watcher/src/artifacts/PhisherRegistry.json b/packages/mobymask-watcher/src/artifacts/PhisherRegistry.json similarity index 100% rename from packages/moby-mask-watcher/src/artifacts/PhisherRegistry.json rename to packages/mobymask-watcher/src/artifacts/PhisherRegistry.json diff --git a/packages/moby-mask-watcher/src/cli/checkpoint.ts b/packages/mobymask-watcher/src/cli/checkpoint.ts similarity index 100% rename from packages/moby-mask-watcher/src/cli/checkpoint.ts rename to packages/mobymask-watcher/src/cli/checkpoint.ts diff --git a/packages/moby-mask-watcher/src/cli/export-state.ts b/packages/mobymask-watcher/src/cli/export-state.ts similarity index 100% rename from packages/moby-mask-watcher/src/cli/export-state.ts rename to packages/mobymask-watcher/src/cli/export-state.ts diff --git a/packages/moby-mask-watcher/src/cli/import-state.ts b/packages/mobymask-watcher/src/cli/import-state.ts similarity index 100% rename from packages/moby-mask-watcher/src/cli/import-state.ts rename to packages/mobymask-watcher/src/cli/import-state.ts diff --git a/packages/moby-mask-watcher/src/cli/inspect-cid.ts b/packages/mobymask-watcher/src/cli/inspect-cid.ts similarity index 100% rename from packages/moby-mask-watcher/src/cli/inspect-cid.ts rename to packages/mobymask-watcher/src/cli/inspect-cid.ts diff --git a/packages/moby-mask-watcher/src/cli/reset-cmds/job-queue.ts b/packages/mobymask-watcher/src/cli/reset-cmds/job-queue.ts similarity index 100% rename from packages/moby-mask-watcher/src/cli/reset-cmds/job-queue.ts rename to packages/mobymask-watcher/src/cli/reset-cmds/job-queue.ts diff --git a/packages/moby-mask-watcher/src/cli/reset-cmds/state.ts b/packages/mobymask-watcher/src/cli/reset-cmds/state.ts similarity index 100% rename from packages/moby-mask-watcher/src/cli/reset-cmds/state.ts rename to packages/mobymask-watcher/src/cli/reset-cmds/state.ts diff --git a/packages/moby-mask-watcher/src/cli/reset.ts b/packages/mobymask-watcher/src/cli/reset.ts similarity index 100% rename from packages/moby-mask-watcher/src/cli/reset.ts rename to packages/mobymask-watcher/src/cli/reset.ts diff --git a/packages/moby-mask-watcher/src/cli/watch-contract.ts b/packages/mobymask-watcher/src/cli/watch-contract.ts similarity index 100% rename from packages/moby-mask-watcher/src/cli/watch-contract.ts rename to packages/mobymask-watcher/src/cli/watch-contract.ts diff --git a/packages/moby-mask-watcher/src/client.ts b/packages/mobymask-watcher/src/client.ts similarity index 100% rename from packages/moby-mask-watcher/src/client.ts rename to packages/mobymask-watcher/src/client.ts diff --git a/packages/moby-mask-watcher/src/database.ts b/packages/mobymask-watcher/src/database.ts similarity index 100% rename from packages/moby-mask-watcher/src/database.ts rename to packages/mobymask-watcher/src/database.ts diff --git a/packages/moby-mask-watcher/src/entity/BlockProgress.ts b/packages/mobymask-watcher/src/entity/BlockProgress.ts similarity index 100% rename from packages/moby-mask-watcher/src/entity/BlockProgress.ts rename to packages/mobymask-watcher/src/entity/BlockProgress.ts diff --git a/packages/moby-mask-watcher/src/entity/Contract.ts b/packages/mobymask-watcher/src/entity/Contract.ts similarity index 100% rename from packages/moby-mask-watcher/src/entity/Contract.ts rename to packages/mobymask-watcher/src/entity/Contract.ts diff --git a/packages/moby-mask-watcher/src/entity/DomainHash.ts b/packages/mobymask-watcher/src/entity/DomainHash.ts similarity index 100% rename from packages/moby-mask-watcher/src/entity/DomainHash.ts rename to packages/mobymask-watcher/src/entity/DomainHash.ts diff --git a/packages/moby-mask-watcher/src/entity/Event.ts b/packages/mobymask-watcher/src/entity/Event.ts similarity index 100% rename from packages/moby-mask-watcher/src/entity/Event.ts rename to packages/mobymask-watcher/src/entity/Event.ts diff --git a/packages/moby-mask-watcher/src/entity/IPLDBlock.ts b/packages/mobymask-watcher/src/entity/IPLDBlock.ts similarity index 100% rename from packages/moby-mask-watcher/src/entity/IPLDBlock.ts rename to packages/mobymask-watcher/src/entity/IPLDBlock.ts diff --git a/packages/moby-mask-watcher/src/entity/IpldStatus.ts b/packages/mobymask-watcher/src/entity/IpldStatus.ts similarity index 100% rename from packages/moby-mask-watcher/src/entity/IpldStatus.ts rename to packages/mobymask-watcher/src/entity/IpldStatus.ts diff --git a/packages/moby-mask-watcher/src/entity/IsMember.ts b/packages/mobymask-watcher/src/entity/IsMember.ts similarity index 100% rename from packages/moby-mask-watcher/src/entity/IsMember.ts rename to packages/mobymask-watcher/src/entity/IsMember.ts diff --git a/packages/moby-mask-watcher/src/entity/IsPhisher.ts b/packages/mobymask-watcher/src/entity/IsPhisher.ts similarity index 100% rename from packages/moby-mask-watcher/src/entity/IsPhisher.ts rename to packages/mobymask-watcher/src/entity/IsPhisher.ts diff --git a/packages/moby-mask-watcher/src/entity/IsRevoked.ts b/packages/mobymask-watcher/src/entity/IsRevoked.ts similarity index 100% rename from packages/moby-mask-watcher/src/entity/IsRevoked.ts rename to packages/mobymask-watcher/src/entity/IsRevoked.ts diff --git a/packages/moby-mask-watcher/src/entity/MultiNonce.ts b/packages/mobymask-watcher/src/entity/MultiNonce.ts similarity index 100% rename from packages/moby-mask-watcher/src/entity/MultiNonce.ts rename to packages/mobymask-watcher/src/entity/MultiNonce.ts diff --git a/packages/moby-mask-watcher/src/entity/SyncStatus.ts b/packages/mobymask-watcher/src/entity/SyncStatus.ts similarity index 100% rename from packages/moby-mask-watcher/src/entity/SyncStatus.ts rename to packages/mobymask-watcher/src/entity/SyncStatus.ts diff --git a/packages/moby-mask-watcher/src/entity/_Owner.ts b/packages/mobymask-watcher/src/entity/_Owner.ts similarity index 100% rename from packages/moby-mask-watcher/src/entity/_Owner.ts rename to packages/mobymask-watcher/src/entity/_Owner.ts diff --git a/packages/moby-mask-watcher/src/events.ts b/packages/mobymask-watcher/src/events.ts similarity index 100% rename from packages/moby-mask-watcher/src/events.ts rename to packages/mobymask-watcher/src/events.ts diff --git a/packages/moby-mask-watcher/src/fill.ts b/packages/mobymask-watcher/src/fill.ts similarity index 100% rename from packages/moby-mask-watcher/src/fill.ts rename to packages/mobymask-watcher/src/fill.ts diff --git a/packages/moby-mask-watcher/src/gql/index.ts b/packages/mobymask-watcher/src/gql/index.ts similarity index 100% rename from packages/moby-mask-watcher/src/gql/index.ts rename to packages/mobymask-watcher/src/gql/index.ts diff --git a/packages/moby-mask-watcher/src/gql/mutations/index.ts b/packages/mobymask-watcher/src/gql/mutations/index.ts similarity index 100% rename from packages/moby-mask-watcher/src/gql/mutations/index.ts rename to packages/mobymask-watcher/src/gql/mutations/index.ts diff --git a/packages/moby-mask-watcher/src/gql/mutations/watchContract.gql b/packages/mobymask-watcher/src/gql/mutations/watchContract.gql similarity index 100% rename from packages/moby-mask-watcher/src/gql/mutations/watchContract.gql rename to packages/mobymask-watcher/src/gql/mutations/watchContract.gql diff --git a/packages/moby-mask-watcher/src/gql/queries/_owner.gql b/packages/mobymask-watcher/src/gql/queries/_owner.gql similarity index 100% rename from packages/moby-mask-watcher/src/gql/queries/_owner.gql rename to packages/mobymask-watcher/src/gql/queries/_owner.gql diff --git a/packages/moby-mask-watcher/src/gql/queries/domainHash.gql b/packages/mobymask-watcher/src/gql/queries/domainHash.gql similarity index 100% rename from packages/moby-mask-watcher/src/gql/queries/domainHash.gql rename to packages/mobymask-watcher/src/gql/queries/domainHash.gql diff --git a/packages/moby-mask-watcher/src/gql/queries/events.gql b/packages/mobymask-watcher/src/gql/queries/events.gql similarity index 100% rename from packages/moby-mask-watcher/src/gql/queries/events.gql rename to packages/mobymask-watcher/src/gql/queries/events.gql diff --git a/packages/moby-mask-watcher/src/gql/queries/eventsInRange.gql b/packages/mobymask-watcher/src/gql/queries/eventsInRange.gql similarity index 100% rename from packages/moby-mask-watcher/src/gql/queries/eventsInRange.gql rename to packages/mobymask-watcher/src/gql/queries/eventsInRange.gql diff --git a/packages/moby-mask-watcher/src/gql/queries/getState.gql b/packages/mobymask-watcher/src/gql/queries/getState.gql similarity index 100% rename from packages/moby-mask-watcher/src/gql/queries/getState.gql rename to packages/mobymask-watcher/src/gql/queries/getState.gql diff --git a/packages/moby-mask-watcher/src/gql/queries/getStateByCID.gql b/packages/mobymask-watcher/src/gql/queries/getStateByCID.gql similarity index 100% rename from packages/moby-mask-watcher/src/gql/queries/getStateByCID.gql rename to packages/mobymask-watcher/src/gql/queries/getStateByCID.gql diff --git a/packages/moby-mask-watcher/src/gql/queries/index.ts b/packages/mobymask-watcher/src/gql/queries/index.ts similarity index 100% rename from packages/moby-mask-watcher/src/gql/queries/index.ts rename to packages/mobymask-watcher/src/gql/queries/index.ts diff --git a/packages/moby-mask-watcher/src/gql/queries/isMember.gql b/packages/mobymask-watcher/src/gql/queries/isMember.gql similarity index 100% rename from packages/moby-mask-watcher/src/gql/queries/isMember.gql rename to packages/mobymask-watcher/src/gql/queries/isMember.gql diff --git a/packages/moby-mask-watcher/src/gql/queries/isPhisher.gql b/packages/mobymask-watcher/src/gql/queries/isPhisher.gql similarity index 100% rename from packages/moby-mask-watcher/src/gql/queries/isPhisher.gql rename to packages/mobymask-watcher/src/gql/queries/isPhisher.gql diff --git a/packages/moby-mask-watcher/src/gql/queries/isRevoked.gql b/packages/mobymask-watcher/src/gql/queries/isRevoked.gql similarity index 100% rename from packages/moby-mask-watcher/src/gql/queries/isRevoked.gql rename to packages/mobymask-watcher/src/gql/queries/isRevoked.gql diff --git a/packages/moby-mask-watcher/src/gql/queries/multiNonce.gql b/packages/mobymask-watcher/src/gql/queries/multiNonce.gql similarity index 100% rename from packages/moby-mask-watcher/src/gql/queries/multiNonce.gql rename to packages/mobymask-watcher/src/gql/queries/multiNonce.gql diff --git a/packages/moby-mask-watcher/src/gql/subscriptions/index.ts b/packages/mobymask-watcher/src/gql/subscriptions/index.ts similarity index 100% rename from packages/moby-mask-watcher/src/gql/subscriptions/index.ts rename to packages/mobymask-watcher/src/gql/subscriptions/index.ts diff --git a/packages/moby-mask-watcher/src/gql/subscriptions/onEvent.gql b/packages/mobymask-watcher/src/gql/subscriptions/onEvent.gql similarity index 100% rename from packages/moby-mask-watcher/src/gql/subscriptions/onEvent.gql rename to packages/mobymask-watcher/src/gql/subscriptions/onEvent.gql diff --git a/packages/moby-mask-watcher/src/hooks.ts b/packages/mobymask-watcher/src/hooks.ts similarity index 100% rename from packages/moby-mask-watcher/src/hooks.ts rename to packages/mobymask-watcher/src/hooks.ts diff --git a/packages/moby-mask-watcher/src/indexer.ts b/packages/mobymask-watcher/src/indexer.ts similarity index 100% rename from packages/moby-mask-watcher/src/indexer.ts rename to packages/mobymask-watcher/src/indexer.ts diff --git a/packages/moby-mask-watcher/src/job-runner.ts b/packages/mobymask-watcher/src/job-runner.ts similarity index 100% rename from packages/moby-mask-watcher/src/job-runner.ts rename to packages/mobymask-watcher/src/job-runner.ts diff --git a/packages/moby-mask-watcher/src/resolvers.ts b/packages/mobymask-watcher/src/resolvers.ts similarity index 95% rename from packages/moby-mask-watcher/src/resolvers.ts rename to packages/mobymask-watcher/src/resolvers.ts index fb9d65f0..2b0a354b 100644 --- a/packages/moby-mask-watcher/src/resolvers.ts +++ b/packages/mobymask-watcher/src/resolvers.ts @@ -103,11 +103,6 @@ export const createResolvers = async (indexer: Indexer, eventWatcher: EventWatch eventsInRange: async (_: any, { fromBlockNumber, toBlockNumber }: { fromBlockNumber: number, toBlockNumber: number }) => { log('eventsInRange', fromBlockNumber, toBlockNumber); - const { expected, actual } = await indexer.getProcessedBlockCountForRange(fromBlockNumber, toBlockNumber); - if (expected !== actual) { - throw new Error(`Range not available, expected ${expected}, got ${actual} blocks in range`); - } - const events = await indexer.getEventsInRange(fromBlockNumber, toBlockNumber); return events.map(event => indexer.getResultEvent(event)); }, diff --git a/packages/moby-mask-watcher/src/schema.gql b/packages/mobymask-watcher/src/schema.gql similarity index 100% rename from packages/moby-mask-watcher/src/schema.gql rename to packages/mobymask-watcher/src/schema.gql diff --git a/packages/moby-mask-watcher/src/server.ts b/packages/mobymask-watcher/src/server.ts similarity index 100% rename from packages/moby-mask-watcher/src/server.ts rename to packages/mobymask-watcher/src/server.ts diff --git a/packages/moby-mask-watcher/src/types.ts b/packages/mobymask-watcher/src/types.ts similarity index 100% rename from packages/moby-mask-watcher/src/types.ts rename to packages/mobymask-watcher/src/types.ts diff --git a/packages/moby-mask-watcher/tsconfig.json b/packages/mobymask-watcher/tsconfig.json similarity index 100% rename from packages/moby-mask-watcher/tsconfig.json rename to packages/mobymask-watcher/tsconfig.json