Fork of watcher-ts repo that will act as a mirror.
Go to file
nikugogoi 8489b5632a
Tests for pruning abandonded branches (#223)
* Create dummy test blocks and refactor test code.

* Intial test for pruning block in a chain without branches.

* Add test for pruning with multiple branches.

* Add test for pruning at frothy region.

* Test for pruning block at height more than max reorg depth.

Co-authored-by: prathamesh0 <prathamesh.musale0@gmail.com>
2021-08-20 12:26:37 +05:30
.github/workflows Fix github actions (#167) 2021-07-28 13:28:23 +05:30
packages Tests for pruning abandonded branches (#223) 2021-08-20 12:26:37 +05:30
scripts Add script to reset the databases. (#211) 2021-08-12 14:54:31 +05:30
.dockerignore docker image and Github Actions to build image 2021-07-23 15:42:50 +03:00
.gitignore Lazy ERC20 watcher (#11) 2021-05-28 16:56:40 +05:30
Dockerfile docker image and Github Actions to build image 2021-07-23 15:42:50 +03:00
lerna.json Setup lerna to run scripts across packages. 2021-06-08 12:49:00 +05:30
LICENSE Add APGL license and copyright notices (#212) 2021-08-12 15:28:13 +05:30
Makefile docker image and Github Actions to build image 2021-07-23 15:42:50 +03:00
package.json Add APGL license and copyright notices (#212) 2021-08-12 15:28:13 +05:30
README.md Add script to reset the databases. (#211) 2021-08-12 14:54:31 +05:30
yarn.lock uni-watcher smoke test (#172) 2021-07-30 19:50:56 +05:30

watcher-ts

Setup

This project uses yarn workspaces.

Install packages (Node.JS v15.11.0):

yarn

Services

The default config files used by the watchers assume the following services are setup and running on localhost:

  • vulcanize/go-ethereum on port 8545
  • vulcanize/ipld-eth-server with native GQL API enabled, on port 8082
  • postgraphile on the vulcanize/ipld-eth-server database, on port 5000

Note

  • In vulcanize/ipld-eth-server, add the following statement to [ethereum] section in environments/config.toml:

    chainConfig = "./chain.json" # ETH_CHAIN_CONFIG

Databases

Note: Requires postgres12.

Login as the postgres user:

sudo su - postgres

Create the databases for the watchers:

createdb erc20-watcher
createdb address-watcher
createdb uni-watcher
createdb uni-info-watcher

Create the databases for the job queues and enable the pgcrypto extension on them (https://github.com/timgit/pg-boss/blob/master/docs/usage.md#intro):

createdb address-watcher-job-queue
createdb uni-watcher-job-queue
postgres@tesla:~$ psql -U postgres -h localhost address-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.

address-watcher-job-queue=# CREATE EXTENSION pgcrypto;
CREATE EXTENSION
address-watcher-job-queue=# exit
postgres@tesla:~$ psql -U postgres -h localhost uni-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.

uni-watcher-job-queue=# CREATE EXTENSION pgcrypto;
CREATE EXTENSION
uni-watcher-job-queue=# exit

Reset

Reset the databases used by the watchers:

yarn db:reset

Run

To run any watcher, cd into their package folder and run:

yarn server

If the watcher uses a job queue, start the job runner in another terminal:

yarn job-runner